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 the full name of a student, with a column heading "Name"

A - select first_name, last_name as “Name” from students;

B - select Name from students;

C - select first_name || last_name as “Name” from students;

D - select first_name, last_name from students;

Answer : C

Q 5 - You want to calculate the minimum percentage of marks obtained under each honours group students, where the minimum marks is more than the minimum marks in economics department. Under which clause should the subquery be?

A - WHERE clause

B - FROM clause

C - HAVING clause

D - None of the above.

Answer : C

Answer : D

Answer : C

Q 10 - Which of the following code would allocate the privileges of creating tables and view to the role named student_admin?

A - grant create table, create view to student_admin;

B - grant to student_admin create table, create view;

C - grant role student_admin create table, create view;

D - None of the above.

Answer : A