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.

Questions and Answers

SQL Mock Test IV

Answer : D

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’?

A - create view all_marks_english as select first_name, last_name, percentage_of_marks from students where honours_subject = ‘Eng01’;

B - create view all_marks_english as ( first_name, last_name, percentage_of_marks from students where honours_subject = ‘Eng01’);

C - select view all_marks_english as select first_name, last_name, percentage_of_marks from students where honours_subject = ‘Eng01’;

D - None of the above.

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;

C - retrieve from all_marks_english;

D - 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;

B - drop view all_marks_english;

C - delete all_marks_english;

D - drop all_marks_english;

Answer : B

Q 9 - Which of the following minimal code would create a sequence named loc_seq as a primary key of the LOCATIONS table?

A - create sequence loc_seq;

B - create sequence loc_seq on locations;

C - create loc_seq;

D - None of the above.

Answer : A

Q 10 - Which of the following statement is used to modify a sequence?

A - ALTER SEQUENCE

B - SELECT SEQUENCE

C - DROP SEQUENCE

D - None of the above.

Answer : A

Answer : C

Q 12 - Which of the following code will delete a sequence named loc_seq?

A - delete sequence loc-seq;

B - drop sequence loc_seq;

C - delete primary key loc_sec;

D - drop primary key loc_sec;

Answer : B

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?

A - drop index stu_marks_ind;

B - delete index stu_marks_ind;

C - drop stu_marks_ind;

D - drop index stu_marks_ind on students;

Answer : A

Answer : D

Q 18 - Which of the following is a system privilege?

A - Creating new users

B - Removing users

C - Removing tables

D - All of the above.

Answer : D

Q 19 - Which of the following is not a developer’s privilege?

A - CREATE USER

B - CREATE TABLE

C - CREATE VIEW

D - CREATE SEQUENCE

Answer : A

Q 20 - Which statement is used for allocating system privileges to the users?

A - CREATE

B - GRANT

C - REVOKE

D - ROLE

Answer : B

Q 22 - 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

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;

C - grant role student_admin create table, create view;

D - None of the above.

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;

C - grant william student_admin;

D - None of the above.

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

C - create user william password bill;

D - alter user william password 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
sql_questions_answers.htm
Advertisements