SQL Online Quiz


Advertisements


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 - What is returned by ROUND(789.8389, 2)?

A - 789.84

B - 789.83

C - 78

D - 789.00

Answer : A

Q 3 - Consider the following schema −

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

Which query will display the names and honours subjects of all students and if a student has not yet been given a honours subject yet, then it should display ‘No Honours Yet’.

A - select first_name, last name, nvl(honours_subject, ‘No Honours Yet’) from students;

B - select first_name, last name, nvl2(honours_subject, ‘No Honours Yet’) from students;

C - select first_name, last name, honours_subject, from students;

D - select first_name, last name, nullif(honours_subject, ‘No Honours Yet’) from students;

Answer : A

Answer : A

Q 6 - In which of the following cases a DML statement is not executed?

A - When existing rows are modified

B - When some rows are deleted

C - When a table is deleted

D - All of the above

Answer : C

Q 10 - Which of the following is not a developer’s privilege?

A - CREATE USER

B - CREATE TABLE

C - CREATE VIEW

D - CREATE SEQUENCE

Answer : A


sql_questions_answers.htm

Advertisements