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 whose first name starts with the character ‘A’?

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

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

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

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

Answer : A

Q 2 - Which of the following is not a character manipulation function?

A - concat

B - substr

C - instr

D - coalesce

Answer : D

Q 5 - You want to calculate the sum of commissions earned by the employees of an organisation. If an employee doesn’t receive any commission, it should be calculated as zero. Which will be the right query to achieve this?

A - select sum(nvl(commission, 0)) from employees;

B - select sum(commission, 0) from employees;

C - select nvl(sum(commission), 0) from employees;

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 is a system privilege?

A - Creating new users

B - Removing users

C - Removing tables

D - All of the above.

Answer : D

sql_questions_answers.htm
Advertisements