Database Management System (DBMS) MCQs

Computer

Database Management System (DBMS) MCQs

Practice DBMS MCQs covering database, data, information, DBMS, RDBMS and SQL basics with answers and explanations.

278
Total Questions

Practice Questions

Page 7 of 14
Question #121
Which of the following is a characteristic of a DBMS?
A. Data redundancy control
B. All of the above
C. Security and access control
D. Data independence

Correct Answer: Option B


Explanation:
A DBMS provides features like data independence, reduced redundancy, security, and concurrent access.

This question belongs to: Computer Database Management System (DBMS)
Question #122
What is the difference between a primary key and a unique key?
A. Primary key cannot have NULL; unique key can have one NULL (in most DBMS)
B. Unique key is always a foreign key
C. Primary key is always integer; unique key can be any data type
D. There is no difference

Correct Answer: Option A


Explanation:
A primary key is a unique identifier that cannot be NULL, while a unique key allows NULL values (usually one) and can be used for alternate keys.

This question belongs to: Computer Database Management System (DBMS)
Question #123
Which of the following is a valid SQL statement to create a table?
A. CREATE TABLE table_name AS SELECT ...;
B. CREATE TABLE table_name (column1 datatype, column2 datatype);
C. Neither
D. Both A and B

Correct Answer: Option D


Explanation:
Both syntaxes are valid: direct CREATE TABLE with columns, and CREATE TABLE ... AS SELECT to create a table from a query result.

This question belongs to: Computer Database Management System (DBMS)
Question #124
What is the concept of data independence?
A. The ability to move data between tables
B. The ability to store data in different formats
C. The ability to change the database schema without affecting the application programs
D. The ability to access data from multiple sources

Correct Answer: Option C


Explanation:
Data independence is the capacity to change the database schema at one level without affecting the next higher level, minimizing impact on applications.

This question belongs to: Computer Database Management System (DBMS)
Question #125
Which of the following is a logical data model?
A. Hierarchical model
B. Both A and C
C. Relational model
D. Physical model

Correct Answer: Option B


Explanation:
Logical data models include relational, hierarchical, and network models. Physical models describe storage details.

This question belongs to: Computer Database Management System (DBMS)
Question #126
What is a synonym in database terms?
A. A foreign key
B. An alias for a table or view
C. A data type
D. A type of index

Correct Answer: Option B


Explanation:
A synonym is an alternative name for a database object, allowing simpler references.

This question belongs to: Computer Database Management System (DBMS)
Question #127
Which of the following is a purpose of a database management system?
A. All of the above
B. To manipulate data
C. To define and create databases
D. To control access to data

Correct Answer: Option A


Explanation:
A DBMS provides functionalities for defining, constructing, manipulating, and controlling access to databases.

This question belongs to: Computer Database Management System (DBMS)
Question #128
What is the meaning of the term 'redundancy' in databases?
A. Duplicate storage of the same data
B. Data in multiple tables
C. Inconsistent data
D. Lack of data

Correct Answer: Option A


Explanation:
Redundancy refers to the unnecessary duplication of data, which can lead to anomalies and wasted storage.

This question belongs to: Computer Database Management System (DBMS)
Question #129
Which of the following is a way to avoid redundancy in a database?
A. Denormalization
B. Normalization
C. Replication
D. Indexing

Correct Answer: Option B


Explanation:
Normalization reduces redundancy by organizing data into tables with minimal duplication.

This question belongs to: Computer Database Management System (DBMS)
Question #130
What is a stored procedure?
A. A trigger
B. A set of precompiled SQL statements that can be executed as a single unit
C. A view
D. An index

Correct Answer: Option B


Explanation:
A stored procedure is a named collection of SQL statements and logic stored in the database, which can be invoked by applications.

This question belongs to: Computer Database Management System (DBMS)
Question #131
What is the purpose of a trigger in a database?
A. To index a column
B. To create a backup
C. To join tables
D. To automatically execute a set of actions in response to certain events on a table

Correct Answer: Option D


Explanation:
A trigger is a stored program that automatically runs when a specified event (INSERT, UPDATE, DELETE) occurs on a table.

This question belongs to: Computer Database Management System (DBMS)
Question #132
Which of the following is a valid SQL data type for storing decimal numbers with exact precision?
A. DOUBLE
B. FLOAT
C. DECIMAL
D. REAL

Correct Answer: Option C


Explanation:
DECIMAL (or NUMERIC) is used for exact numeric values with fixed precision and scale. FLOAT, DOUBLE, REAL are approximate.

This question belongs to: Computer Database Management System (DBMS)
Question #133
What is the purpose of the SQL 'DEFAULT' constraint?
A. To enforce uniqueness
B. To provide a default value for a column when no value is supplied
C. To set a foreign key
D. To define a primary key

Correct Answer: Option B


Explanation:
DEFAULT assigns a default value to a column if an INSERT statement does not specify a value.

This question belongs to: Computer Database Management System (DBMS)
Question #134
Which of the following is a characteristic of a view?
A. It stores data physically
B. It is a virtual table based on a query
C. It cannot be updated
D. It is always faster than a table

Correct Answer: Option B


Explanation:
A view is a virtual table that does not store data physically; it presents data from one or more tables as if it were a table.

This question belongs to: Computer Database Management System (DBMS)
Question #135
In SQL, which statement is used to change a user's password?
A. MODIFY USER
B. CHANGE USER
C. ALTER USER
D. UPDATE USER

Correct Answer: Option C


Explanation:
ALTER USER is used in many DBMS to change user attributes, including password. The exact syntax varies by DBMS.

This question belongs to: Computer Database Management System (DBMS)
Question #136
What is the difference between an inner join and an outer join?
A. Inner join returns all rows; outer join returns matching only
B. Inner join returns only matching rows; outer join returns matching plus non-matching rows from one or both tables
C. Outer join is used for more than two tables
D. They are the same

Correct Answer: Option B


Explanation:
Inner join returns rows where the join condition matches. Outer join (left, right, full) returns unmatched rows as well with NULLs.

This question belongs to: Computer Database Management System (DBMS)
Question #137
Which of the following is a valid SQL function to convert a string to uppercase?
A. UPPER()
B. UCASE()
C. Both A and C
D. TO_UPPER()

Correct Answer: Option C


Explanation:
UPPER() is standard SQL; some DBMS also support UCASE().

This question belongs to: Computer Database Management System (DBMS)
Question #138
What is a database instance?
A. The state of a database at a particular moment in time
B. A query result
C. The schema definition
D. A backup

Correct Answer: Option A


Explanation:
A database instance refers to the data stored in the database at a specific time, as opposed to the schema (structure).

This question belongs to: Computer Database Management System (DBMS)
Question #139
Which of the following is a valid constraint in SQL?
A. All of the above
B. FOREIGN KEY
C. CHECK
D. PRIMARY KEY

Correct Answer: Option A


Explanation:
CHECK, PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL are all constraints in SQL.

This question belongs to: Computer Database Management System (DBMS)
Question #140
What is the purpose of the SQL 'CHECK' constraint?
A. To set a default value
B. To validate data based on a condition
C. To enforce uniqueness
D. To define relationships

Correct Answer: Option B


Explanation:
CHECK constraint ensures that values in a column meet a specified condition, such as age > 0.

This question belongs to: Computer Database Management System (DBMS)