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 names of all the students whose email ids are not provided?

A - select first_name, last name from students where email = 0;

B - select first_name, last name from students where email = ‘ ‘;

C - select first_name, last name from students where email is null;

D - select first_name, last name from students where email = ‘null’;

Answer : C

Q 2 - What is returned by SUBSTR(‘TUTORIALS POINT’, 1, 9)?

A - TUTORIAL

B - POINT

C - TUTORIALS

D - UTORIALS

Answer : C

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 - Consider the following schema −

LOCATIONS(subject_code, department_name, location_id, city);

Which code snippet will alter the table LOCATIONS and add a column named Address, with datatype VARCHAR2(100)?

A - ALTER TABLE locations ADD (address varchar2(100));

B - ALTER TABLE locations ADD COLUMN(address varchar2(100));

C - MODIFY TABLE locations ADD COLUMN (address varchar2(100));

D - None of the above.

Answer : A

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 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