Database Management System MCQs with Answers
Practice important Database Management System MCQs with answers and explanations.
Chapter: 26
Q401:
In SQL, which command is used to create a database?
A. CREATE DATABASE
B. CREATE DB
C. DB_CREATE
D. NEW DB
Correct Answer:
A
Chapter: 26
Q402:
Which of the following is a constraint that ensures a column cannot contain a NULL value?
A. CHECK
B. UNIQUE
C. NOT NULL
D. DEFAULT
Correct Answer:
C
Chapter: 26
Q403:
What is the primary use of the CREATE command in SQL?
A. To create a new database
B. To retrieve data from a table
C. To update data in a table
D. To delete a database
Correct Answer:
A
Chapter: 26
Q404:
The SQL command to define the schema of a relation is part of which SQL sublanguage?
A. DML
B. DCL
C. DDL
D. TCL
Correct Answer:
C
Chapter: 26
Q405:
Which constraint enforces that no duplicate values are allowed in a column?
A. PRIMARY KEY
B. NOT NULL
C. UNIQUE
D. FOREIGN KEY
Correct Answer:
C
Chapter: 26
Q406:
What does the "ON DELETE CASCADE" clause in SQL do?
A. Deletes all data from the table
B. Deletes the entire table when a row is deleted
C. Deletes related rows in another table
D. Prevents any delete operation
Correct Answer:
C
Chapter: 26
Q407:
Which of the following commands is non-transactional in SQL?
A. CREATE
B. INSERT
C. UPDATE
D. SELECT
Correct Answer:
A
Chapter: 26
Q408:
What does the following SQL command do? CREATE TABLE Student (stId char(5), stName char(25))
A. Creates a new table with two columns
B. Updates the "Student" table with new columns
C. Deletes the "Student" table
D. Renames the "Student" table
Correct Answer:
A
Chapter: 26
Q409:
What is the maximum allowed length of an identifier in SQL?
A. 128 characters
B. 256 characters
C. 512 characters
D. 1024 characters
Correct Answer:
B
Chapter: 26
Q410:
Which data type is used to store large textual data in SQL Server?
A. VARCHAR
B. TEXT
C. CHAR
D. TINYINT
Correct Answer:
B
Chapter: 26
Q411:
In the command CREATE TABLE, what does PRIMARY KEY do?
A. Ensures all values are unique
B. Allows null values
C. Forces the use of a default value
D. Limits the column to numeric values
Correct Answer:
A
Chapter: 26
Q412:
What is the difference between FLOAT and REAL data types in SQL Server?
A. No difference
B. REAL is faster than FLOAT
C. FLOAT allows more precision
D. REAL allows more precision
Correct Answer:
C
Chapter: 26
Q413:
Which SQL command is used to define the security and authorization information for a database?
A. DML
B. DCL
C. DDL
D. TCL
Correct Answer:
C
Chapter: 26
Q414:
Which of the following is a valid data type for storing phone numbers in SQL?
A. TEXT
B. CHAR(10)
C. TINYINT
D. INTEGER
Correct Answer:
B
Chapter: 26
Q415:
What is the output of this SQL statement? CREATE DATABASE School
A. It creates a new table named "School"
B. It creates a new database named "School"
C. It deletes the database "School"
D. It updates the database "School"
Correct Answer:
B
Chapter: 26
Q416:
What does the constraint CHECK do in SQL?
A. Ensures that all entries in a column are unique
B. Enforces rules on the values in a column
C. Prevents NULL values
D. Sets a default value
Correct Answer:
B
Chapter: 26
Q417:
Which data type in SQL Server can store whole numbers from -2^31 to 2^31-1?
A. BIGINT
B. SMALLINT
C. TINYINT
D. INT
Correct Answer:
D
Chapter: 26
Q418:
Fill in the blank: The command to create a new table in SQL starts with ______.
A. CREATE DATABASE
B. CREATE TABLE
C. INSERT INTO
D. CREATE INDEX
Correct Answer:
B
Chapter: 26
Q419:
Fill in the blank: The constraint that defines a column as the primary identifier of a table is called ______.
A. FOREIGN KEY
B. PRIMARY KEY
C. UNIQUE
D. CHECK
Correct Answer:
B
Chapter: 26
Q420:
Fill in the blank: A SQL command enclosed in curly braces {} means the part is ______.
A. Optional
B. Required
C. Choice
D. Default
Correct Answer:
B