SQL Mock Test

This section presents you various set of Mock Tests related to SQL Framework.  You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Q 1 - Which of the following is not true about SQL statements?
A - SQL statements are not case sensitive.
B - SQL statements can be written on one or more lines.
C - Keywords cannot be split across lines.
D - Clauses must be written on separate lines.
Q 2 - 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 the full name of a student, with a column heading "Name"
A - select first_name, last_name as “Name” from students;

B - select Name from students;
C - select first_name || last_name as “Name” from students;
D - select first_name, last_name from students;
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 of the following query would display the distinct honours subjects in the STUDENTS table?
A - select honours_subject from students;
B - select distinct honours_subject from students;
C - select all honours_subject from students;
D - select * from students;
Q 4 - 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 with honours_subject ‘Eng01’?
A - select student_code, first_name, last_name from students where honours_subject = ‘Eng01’;
B - select student_code, first_name, last_name from students where honours_subject is ‘Eng01’;
C - select student_code, first_name, last_name where honours_subject = ‘Eng01’
    from students;
D - select student_code, first_name, last_name from students;
Q 5 - 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’;
Q 6 - 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 where the second letter in the first name is ‘i’?
A - select first_name from students where first_name like ‘_i%’;
B - select first_name from students where first_name like ‘%i_’;
C - select first_name from students where first_name like ‘%i%’;
D - select first_name from students where first_name like ‘_i_’;
Q 7 - 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’;
Q 8 - 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 and percentage of marks more than 80, 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” or honours_subject = “Spanish” and percentage_of_marks > 80);
D - select first_name, last name from students where (honours_subject = “English”) or honours_subject = “Spanish” and percentage_of_marks > 80;
Q 9 - 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 10 - 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 students in descending order of percentage of marks?
A - select first_name, last name, percentage_of_marks  from students order by percentage_of_marks;
B - select first_name, last name, percentage_of_marks  order by percentage_of_marks  desc from students;
C - select first_name, last name, percentage_of_marks  from students order by percentage_of_marks desc;
D - select first_name, last name, percentage_of_marks  from students order by percentage_of_marks descending;
Q 11 - 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 and percentage of marks of all students sorted by honours subject, and then order by percentage of marks?
A - select first_name, last name, honours_subject, percentage_of_marks  from students order by honours_subject, percentage_of_marks;
B - select first_name, last name, honours_subject, percentage_of_marks  order by percentage_of_marks desc from students;
C - select first_name, last name, percentage_of_marks  from students order by percentage_of_marks desc;
D - select first_name, last name, percentage_of_marks  from students order by percentage_of_marks, honours_subject;
Q 12 - 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 correctly display the students’ first name, last name, honours subject and date of birth, born between July 1st 1996, and 30th June 1999. 
A - select first_name, last name, honours_subject, date_of_birth  from students where date_of_birth between ’30-JUN-1999’ and ’01-JUL-1996’;
B - select first_name, last name, honours_subject, date_of_birth  from students where date_of_birth in (’30-JUN-1999’ , ’01-JUL-1996’);
C - select first_name, last name, honours_subject, date_of_birth  from students where date_of_birth like ’30-JUN-1999’ and ’01-JUL-1996’;
D - select first_name, last name, honours_subject, date_of_birth  from students where date_of_birth between ’01-JUL-1996’ and ’30-JUN-1999’;
Q 13 - Which of the following is not true about single row functions?
A - They operate on single rows only and return one result per row.
B - They accept arguments that could be a column or any expression.
C - They cannot be nested.
D - They may modify the data type.
Q 14 - Which of the following is not a character manipulation function?
A - concat
B - substr
C - instr
D - coalesce 
Q 15 - What is returned by INSTR(‘TUTORIALS POINT’, ‘P’)?
A - 11
B - 10
C - POINT
D - TUTORIALS
Q 16 - What is returned by SUBSTR(‘TUTORIALS POINT’, 1, 9)?
A - TUTORIAL
B - POINT
C - TUTORIALS
D - UTORIALS 
Q 17 - What is returned by SUBSTR(‘TUTORIALS POINT’, -1, 1)?
A - T
B - NULL
C - 0
D - N
Q 18 - What is returned by ROUND(789.8389, 2)?
A - 789.84
B - 789.83
C - 78
D - 789.00
Q 19 - What is returned by TRUNC(789.8389, 2)?
A - 789.84
B - 789.83
C - 78
D - 789.00
Q 20 - What is returned by MOD(1000,30)?
A - 33
B - 30
C - 3
D - 10
Q 21 - 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;
Q 22 - You want to calculate the tax payable by the employees of an organization. If the employee gets a commission, then the tax would be calculated on commission plus salary, if the employee does not get any commission, then the tax would be calculated on salary only. Which function should you use for calculating tax?
A - NVL
B - NVL2
C - NULLIF
D - COALESCE
Q 23 - 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
Q 24 - Which of the following is not true about the COALESCE function?
A - It takes multiple alternate values.
B - It returns the first non-null expression in the parameter list.
C - It returns the first value in the parameter list if it is null.
D - None of the above.
Q 25 - Which of the following is true about Cartesian Products?
A - A Cartesian product is formed when a join condition is omitted.
B - A Cartesian product is formed when a join condition is valid.
C - Some rows in the first table are joined to all rows in the second table.
D - All rows in the first table are joined to some rows in the second table.

    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