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

A - 789.84

B - 789.83

C - 78

D - 789.00

Answer : A

Q 3 - For some particular assignment, you need to compare two values, if both are equal, the result would be null, and if the values are not equal then the first value should be returned. Which function should you use?

A - NVL

B - NVL2

C - NULLIF

D - COALESCE

Answer : C

Q 5 - You want to calculate the minimum percentage of marks obtained under each honours group students, where the minimum marks is more than the minimum marks in economics department. Under which clause should the subquery be?

A - WHERE clause

B - FROM clause

C - HAVING clause

D - None of the above.

Answer : C

Q 7 - Consider the following schema −

LOCATIONS(subject_code, department_name, location_id, city);

Which code snippet will alter the table LOCATIONS and delete the column named CITY?

A - MODIFY TABLE locations DROP (city varchar2(30));

B - ALTER TABLE locations DROP COLUMN city;

C - ALTER TABLE locations DROP (city);

D - None of the above.

Answer : B

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