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. All of the above
B. Security and access control
C. Data redundancy control
D. Data independence

Correct Answer: Option A


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. There is no difference
B. Unique key is always a foreign key
C. Primary key is always integer; unique key can be any data type
D. Primary key cannot have NULL; unique key can have one NULL (in most DBMS)

Correct Answer: Option D


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. Both A and B
C. Neither
D. CREATE TABLE table_name (column1 datatype, column2 datatype);

Correct Answer: Option B


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 change the database schema without affecting the application programs
B. The ability to store data in different formats
C. The ability to access data from multiple sources
D. The ability to move data between tables

Correct Answer: Option A


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. Relational model
C. Both A and C
D. Physical model

Correct Answer: Option C


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 data type
B. A type of index
C. A foreign key
D. An alias for a table or view

Correct Answer: Option D


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 control access to data
C. To define and create databases
D. To manipulate 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. Data in multiple tables
B. Duplicate storage of the same data
C. Lack of data
D. Inconsistent data

Correct Answer: Option B


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. Normalization
B. Denormalization
C. Indexing
D. Replication

Correct Answer: Option A


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. An index
C. A view
D. A set of precompiled SQL statements that can be executed as a single unit

Correct Answer: Option D


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 create a backup
B. To join tables
C. To index a column
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. FLOAT
B. DOUBLE
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 is always faster than a table
B. It is a virtual table based on a query
C. It cannot be updated
D. It stores data physically

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. UPDATE USER
C. CHANGE USER
D. ALTER USER

Correct Answer: Option D


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 only matching rows; outer join returns matching plus non-matching rows from one or both tables
B. Inner join returns all rows; outer join returns matching only
C. Outer join is used for more than two tables
D. They are the same

Correct Answer: Option A


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. UCASE()
B. UPPER()
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. A query result
B. A backup
C. The state of a database at a particular moment in time
D. The schema definition

Correct Answer: Option C


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. CHECK
B. All of the above
C. FOREIGN KEY
D. PRIMARY KEY

Correct Answer: Option B


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 enforce uniqueness
C. To define relationships
D. To validate data based on a condition

Correct Answer: Option D


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)