- SQL Tutorial
- SQL - Home
- SQL - Overview
- SQL - RDBMS Concepts
- SQL - Databases
- SQL - Syntax
- SQL - Data Types
- SQL - Operators
- SQL - Expressions
- SQL Database
- SQL - Create Database
- SQL - Drop Database
- SQL - Select Database
- SQL - Rename Database
- SQL - Show Databases
- SQL - Backup Database
- SQL Table
- SQL - Create Table
- SQL - Show Tables
- SQL - Rename Table
- SQL - Truncate Table
- SQL - Clone Tables
- SQL - Temporary Tables
- SQL - Alter Tables
- SQL - Drop Table
- SQL - Delete Table
- SQL - Constraints
- SQL Queries
- SQL - Insert Query
- SQL - Select Query
- SQL - Select Into
- SQL - Insert Into Select
- SQL - Update Query
- SQL - Delete Query
- SQL - Sorting Results
- SQL Views
- SQL - Create Views
- SQL - Update Views
- SQL - Drop Views
- SQL - Rename Views
- SQL Operators and Clauses
- SQL - Where Clause
- SQL - Top Clause
- SQL - Distinct Clause
- SQL - Order By Clause
- SQL - Group By Clause
- SQL - Having Clause
- SQL - AND & OR
- SQL - BOOLEAN (BIT) Operator
- SQL - LIKE Operator
- SQL - IN Operator
- SQL - ANY, ALL Operators
- SQL - EXISTS Operator
- SQL - CASE
- SQL - NOT Operator
- SQL - NOT EQUAL
- SQL - IS NULL
- SQL - IS NOT NULL
- SQL - NOT NULL
- SQL - BETWEEN Operator
- SQL - UNION Operator
- SQL - UNION vs UNION ALL
- SQL - INTERSECT Operator
- SQL - EXCEPT Operator
- SQL - Aliases
- SQL Joins
- SQL - Using Joins
- SQL - Inner Join
- SQL - Left Join
- SQL - Right Join
- SQL - Cross Join
- SQL - Full Join
- SQL - Self Join
- SQL - Delete Join
- SQL - Update Join
- SQL - Left Join vs Right Join
- SQL - Union vs Join
- SQL Keys
- SQL - Unique Key
- SQL - Primary Key
- SQL - Foreign Key
- SQL - Composite Key
- SQL - Alternate Key
- SQL Indexes
- SQL - Indexes
- SQL - Create Index
- SQL - Drop Index
- SQL - Show Indexes
- SQL - Unique Index
- SQL - Clustered Index
- SQL - Non-Clustered Index
- Advanced SQL
- SQL - Wildcards
- SQL - Comments
- SQL - Injection
- SQL - Hosting
- SQL - Min & Max
- SQL - Null Functions
- SQL - Check Constraint
- SQL - Default Constraint
- SQL - Stored Procedures
- SQL - NULL Values
- SQL - Transactions
- SQL - Sub Queries
- SQL - Handling Duplicates
- SQL - Using Sequences
- SQL - Auto Increment
- SQL - Date & Time
- SQL - Cursors
- SQL - Common Table Expression
- SQL - Group By vs Order By
- SQL - IN vs EXISTS
- SQL - Database Tuning
- SQL Function Reference
- SQL - Date Functions
- SQL - String Functions
- SQL - Aggregate Functions
- SQL - Numeric Functions
- SQL - Text & Image Functions
- SQL - Statistical Functions
- SQL - Logical Functions
- SQL - Cursor Functions
- SQL - JSON Functions
- SQL - Conversion Functions
- SQL - Datatype Functions
- SQL Useful Resources
- SQL - Questions and Answers
- SQL - Quick Guide
- SQL - Useful Functions
- SQL - Useful Resources
- SQL - Discussion
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 IV
Q 1 - Which of the following is not true about a FOREIGN KEY constraint?
A - It is a referential integrity constraint.
C - A foreign key value cannot be null.
D - A foreign key value must match an existing value in the parent table.
Answer : C
Q 2 - Which of the following is not true about use of a database view?
Answer : D
Q 3 - Which of the following is not true about simple views?
A - They derive data from one table.
B - They contain no functions or grouping.
C - You cannot perform DML operations through a simple view.
Answer : C
Q 4 - 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.
Answer : B
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 code will create a simple view named all_marks_english that contains the names and percentage of marks of the students in the honours_subject âEng01â?
Answer : A
Q 6 - Which of the following code will retrieve data from the view all_marks_english, created in the previous question?
A - select view all_marks_english;
B - select from all_marks_english;
Answer : D
Q 7 - Which of the following code will delete a view named all_marks_english?
A - delete view all_marks_english;
Answer : B
Q 8 - Which of the following is not true about a sequence?
A - They are used for generating sequential numbers.
B - Sequences are created by the CREATE SEQUENCE statement.
Answer : C
Q 9 - Which of the following minimal code would create a sequence named loc_seq as a primary key of the LOCATIONS table?
Answer : A
Q 10 - Which of the following statement is used to modify a sequence?
Answer : A
Q 11 - 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.
Answer : C
Q 12 - Which of the following code will delete a sequence named loc_seq?
Answer : B
Q 13 - Which of the following is true about database indexes?
A - You can create an index on one or more columns.
B - Indexes always slow down the speed of query process.
Answer : A
Q 14 - Which of the following code will create an index named stu_marks_ind on the columns student_code and percentage_of_marks of the STUDENTS table?
A - Itâs not possible to create an index on two columns.
B - create index stu_marks_ind from students(student_code, percentage_of_marks);
C - create index stu_marks_ind on students(student_code, percentage_of_marks);
D - create index stu_marks_ind (student_code, percentage_of_marks) on students;
Answer : C
Q 15 - Which of the following code will create an index named
stu_marks_ind on the columns student_code and percentage_of_marks of the STUDENTS table.
Now which will delete the index stu_marks_ind.
Which of the following code will delete an index stu_marks_ind on the columns student_code and percentage_of_marks of the STUDENTS table?
Answer : A
Q 16 - Which of the following is not true about database synonyms?
A - Synonyms are used for shortening lengthy object names.
B - A synonym is just an alternative name.
C - Synonyms can be created for tables, views, sequences, procedures and other database objects.
Answer : D
Q 17 - A database administrator can
Answer : D
Q 18 - Which of the following is a system privilege?
Answer : D
Q 19 - Which of the following is not a developerâs privilege?
Answer : A
Q 20 - Which statement is used for allocating system privileges to the users?
Answer : B
Q 21 - Which of the following is true about a role?
A - A role is a named group of related privileges.
B - It can be it can be created and assigned to a user.
Answer : D
Q 22 - Which of the following code would create a role named student_admin?
Answer : C
Q 23 - Which of the following code would allocate the privileges of creating tables and view to the role named student_admin?
A - grant create table, create view to student_admin;
B - grant to student_admin create table, create view;
Answer : A
Q 24 - Which of the following code would grant the role student_admin to a user named william?
A - grant student_admin to william;
B - grant to william student_admin;
Answer : A
Q 25 - Which of the following statements allows William to change his database user account password to bill?
A - create user william identified by bill;
B - alter user william identified by bill
Answer : B
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | D |
3 | C |
4 | B |
5 | A |
6 | D |
7 | B |
8 | C |
9 | A |
10 | A |
11 | C |
12 | B |
13 | A |
14 | C |
15 | A |
16 | D |
17 | D |
18 | D |
19 | A |
20 | B |
21 | D |
22 | C |
23 | A |
24 | A |
25 | B |