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 - Which of the following is not a character manipulation function?

A - concat

B - substr

C - instr

D - coalesce

Answer : D

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 change the datatype of the column CITY to varchar2(30)?

A - ALTER TABLE locations MODIFY COLUMN (city varchar2(30));

B - MODIFY TABLE locations ADD (city varchar2(30));

C - ALTER TABLE locations MODIFY (city varchar2(30));

D - None of the above.

Answer : C

Q 10 - Which of the following code would create a role named student_admin?

A - CREATE student_admin;

B - GRANT student_admin;

C - CREATE ROLE student_admin;

D - ROLE student_admin;

Answer : C


sql_questions_answers.htm

Advertisements