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.
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 honours subject is English, or honours subject is Spanish and percentage of marks more than 80?
A - select first_name, last name from students where (honours_subject = “English” or honours_subject = “Spanish” ) and percentage_of_marks > 80;
B - select first_name, last name from students where honours_subject = “English” or honours_subject = “Spanish” and percentage_of_marks > 80;
C - select first_name, last name from students where honours_subject = “English” and honours_subject = “Spanish” or percentage_of_marks > 80;
D - select first_name, last name from students where (honours_subject = “English”) and honours_subject = “Spanish” and percentage_of_marks > 80;
Q 2 - What is returned by TRUNC(789.8389, 2)?
A - 789.84
B - 789.83
C - 78
D - 789.00
Q 3 - Consider the following schema −
HONOURS_SUBJECT(subject_code, subject_name, department_head);
LOCATIONS(subject_code, department_name, location_id, city);
Select the right query for retrieving records from the tables HONOURS_SUBJECT and LOCATIONS with the USING clause
A - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h join location l using(subject_code);
B - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h natural join location l using(subject_code);
C - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h,  location l using(subject_code);
D - None of the above.
Q 4 - Consider the following schema −
HONOURS_SUBJECT(subject_code, subject_name, department_head);
LOCATIONS(subject_code, department_name, location_id, city);
Select the right query for retrieving records from the tables HONOURS_SUBJECT and LOCATIONS with a full outer join
A - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h full outer join location l on(h.subject_code = l.subject_code);
B - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h full outer join location l on(subject_code);
C - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h  full outer join location l where (h.subject_code = l.subject_code);
D - None of the above.
Q 5 - A subquery can be placed in which of the SQL clauses?
A - The WHERE clause
B - The HAVING clause
C - The FROM clause
D - All of the above.
Q 6 - In which of the following cases a DML statement is executed?
A - When new rows are added to a table.
B - When a table is created.
C - When a transaction is committed.
D - None of the above.
Q 7 - Which of the following is true about the SQL transaction control statements?
A - They ensure data consistency.
B - They allow preview of data changes before making permanent changes in data.
C - They group logically related operations.
D - All are true.
Q 8 - Which of the following is not true about complex views?
A - They derive data from more than one table.
B - They contain no functions or grouping.
C - You cannot perform DML operations through a complex view.
D - All of the above are true.
Q 9 - Which of the following is not true about the Pseudocolumns that return the sequence values?
A - NEXTVAL returns the next available sequence value.
B - CURRVAL gets the current sequence value.
C - PREVVAL gets the previous sequence value.
D - None of the above.
Q 10 - Which of the following is not a developer’s privilege?
A - CREATE USER
B - CREATE TABLE
C - CREATE VIEW
D - CREATE SEQUENCE

    42 Lectures 
     5 hours 

 Anadi Sharma

    14 Lectures 
     2 hours 

 Anadi Sharma

    44 Lectures 
     4.5 hours 

 Anadi Sharma

    94 Lectures 
     7 hours 

 Abhishek And Pukhraj

    80 Lectures 
     6.5 hours 

 Oracle Master Training | 150,000+ Students Worldwide

    31 Lectures 
     6 hours 

 Eduonix Learning Solutions
 Print
 Add Notes
 Bookmark this page