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 with honours_subject ‘Eng01’?

A - select student_code, first_name, last_name from students where honours_subject = ‘Eng01’;

B - select student_code, first_name, last_name from students where honours_subject is ‘Eng01’;

C - select student_code, first_name, last_name where honours_subject = ‘Eng01’

    from students;

D - select student_code, first_name, last_name from students;

Answer : A

Q 2 - What is returned by INSTR(‘TUTORIALS POINT’, ‘P’)?

A - 11

B - 10

C - POINT

D - TUTORIALS

Answer : A

Q 3 - You want to calculate the tax payable by the employees of an organization. If the employee gets a commission, then the tax would be calculated on commission plus salary, if the employee does not get any commission, then the tax would be calculated on salary only. Which function should you use for calculating tax?

A - NVL

B - NVL2

C - NULLIF

D - COALESCE

Answer : B

Q 4 - Which of the following functions can be used on both numeric as well as non-numeric data?

A - COUNT

B - AVG

C - STDDEV

D - VARIANCE

Answer : A

Q 7 - Which statement allows conditional update, or insertion of data into a table simultaneously?

A - INSERT statement

B - MERGE statement

C - UPDATE statement

D - None of the above

Answer : B

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 statement is used to modify a sequence?

A - ALTER SEQUENCE

B - SELECT SEQUENCE

C - DROP SEQUENCE

D - None of the above.

Answer : A

Answer : D

sql_questions_answers.htm
Advertisements