Basic SQLs

Basic SQLs Quiz
Test your knowledge of SQL with our engaging Basic SQLs Quiz! Whether you're a beginner learning the ropes or someone looking to brush up on your skills, this quiz is designed to challenge and enhance your understanding of SQL syntax and queries.
- Multiple choice questions
- Covers fundamental SQL commands
- Ideal for beginners and intermediate learners
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';
{"name":"Basic SQLs", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of SQL with our engaging Basic SQLs Quiz! Whether you're a beginner learning the ropes or someone looking to brush up on your skills, this quiz is designed to challenge and enhance your understanding of SQL syntax and queries.Multiple choice questionsCovers fundamental SQL commandsIdeal for beginners and intermediate learners","img":"https:/images/course2.png"}