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 - 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 names and percentage of marks of all students sorted by honours subject, and then order by percentage of marks?

A - select first_name, last name, honours_subject, percentage_of_marks from students order by honours_subject, percentage_of_marks;

B - select first_name, last name, honours_subject, percentage_of_marks order by percentage_of_marks desc from students;

C - select first_name, last name, percentage_of_marks from students order by percentage_of_marks desc;

D - select first_name, last name, percentage_of_marks from students order by percentage_of_marks, honours_subject;

Answer : A

Q 4 - Which of the following is not a group function?

A - SUM

B - NVL

C - COUNT

D - MIN

Answer : B

Answer : D

Q 10 - Which statement is used for allocating system privileges to the users?

A - CREATE

B - GRANT

C - REVOKE

D - ROLE

Answer : B

sql_questions_answers.htm
Advertisements