SQL Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to SQL. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Consider the following schema −

STUDENTS(student_code, first_name, last_name, email, 
         phone_no, date_of_birth, honours_subject, percentage_of_marks);

Which of the following query would display all the students where the second letter in the first name is ‘i’?

A - select first_name from students where first_name like ‘_i%’;

B - select first_name from students where first_name like ‘%i_’;

C - select first_name from students where first_name like ‘%i%’;

D - select first_name from students where first_name like ‘_i_’;

Answer : A

Q 2 - What is returned by ROUND(789.8389, 2)?

A - 789.84

B - 789.83

C - 78

D - 789.00

Answer : A

Answer : A

Q 5 - A subquery can be placed in which of the SQL clauses?

A - The WHERE clause

B - The HAVING clause

C - The FROM clause

D - All of the above.

Answer : D

Q 8 - Which of the following code will successfully delete the table LOCATIONS from the database?

A - DROP TABLE locations;

B - DELETE TABLE locations;

C - TRUNCATE TABLE locations;

D - None of the above.

Answer : A

Q 9 - Which of the following code will delete a sequence named loc_seq?

A - delete sequence loc-seq;

B - drop sequence loc_seq;

C - delete primary key loc_sec;

D - drop primary key loc_sec;

Answer : B

Q 10 - Which of the following statements allows William to change his database user account password to bill?

A - create user william identified by bill;

B - alter user william identified by bill

C - create user william password bill;

D - alter user william password bill;

Answer : B

sql_questions_answers.htm
Advertisements