Grade: 12 Computer Science
DBMS
Worksheet - 1
1 Marks
1. Fill in the blank:
The SELECT statement when combined with ________ clause, returns records without
repetition.
(A) DISTINCT (B) DESCRIBE (C) UNIQUE (D) NULL
2. Which function is used to display the total number of records from a table in a
database?
(A) total() (B) total(*) (C) return(*) (D) count(*)
3. In order to open a connection with MySQL database from within Python using
mysql.connector package, __________ function is used.
(A) open (B) connect (C) database() (D) connectdb()
4. Fill in the blank: ________ command is used to change table structure in SQL.
(A) update (B) change (C) alter (D) modify
5. Which of the following commands will remove the entire database from MYSQL?
(A) DELETE DATABASE (B) DROP DATABASE
(C) REMOVE DATABASE (D) ALTER DATABASE
6. Fill in the blank:
_____ is a non-key attribute, whose values are derived from the primary key of some
other table.
(A) Primary Key (B) Candidate Key (C) Foreign Key (D) Alternate Key
7. Which of the following statements is True?
a) There can be only one Foreign Key in a table.
b) There can be only one Unique key is a table
c) There can be only one Primary Key in a Table
d) A table must have a Primary Key.
8. Which of the following is not part of a DDL query?
a) DROP b) MODIFY c) DISTINCT d) ADD
9. _______________ Keyword is used to obtain unique values in a SELECT query
a) UNIQUE b) DISTINCT c) SET d) HAVING
10. Which statement in MySql will display all the tables in a database?
a) SELECT * FROM TABLES; b) USE TABLES;
DBMS Worksheet – 1 - 1 Marks Page 1
c) DESCRIBE TABLES; d) SHOW TABLES;
11. Which of the following is a valid sql statement?
a) ALTER TABLE student SET rollnoINT(5);
b) UPDATE TABLE student MODIFY age = age + 10;
c) DROP FROM TABLE student;
d) DELETE FROM student;
12.Which of the following is not valid cursor function while performing database
operations using python. Here Mycur is the cursor object?
a) Mycur.fetch() b) Mycur.fetchone()
c) Mycur.fetchmany(n) d) Mycur.fetchall()
13. Fill in the blank: ______ command is used to remove a column from a table in SQL.
(a) update (b)remove (c) alter (d)drop
14. Which of the following commands will delete the rows of table?
(a) DELETE command (b) DROP Command
(c) REMOVE Command (d) ALTER Command
15. Fill in the blank: All tuples in the relation are assigned NULL as the value for the
new Attribute, with the ________ Command
(a) MODIFY (b) TAILOR (c)ELIMINATE (d) ALTER
16. Which of the following ignores the NULL values inSQL?
a) Count(*) b) count() c)total(*) d)None of these
17. Which of the following is not a legal method for fetching records from a database
from within a Python program?
(a) fetchone() b)fetchtwo() (c) fetchall() (d) fetchmany()
18. Which of the following statements is True?
a) There can be only one Foreign Key in a table.
b) There can be only one Unique key is a table
c) There can be only one Primary Key in a Table
d) A table must have a Primary Key.
19. Fill in the blank:
The SQL built-in function _______ calculates the average of values in numeric columns.
(a) MEAN() (b)AVG() (c) AVERAGE() (d) COUNT()
DBMS Worksheet – 1 - 1 Marks Page 2