Relational Database Management Systems (RDBMS) MCQs

What does RDBMS stand for?

A) Relational Database Management System
B) Real-time Database Management System
C) Reliable Database Management System
D) Relational Data Manipulation System
Answer: A
Which of the following is an example of an RDBMS?

A) MySQL
B) MongoDB
C) Redis
D) Cassandra
Answer: A
What is the full form of SQL?

A) Structured Query Language
B) Simple Query Language
C) Structured Question Language
D) Simple Question Language
Answer: A
Which SQL statement is used to retrieve data from a database?

A) GET
B) OPEN
C) SELECT
D) RETRIEVE
Answer: C
Which of the following is not a type of SQL statement?

A) DML (Data Manipulation Language)
B) DDL (Data Definition Language)
C) DCL (Data Control Language)
D) DML (Data Maintenance Language)
Answer: D
In SQL, which command is used to remove a record from a table?

A) REMOVE
B) DELETE
C) ERASE
D) DROP
Answer: B
Which SQL clause is used to filter records?

A) WHERE
B) FILTER
C) SORT
D) ORDER BY
Answer: A
What is a primary key in a database table?

A) A key that uniquely identifies each row in a table
B) A key that refers to the primary user
C) A key used to encrypt the database
D) A key used to define table relationships
Answer: A
Which SQL keyword is used to sort the result-set?

A) SORT BY
B) ORDER BY
C) ARRANGE BY
D) GROUP BY
Answer: B
What does the acronym ACID stand for in the context of databases?

A) Atomicity, Consistency, Isolation, Durability
B) Accuracy, Consistency, Isolation, Durability
C) Atomicity, Correctness, Isolation, Durability
D) Atomicity, Consistency, Integrity, Durability
Answer: A
Which function is used to count the number of rows in a SQL table?

A) COUNT(*)
B) SUM(*)
C) TOTAL(*)
D) CALC(*)
Answer: A
What is the purpose of the JOIN operation in SQL?

A) To retrieve data from multiple tables
B) To combine columns from multiple tables
C) To insert data into multiple tables
D) To update multiple tables simultaneously
Answer: A
Which of the following is a type of JOIN in SQL?

A) INNER JOIN
B) LEFT JOIN
C) RIGHT JOIN
D) All of the above
Answer: D
In an ER diagram, what does the rectangle represent?

A) Entity
B) Relationship
C) Attribute
D) Primary Key
Answer: A
What does the foreign key in a database do?

A) Uniquely identifies a row in another table
B) Uniquely identifies a row within its own table
C) Stores the primary key of another table
D) Links two tables together
Answer: D
Which SQL statement is used to add new rows to a table?

A) ADD
B) INSERT
C) UPDATE
D) ALTER
Answer: B
Which SQL statement is used to modify the structure of a database table?

A) UPDATE
B) MODIFY
C) ALTER
D) CHANGE
Answer: C
Which command is used to remove a table from a database?

A) DELETE
B) REMOVE
C) DROP
D) CLEAR
Answer: C
What is a database index?

A) A structure to speed up retrieval of records
B) A structure to store additional data
C) A type of backup for a database
D) A list of table names
Answer: A
Which keyword is used to eliminate duplicate rows in a SQL SELECT statement?

A) DISTINCT
B) UNIQUE
C) DIFFERENT
D) NONE
Answer: A
Which of the following is not a type of database normalization?

A) First Normal Form (1NF)
B) Second Normal Form (2NF)
C) Third Normal Form (3NF)
D) Fourth Normal Form (4NF)
Answer: D
What is a composite key?

A) A primary key made up of multiple columns
B) A key that is always unique
C) A key used for encryption
D) A foreign key that refers to multiple tables
Answer: A
What is the purpose of the SQL GROUP BY clause?

A) To group rows that have the same values in specified columns
B) To sort data in ascending order
C) To join multiple tables
D) To filter data based on a condition
Answer: A
Which command is used to create a new table in SQL?

A) CREATE TABLE
B) NEW TABLE
C) MAKE TABLE
D) ADD TABLE
Answer: A
What is a view in SQL?

A) A virtual table based on the result-set of an SQL statement
B) A table that stores data temporarily
C) A table that holds backups
D) A way to organize indexes
Answer: A
Which SQL keyword is used to fetch only unique records?

A) DISTINCT
B) UNIQUE
C) DIFFERENT
D) ONLY
Answer: A
In a relational database, what does a row represent?

A) An entity instance
B) An attribute
C) A relationship
D) A schema
Answer: A
Which function is used to calculate the average value in SQL?

A) AVERAGE()
B) AVG()
C) MEAN()
D) SUM()
Answer: B
What does the term “tuple” refer to in a relational database?

A) A row
B) A column
C) A table
D) A database
Answer: A
Which clause is used with the SQL SELECT statement to specify the conditions for grouping rows?

A) WHERE
B) HAVING
C) GROUP BY
D) ORDER BY
Answer: B
What is a candidate key?

A) A key that can be used as a primary key
B) A key that is unique across the database
C) A key that is not null
D) A key that is always indexed
Answer: A
Which SQL function is used to find the highest value in a column?

A) MAX()
B) HIGHEST()
C) TOP()
D) PEAK()
Answer: A
Which SQL keyword is used to create an index on a table?

A) CREATE INDEX
B) MAKE INDEX
C) NEW INDEX
D) ADD INDEX
Answer: A
What is the purpose of the SQL IN operator?

A) To specify multiple values in a WHERE clause
B) To check if a value exists in a table
C) To create an index
D) To combine multiple tables
Answer: A
What is referential integrity in a database?

A) Ensuring that foreign key values always have corresponding primary key values
B) Ensuring that data is encrypted
C) Ensuring that all tables are indexed
D) Ensuring that data is always normalized
Answer: A
Which SQL statement is used to update existing records in a table?

A) CHANGE
B) MODIFY
C) UPDATE
D) ALTER
Answer: C
What is the default sorting order in SQL?

A) Ascending
B) Descending
C) Random
D) Custom
Answer: A
Which SQL operator is used to combine the result of two queries?

A) UNION
B) JOIN
C) COMBINE
D) MERGE
Answer: A
Which of the following is a valid SQL constraint?

A) PRIMARY KEY
B) UNIQUE
C) FOREIGN KEY
D) All of the above
Answer: D
In SQL, what does the term “alias” refer to?

A) An alternate name for a table or column
B) A new database user
C) A function to combine columns
D) A way to encrypt data
Answer: A
Which clause is used in SQL to specify the condition for filtering groups of rows?

A) HAVING
B) WHERE
C) GROUP BY
D) ORDER BY
Answer: A
What is the result of the SQL statement SELECT COUNT(*) FROM table_name?

A) The total number of rows in the table
B) The total number of columns in the table
C) The total number of primary keys in the table
D) The total number of foreign keys in the table
Answer: A
Which SQL clause is used to limit the number of rows returned by a query?

A) LIMIT
B) TOP
C) ROWNUM
D) All of the above
Answer: D
What does the SQL keyword “NULL” represent?

A) A missing or undefined value
B) A zero value
C) An empty string
D) A negative value
Answer: A
Which SQL function is used to get the current date and time?

A) GETDATE()
B) NOW()
C) CURRENT_DATE()
D) DATE()
Answer: B
What does the SQL statement SELECT * FROM table_name do?

A) Retrieves all columns from the table
B) Retrieves all rows from the table
C) Retrieves all columns and rows from the table
D) Deletes all rows from the table
Answer: C
Which SQL keyword is used to create a unique constraint on a column?

A) UNIQUE
B) DISTINCT
C) PRIMARY
D) FOREIGN
Answer: A
What is the result of the SQL statement SELECT AVG(salary) FROM employees?

A) The average salary of all employees
B) The total salary of all employees
C) The highest salary of all employees
D) The lowest salary of all employees
Answer: A
Which SQL clause is used to rename a column in the result set?

A) AS
B) RENAME
C) CHANGE
D) ALTER
Answer: A
Which of the following is a valid SQL aggregate function?

A) COUNT()
B) SUM()
C) AVG()
D) All of the above
Answer: D