← Back to Class 12 CS Main Page
Prepare for your Class 12 Computer Science exam with these Database Management MCQs based on important concepts and exam-oriented topics. These questions help students revise databases, database management systems, tables, fields, records, keys, SQL commands, queries, and other important concepts. Regular practice of these MCQs can improve understanding, accuracy, and confidence for the board examination.
Database Management Class 12 Computer Science Sample Paper MCQ
Q. In SQL, which type of Join(s) may contain duplicate column(s)?
Answer: Equi-Join or Cartesian Join
Q. Consider the given SQL Query: SELECT department, COUNT() FROM employees HAVING COUNT() > 5 GROUP BY department;
Answer: SELECT department, COUNT() FROM employees GROUP BY department HAVING COUNT() > 5;
Q. Which SQL command can change the cardinality of an existing relation?
a) Insert
b) Delete
c) Both a) & b)
d) Drop
Answer: c) Both a) & b)
Q. In SQL, a relation consists of 5 columns and 6 rows. If 2 columns and 3 rows are added to the existing relation, what will be the updated degree of a relation?
a) Degree: 7
b) Degree: 8
c) Degree: 9
d) Degree: 6
Answer: a) Degree: 7
Q. Which SQL command is used to remove a column from a table in MySQL?
a) UPDATE
b) ALTER
c) DROP
d) DELETE
Answer: b) ALTER
Q. Assertion (A): A primary key must be unique and cannot have NULL values.
Reasoning (R): The primary key uniquely identifies each row in the table.
a) Both A and R are True and R is the correct explanation for A.
b) Both A and R are True and R is not the correct explanation for A.
c) A is True but R is False.
d) A is False but R is True.
Answer: a) Both A and R are True and R is the correct explanation for A.
Q. If a table which has one Primary key and two alternate keys. How many Candidate keys will this table have?
(A) 1
(B) 2
(C) 3
(D) 4
Answer: (C) 3
Q. Which SQL command can change the degree of an existing relation?
Answer: Alter (or Alter Table)
Q. What will be the output of the query?
SELECT * FROM products WHERE product_name LIKE ‘App%’;
(A) Details of all products whose names start with ‘App’
(B) Details of all products whose names end with ‘App’
(C) Names of all products whose names start with ‘App’
(D) Names of all products whose names end with ‘App’
Answer: (A) Details of all products whose names start with ‘App’
Q. In which datatype the value stored is padded with spaces to fit the specified length.
(A) DATE
(B) VARCHAR
(C) FLOAT
(D) CHAR
Answer: (D) CHAR
Q. Which aggregate function can be used to find the cardinality of a table?
(A) sum()
(B) count()
(C) avg()
(D) max()
Answer: (B) count()
Q. Assertion (A): A SELECT command in SQL can have both WHERE and HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check conditions, therefore, these can be used interchangeably.
(A)Both A and R are true and R is the correct explanation for A
(B)Both A and R are true and R is not the correct explanation for A
(C)A is True but R is False
(D)A is False but R is True
Answer: (C)A is True but R is False
Q. In a table in MYSQL database, an attribute A of datatype varchar(20) has the value “Keshav”. The attribute B of datatype char(20) has value “Meenakshi”. How many characters are occupied by attribute A and attribute B?
a. 20,6
b. 6,20
c. 9,6
d. 6,9
Answer: b. 6,20
Q. In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and another table, Beta has degree 3 and cardinality 5, what will be the degree and cardinality of the Cartesian product of Alpha and Beta?
a. 5,3
b. 8,15
c. 3,5
d. 15,8
Answer: b. 8,15
Q. Which of the following statements is FALSE about keys in a relational database?
a. Any candidate key is eligible to become a primary key.
b. A primary key uniquely identifies the tuples in a relation.
c. A candidate key that is not a primary key is a foreign key.
d. A foreign key is an attribute whose value is derived from the primary key of another relation.
Answer: c. A candidate key that is not a primary key is a foreign key.
Q. Assertion(A): List is an immutable data type
Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory.
(a) Both A and R are true and R is the correct explanation for A
(b)Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False
(d)A is false but R is True
Answer: (d)A is false but R is True
Q. Fill in the blank: ______ command is used to remove primary key from the table in SQL.
(a) update
(b)remove
(c) alter
(d)drop
Answer: (c) alter
Q. Which of the following commands will delete the table from MYSQL database?
(a) DELETE TABLE
(b) DROP TABLE
(c) REMOVE TABLE
(d) ALTER TABLE
Answer: (b) DROP TABLE
Q. Which function is used to display the total number of records from table in a database?
(a) sum()
(b) total()
(c) count()
(d) return()
Answer: (c) count(*)
Q. Fill in the blank: The SELECT statement when combined with __________ clause, returns records without repetition.
(a) DESCRIBE
(b) UNIQUE
(c) DISTINCT
(d) NULL
Answer: (c) DISTINCT
Q. 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) Foreign Key
(c) Candidate Key
(d) Alternate Key
Answer: (b) Foreign Key
Q. To establish a connection between Python and SQL database, connect() is used. Which of the following arguments may not necessarily be given while calling connect() ?
(a) host
(b) database
(c) user
(d) password
Answer: (b) database
Disclaimer: We have taken an effort to provide you with the accurate handout of “Computer Science Class 12“. If you feel that there is any error or mistake, please contact me at anuraganand2017@gmail.com. The above CBSE study material present on our websites is for education purpose, not our copyrights. All the above content and Screenshot are taken from Computer Science Class 12 CBSE Textbook, Sample Paper, Old Sample Paper, Board Paper and Support Material which is present in CBSEACADEMIC website, This Textbook and Support Material are legally copyright by Central Board of Secondary Education. We are only providing a medium and helping the students to improve the performances in the examination.
Images and content shown above are the property of individual organizations and are used here for reference purposes only.
For more information, refer to the official CBSE textbooks available at cbseacademic.nic.in