
- SQL Tutorial
- SQL - Home
- SQL - Overview
- SQL - RDBMS Concepts
- SQL - Databases
- SQL - Syntax
- SQL - Data Types
- SQL - Operators
- SQL - Expressions
- SQL - Create Database
- SQL - Drop Database
- SQL - Select Database
- SQL - Create Table
- SQL - Drop Table
- SQL - Insert Query
- SQL - Select Query
- SQL - Where Clause
- SQL - AND & OR Clauses
- SQL - Update Query
- SQL - Delete Query
- SQL - Like Clause
- SQL - Top Clause
- SQL - Order By
- SQL - Group By
- SQL - Distinct Keyword
- SQL - Sorting Results
- Advanced SQL
- SQL - Constraints
- SQL - Using Joins
- SQL - Unions Clause
- SQL - NULL Values
- SQL - Alias Syntax
- SQL - Indexes
- SQL - Alter Command
- SQL - Truncate Table
- SQL - Using Views
- SQL - Having Clause
- SQL - Transactions
- SQL - Wildcards
- SQL - Date Functions
- SQL - Temporary Tables
- SQL - Clone Tables
- SQL - Sub Queries
- SQL - Using Sequences
- SQL - Handling Duplicates
- SQL - Injection
- SQL Useful Resources
- SQL - Database Tuning
- SQL - Questions and Answers
- SQL - Quick Guide
- SQL - Useful Functions
- SQL - Useful Resources
- SQL - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.

SQL Mock Test I
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.
Answer : D
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;
Answer : C
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;
Answer : B
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;
Answer : A
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’;
Answer : 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_’;
Answer : A
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’;
Answer : C
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?
Answer : A
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?
Answer : B
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;
Answer : C
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?
Answer : A
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.
Answer : D
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.
Answer : C
Q 14 - Which of the following is not a character manipulation function?
Answer : D
Answer : A
Q 16 - What is returned by SUBSTR(‘TUTORIALS POINT’, 1, 9)?
Answer : C
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;
Answer : A
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?
Answer : B
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?
Answer : C
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.
Answer : C
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.
Answer : A
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | C |
3 | B |
4 | A |
5 | A |
6 | A |
7 | C |
8 | A |
9 | B |
10 | C |
11 | A |
12 | D |
13 | C |
14 | D |
15 | A |
16 | C |
17 | A |
18 | A |
19 | B |
20 | D |
21 | A |
22 | B |
23 | C |
24 | C |
25 | A |