Basic SQLs

To display the first and last column of the table, what is the correct SQL
CustomerID FName LName DOB Sex Phone Address PostCode
20002 RAJOO THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181
20004 PHONGWATCHARARUK JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030
20006 CHOW SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149
20008 LIVERIADIS TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165
Select first, last from the customer;
Select * from customer;
select custoemrId and Address from customer;
select customerId, Postcode from customer;
To display all the details of all the customers
CustomerID FName LName DOB Sex Phone Address PostCode
20002 RAJOO THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181
20004 PHONGWATCHARARUK JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030
20006 CHOW SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149
20008 LIVERIADIS TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165
Select * from customer;
Select ALL from customer;
Select from customer
None of the answers are correct
To display all the details of all the customers whose name contains strring 'CH', the correct SQL is
CustomerID FName Sex LName DOB Sex Phone Address PostCode
20002 RAJOO M THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181
20004 PHONGWATCHARARUK F JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030
20006 CHOW M SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149
20008 LIVERIADIS F TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165
Select * from Customer;
Select * from customer where name like '% CH%;
Select * from customer where name = ' CHOW';
Select * from customer where name =CH
To display all the details of all the customers whose name contains strring 'CH', who are females, the correct SQL is
CustomerID FName Sex LName DOB Sex Phone Address PostCode
20002 RAJOO M THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181
20004 PHONGWATCHARARUK F JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030
20006 CHOW M SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149
20008 LIVERIADIS F TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165
Select * from Customer;
Select * from customer where name like '% CH% or Sex='F';
Select * from customer where name like '% CH% and Sex='F';
Select * from customer sex='F';
To display all the details of all the customers who are females living in either postcode 3035 or 3030, the correct SQL is
CustomerID FName Sex LName DOB Sex Phone Address PostCode
20002 RAJOO M THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181
20004 PHONGWATCHARARUK F JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030
20006 CHOW M SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149
20008 LIVERIADIS F TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165
Select * from where sex='F';
Select * from customer where (postcode=3030 or postcode=3035) and sex='F';
Select * from customer where postcode=3030 or postcode=3035 and sex='F
Select * from customer sex='F';
To display all the details of all the customers whose fname is Rajoo
CustomerID FName Sex LName DOB Sex Phone Address PostCode
20002 RAJOO M THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181
20004 PHONGWATCHARARUK F JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030
20006 CHOW M SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149
20008 LIVERIADIS F TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165
Select * from customer where fname ='Rajoo';
Select * from customer where fname like 'Rajoo';
Select * from customer where lower(fname) like 'rajoo';
Select * from customer where lower(fname) = 'rajoo';
0
{"name":"Basic SQLs", "url":"https://www.quiz-maker.com/QJZTU1PLU","txt":"To display the first and last column of the table, what is the correct SQL CustomerID FName LName DOB Sex Phone Address PostCode 20002 RAJOO THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181 20004 PHONGWATCHARARUK JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030 20006 CHOW SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149 20008 LIVERIADIS TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165, To display all the details of all the customers CustomerID FName LName DOB Sex Phone Address PostCode 20002 RAJOO THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181 20004 PHONGWATCHARARUK JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030 20006 CHOW SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149 20008 LIVERIADIS TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165, To display all the details of all the customers whose name contains strring 'CH', the correct SQL is CustomerID FName Sex LName DOB Sex Phone Address PostCode 20002 RAJOO M THINH MINH 1963-05-31 M 7842728 11 HILDA CRES 3181 20004 PHONGWATCHARARUK F JERZY MIROSLAW 1976-09-30 M 3193758 44 BARRINGTON AVE 3030 20006 CHOW M SOW LIM 1968-01-23 F 2982091 17 KERFERD ROAD 3149 20008 LIVERIADIS F TONY 1978-01-04 M 8325704 413 MT ALEXANDER RD 3165","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker