1. A database is:
A) A collection of files
B) A collection of interrelated data
C) A programming language
D) An operating system
Answer: B) A collection of interrelated data
Explanation: A database is an organized collection of related data that can be easily accessed, managed, and updated.
2. Which of the following is NOT a DBMS?
A) Oracle
B) MySQL
C) MS Excel
D) PostgreSQL
Answer: C) MS Excel
Explanation: Excel is a spreadsheet software, not a database management system (DBMS).
3. DBMS stands for:
A) Database Management System
B) Data Backup Management System
C) Digital Base Management Software
D) Data Binary Management System
Answer: A) Database Management System
Explanation: DBMS manages and organizes data in databases.
4. Which of the following is an example of RDBMS?
A) MySQL
B) MongoDB
C) Redis
D) Neo4j
Answer: A) MySQL
Explanation: MySQL is a relational DBMS where data is stored in tables with rows and columns.
5. The smallest unit of data in a database is:
A) File
B) Record
C) Field
D) Bit
Answer: C) Field
Explanation: A field represents a single piece of data (e.g., name, age).
6. A table in a relational database is also known as:
A) File
B) Relation
C) Record
D) Schema
Answer: B) Relation
Explanation: In relational databases, tables are also called relations.
7. Which key uniquely identifies each record in a table?
A) Foreign key
B) Primary key
C) Candidate key
D) Alternate key
Answer: B) Primary key
Explanation: A primary key is a unique identifier for each row in a table.
8. Which of the following is a type of DBMS?
A) Hierarchical
B) Network
C) Relational
D) All of the above
Answer: D) All of the above
Explanation: DBMS can be hierarchical, network, relational, or object-oriented.
9. SQL stands for:
A) Structured Query Language
B) Standard Question Language
C) Simple Query Language
D) Sequential Query Language
Answer: A) Structured Query Language
Explanation: SQL is the standard language to interact with relational databases.
10. Which SQL command is used to retrieve data from a database?
A) SELECT
B) UPDATE
C) INSERT
D) DELETE
Answer: A) SELECT
Explanation: SELECT is used to retrieve data from one or more tables.
11. Which SQL command is used to remove all rows from a table but keep the structure?
A) DROP
B) TRUNCATE
C) DELETE
D) CLEAR
Answer: B) TRUNCATE
Explanation: TRUNCATE removes all rows quickly but retains the table structure.
12. In SQL, which clause is used to filter records?
A) WHERE
B) GROUP BY
C) ORDER BY
D) HAVING
Answer: A) WHERE
Explanation: WHERE filters records based on conditions.
13. Which normal form removes partial dependency?
A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: B) 2NF
Explanation: 2NF eliminates partial dependency in relational schema.
14. In relational database terminology, a row is called:
A) Field
B) Record
C) Attribute
D) Schema
Answer: B) Record
Explanation: Each row in a table is called a record (or tuple).
15. Which type of key is used to link two tables?
A) Primary key
B) Foreign key
C) Candidate key
D) Alternate key
Answer: B) Foreign key
Explanation: Foreign keys maintain referential integrity between related tables.
16. Which of these is NOT a DML command?
A) INSERT
B) DELETE
C) UPDATE
D) CREATE
Answer: D) CREATE
Explanation: CREATE is a DDL command, while DML commands modify data.
17. Which of the following is a NoSQL database?
A) Oracle
B) MySQL
C) MongoDB
D) SQL Server
Answer: C) MongoDB
Explanation: MongoDB is a document-oriented NoSQL database.
18. ACID properties in DBMS ensure:
A) Database security
B) Database transactions reliability
C) Faster queries
D) Backup creation
Answer: B) Database transactions reliability
Explanation: ACID (Atomicity, Consistency, Isolation, Durability) ensures reliable transactions.
19. The command to remove a database in SQL is:
A) DROP DATABASE
B) DELETE DATABASE
C) REMOVE DATABASE
D) ERASE DATABASE
Answer: A) DROP DATABASE
Explanation: DROP DATABASE permanently removes a database.
20. The command UPDATE Students SET Marks = 90 WHERE ID = 1; does what?
A) Deletes record
B) Updates marks for student with ID 1
C) Creates a new record
D) Selects record
Answer: B) Updates marks for student with ID 1
Explanation: UPDATE modifies existing data in a table.
21. Which of the following prevents unauthorized access to data?
A) Backup
B) Encryption
C) Normalization
D) Indexing
Answer: B) Encryption
Explanation: Encryption secures data from unauthorized access.
22. Which SQL keyword is used to arrange results in ascending or descending order?
A) SORT
B) ORDER BY
C) GROUP BY
D) ALIGN BY
Answer: B) ORDER BY
Explanation: ORDER BY sorts query results based on columns.
23. Which command is used to remove a table completely?
A) DROP TABLE
B) TRUNCATE TABLE
C) DELETE TABLE
D) ERASE TABLE
Answer: A) DROP TABLE
Explanation: DROP TABLE deletes the table and its structure.
24. Which SQL clause is used to group rows based on common values?
A) GROUP BY
B) ORDER BY
C) WHERE
D) JOIN
Answer: A) GROUP BY
Explanation: GROUP BY groups records by common field values for aggregation.
25. Which database model represents data in tree-like structure?
A) Network Model
B) Hierarchical Model
C) Relational Model
D) Object-Oriented Model
Answer: B) Hierarchical Model
Explanation: Hierarchical model organizes data in tree-like parent-child relationships.
26. Which of the following is a DDL command?
A) INSERT
B) UPDATE
C) CREATE
D) DELETE
Answer: C) CREATE
Explanation: DDL (Data Definition Language) commands define structures; CREATE is used to create tables, views, etc.
27. Which of the following is NOT a property of a transaction in DBMS?
A) Atomicity
B) Consistency
C) Isolation
D) Flexibility
Answer: D) Flexibility
Explanation: The four transaction properties are ACID – Atomicity, Consistency, Isolation, Durability.
28. Which normal form eliminates transitive dependency?
A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: C) 3NF
Explanation: 3NF ensures no transitive dependency between non-key attributes.
29. Which SQL command is used to add a new record into a table?
A) ADD
B) INSERT
C) CREATE
D) APPEND
Answer: B) INSERT
Explanation: INSERT adds new rows of data into a table.
30. Which command is used to remove specific rows from a table?
A) DROP
B) TRUNCATE
C) DELETE
D) REMOVE
Answer: C) DELETE
Explanation: DELETE removes specified rows, but table structure remains.
31. Which of the following is NOT a constraint in SQL?
A) PRIMARY KEY
B) FOREIGN KEY
C) UNIQUE
D) UPDATE
Answer: D) UPDATE
Explanation: UPDATE is a DML command, not a constraint.
32. Which SQL keyword is used to combine rows from two or more tables based on related columns?
A) GROUP
B) JOIN
C) UNION
D) LINK
Answer: B) JOIN
Explanation: JOINs are used to retrieve data from multiple related tables.
33. Which SQL command is used to rename a table?
A) RENAME
B) ALTER
C) UPDATE
D) CHANGE
Answer: A) RENAME
Explanation: RENAME TABLE old_name TO new_name changes the name of a table.
34. Which type of join returns all rows when there is a match in either table?
A) INNER JOIN
B) LEFT JOIN
C) RIGHT JOIN
D) FULL OUTER JOIN
Answer: D) FULL OUTER JOIN
Explanation: FULL OUTER JOIN returns all records when there is a match in either table.
35. Which clause is used with aggregate functions like SUM, AVG, COUNT?
A) ORDER BY
B) WHERE
C) GROUP BY
D) HAVING
Answer: C) GROUP BY
Explanation: GROUP BY groups records for aggregate operations.
36. Which clause is used to filter aggregated data?
A) WHERE
B) HAVING
C) ORDER BY
D) LIMIT
Answer: B) HAVING
Explanation: HAVING filters results after aggregation (WHERE filters before aggregation).
37. Which of the following is NOT an aggregate function in SQL?
A) COUNT()
B) SUM()
C) MAX()
D) UPDATE()
Answer: D) UPDATE()
Explanation: UPDATE is a DML command, not an aggregate function.
38. Which SQL operator is used to search for a pattern in a column?
A) BETWEEN
B) LIKE
C) IN
D) EXISTS
Answer: B) LIKE
Explanation: LIKE operator uses wildcards (%, _) to search for patterns.
39. Which operator is used to check for NULL values in SQL?
A) = NULL
B) IS NULL
C) == NULL
D) NULL
Answer: B) IS NULL
Explanation: IS NULL is used to check for NULL values.
40. Which of the following is NOT a valid SQL data type?
A) INTEGER
B) VARCHAR
C) FLOAT
D) ARRAY
Answer: D) ARRAY
Explanation: SQL does not have ARRAY as a standard data type.
41. Which index type updates automatically when data changes in the table?
A) Static index
B) Dynamic index
C) Clustered index
D) Bitmap index
Answer: C) Clustered index
Explanation: Clustered index maintains physical order of rows and updates automatically with changes.
42. Which of the following is used to uniquely identify rows in a table?
A) Primary Key
B) Index
C) View
D) Trigger
Answer: A) Primary Key
Explanation: Primary key uniquely identifies each row.
43. Which of the following is NOT a characteristic of DBMS?
A) Data Redundancy
B) Data Sharing
C) Data Integrity
D) Data Security
Answer: A) Data Redundancy
Explanation: DBMS reduces redundancy, while ensuring sharing, integrity, and security.
44. Which language is used to define the structure of a database?
A) DML
B) DDL
C) DCL
D) TCL
Answer: B) DDL
Explanation: Data Definition Language (DDL) defines database schema and structure.
45. Which language is used to control access to data in DBMS?
A) DML
B) DDL
C) DCL
D) TCL
Answer: C) DCL
Explanation: Data Control Language (DCL) includes GRANT and REVOKE for access control.
46. Which language is used to manipulate data in DBMS?
A) DML
B) DDL
C) DCL
D) HTML
Answer: A) DML
Explanation: Data Manipulation Language (DML) includes INSERT, UPDATE, DELETE, SELECT.
47. Which language is used to manage database transactions?
A) TCL
B) DDL
C) DCL
D) DML
Answer: A) TCL
Explanation: Transaction Control Language (TCL) includes COMMIT, ROLLBACK, SAVEPOINT.
48. Which SQL clause limits the number of rows returned?
A) WHERE
B) LIMIT
C) HAVING
D) TOP
Answer: B) LIMIT
Explanation: LIMIT restricts the number of rows (in SQL Server, TOP is used).
49. Which of the following is an example of an object-oriented database?
A) Oracle
B) MongoDB
C) PostgreSQL with object features
D) MySQL
Answer: C) PostgreSQL with object features
Explanation: PostgreSQL supports object-relational features, making it object-oriented.
50. Which database model allows many-to-many relationships with links?
A) Hierarchical
B) Network
C) Relational
D) Object-oriented
Answer: B) Network
Explanation: Network model allows many-to-many relationships using sets and pointers.
51. In SQL, which keyword is used to remove duplicate values from results?
A) DISTINCT
B) UNIQUE
C) FILTER
D) CLEAN
Answer: A) DISTINCT
Explanation: DISTINCT eliminates duplicate rows from the result set.
52. Which of the following is used to enforce data integrity?
A) Keys
B) Indexes
C) Views
D) Reports
Answer: A) Keys
Explanation: Keys (Primary, Foreign, Unique) enforce entity and referential integrity.
53. What does a foreign key ensure?
A) Uniqueness of data
B) No NULL values
C) Referential integrity between tables
D) Fast searching
Answer: C) Referential integrity between tables
Explanation: Foreign key ensures consistency between related tables.
54. Which of the following is NOT a valid SQL constraint?
A) CHECK
B) NOT NULL
C) INDEX
D) DEFAULT
Answer: C) INDEX
Explanation: Index improves search speed, but it is not a constraint.
55. Which command undoes changes in a transaction?
A) SAVEPOINT
B) COMMIT
C) ROLLBACK
D) GRANT
Answer: C) ROLLBACK
Explanation: ROLLBACK cancels a transaction and restores the previous state.
56. Which command permanently saves changes in a database?
A) SAVEPOINT
B) COMMIT
C) ROLLBACK
D) LOCK
Answer: B) COMMIT
Explanation: COMMIT makes changes permanent.
57. Which command is used to grant permissions to a user?
A) REVOKE
B) GRANT
C) PERMIT
D) ALLOW
Answer: B) GRANT
Explanation: GRANT assigns privileges to users in a database.
58. Which command removes permissions from a user?
A) REMOVE
B) REVOKE
C) DELETE
D) DENY
Answer: B) REVOKE
Explanation: REVOKE takes away privileges granted earlier.
59. Which index type is most commonly used in relational databases?
A) Clustered Index
B) Bitmap Index
C) Hash Index
D) Inverted Index
Answer: A) Clustered Index
Explanation: Clustered index defines the physical order of rows in a table.
60. A stored procedure in SQL is:
A) A compiled set of SQL statements
B) A table with triggers
C) A temporary table
D) A view
Answer: A) A compiled set of SQL statements
Explanation: Stored procedures are reusable, precompiled blocks of SQL code.
61. Which SQL object is used to generate values automatically?
A) Trigger
B) Sequence
C) Procedure
D) Function
Answer: B) Sequence
Explanation: A sequence generates auto-incrementing numeric values.
62. A trigger in DBMS is:
A) A predefined action executed automatically
B) A foreign key
C) A procedure that runs manually
D) A type of schema
Answer: A) A predefined action executed automatically
Explanation: Triggers execute automatically when certain events (INSERT, UPDATE, DELETE) occur.
63. Which SQL keyword is used to join multiple queries’ results together?
A) JOIN
B) UNION
C) INTERSECT
D) MERGE
Answer: B) UNION
Explanation: UNION combines results from multiple SELECT queries (removing duplicates).
64. Which SQL operator returns rows common to both queries?
A) UNION
B) UNION ALL
C) INTERSECT
D) EXCEPT
Answer: C) INTERSECT
Explanation: INTERSECT returns only the common records from two queries.
65. Which SQL operator returns rows from first query but not from the second?
A) UNION
B) INTERSECT
C) EXCEPT
D) DIFFERENCE
Answer: C) EXCEPT
Explanation: EXCEPT returns records present in the first query but not in the second.
66. Which of the following is a view in SQL?
A) A virtual table
B) A stored file
C) A data copy
D) A transaction
Answer: A) A virtual table
Explanation: A view is a virtual table created from SELECT queries, storing no data itself.
67. Which of the following statements about views is TRUE?
A) Views can store data physically
B) Views are always updatable
C) Views are stored queries
D) Views are faster than tables
Answer: C) Views are stored queries
Explanation: Views act as saved SQL queries providing virtual access to data.
68. Which of the following is a type of database architecture?
A) 1-tier
B) 2-tier
C) 3-tier
D) All of the above
Answer: D) All of the above
Explanation: Database architectures can be 1-tier, 2-tier, or 3-tier depending on layers.
69. In a 3-tier architecture, the middle layer is called:
A) Client layer
B) Application layer
C) Database layer
D) Server layer
Answer: B) Application layer
Explanation: 3-tier architecture consists of client, application, and database layers.
70. Which is the fastest searching mechanism in DBMS?
A) Primary key search
B) Sequential search
C) Index search
D) Nested query
Answer: C) Index search
Explanation: Indexes improve search speed significantly over sequential scans.
71. Which of the following is NOT an advantage of DBMS?
A) Data sharing
B) Data integrity
C) Data redundancy
D) Data security
Answer: C) Data redundancy
Explanation: DBMS reduces redundancy instead of encouraging it.
72. A deadlock occurs when:
A) Two transactions wait for each other’s resources
B) System crashes
C) Database gets corrupted
D) Memory is full
Answer: A) Two transactions wait for each other’s resources
Explanation: Deadlock is a state where two or more transactions cannot proceed due to circular waiting.
73. Which of the following is used to prevent deadlocks?
A) Locks
B) Timeouts
C) Priority scheduling
D) All of the above
Answer: D) All of the above
Explanation: Deadlocks can be prevented using locks, timeouts, or priority schemes.
74. Which concurrency control technique ensures serializability?
A) Locking
B) Timestamp ordering
C) Validation
D) All of the above
Answer: D) All of the above
Explanation: Concurrency control ensures serializable execution using these techniques.
75. Which backup type stores only changes since the last full backup?
A) Full backup
B) Incremental backup
C) Differential backup
D) Cold backup
Answer: B) Incremental backup
Explanation: Incremental backup saves space by storing only modified data since the last full backup.
76. Which of the following is a type of database model?
A) Hierarchical
B) Network
C) Relational
D) All of the above
Answer: D) All of the above
Explanation: Different DBMSs use hierarchical, network, or relational models to organize data.
77. Which of these is the most widely used database model today?
A) Hierarchical
B) Relational
C) Network
D) Object-oriented
Answer: B) Relational
Explanation: The relational model (tables/relations) is the standard in modern DBMSs.
78. Which normal form removes partial dependency?
A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: B) 2NF
Explanation: 2NF ensures no partial dependency of non-prime attributes on a part of a candidate key.
79. Which normal form removes transitive dependency?
A) 1NF
B) 2NF
C) 3NF
D) 4NF
Answer: C) 3NF
Explanation: 3NF eliminates transitive dependency, improving data integrity.
80. Which is the highest level of normalization typically used in practice?
A) 3NF
B) BCNF
C) 4NF
D) 5NF
Answer: B) BCNF
Explanation: Boyce-Codd Normal Form (BCNF) is often considered sufficient for practical databases.
81. Denormalization in DBMS means:
A) Splitting tables
B) Combining tables for faster queries
C) Normalizing again
D) Removing redundancy completely
Answer: B) Combining tables for faster queries
Explanation: Denormalization improves query speed by allowing some redundancy.
82. Which is a disadvantage of normalization?
A) Reduces redundancy
B) Reduces anomalies
C) Slower query performance
D) Improves data integrity
Answer: C) Slower query performance
Explanation: Excessive normalization may slow queries due to multiple joins.
83. Data warehouse mainly stores:
A) Transactional data
B) Historical data
C) Temporary data
D) Random data
Answer: B) Historical data
Explanation: Data warehouses are designed to store and analyze historical data for decision-making.
84. OLTP systems are mainly used for:
A) Day-to-day transaction processing
B) Data analysis
C) Historical reporting
D) Forecasting
Answer: A) Day-to-day transaction processing
Explanation: OLTP handles real-time operational transactions (like banking, bookings).
85. OLAP systems are mainly used for:
A) Transaction processing
B) Data analysis and reporting
C) Data redundancy
D) File storage
Answer: B) Data analysis and reporting
Explanation: OLAP is used for analytical queries, reporting, and decision-making.
86. Which type of key uniquely identifies a record in a table?
A) Foreign key
B) Primary key
C) Composite key
D) Super key
Answer: B) Primary key
Explanation: The primary key ensures uniqueness and non-null values for each record.
87. Which of the following is a candidate key?
A) Any attribute that can uniquely identify a row
B) A redundant key
C) Only foreign keys
D) A partial key
Answer: A) Any attribute that can uniquely identify a row
Explanation: Candidate keys are attributes eligible to be chosen as a primary key.
88. Which SQL statement is used to modify existing data in a table?
A) UPDATE
B) ALTER
C) MODIFY
D) CHANGE
Answer: A) UPDATE
Explanation: UPDATE modifies existing rows in a table.
89. Which SQL command is used to remove all rows but keep the structure of a table?
A) DROP
B) TRUNCATE
C) DELETE
D) REMOVE
Answer: B) TRUNCATE
Explanation: TRUNCATE removes all rows quickly but retains the table schema.
90. Which SQL clause is used to filter rows after grouping?
A) WHERE
B) HAVING
C) GROUP BY
D) ORDER BY
Answer: B) HAVING
Explanation: HAVING applies conditions to grouped rows, unlike WHERE which filters before grouping.
91. Which SQL function returns the number of rows?
A) COUNT()
B) SUM()
C) MAX()
D) AVG()
Answer: A) COUNT()
Explanation: COUNT() returns the total number of rows that match a query condition.
92. Which SQL keyword sorts query results?
A) ORDER BY
B) SORT BY
C) GROUP BY
D) ARRANGE
Answer: A) ORDER BY
Explanation: ORDER BY sorts rows in ascending or descending order.
93. Which SQL keyword returns unique values only?
A) UNIQUE
B) DISTINCT
C) FILTER
D) ONLY
Answer: B) DISTINCT
Explanation: DISTINCT removes duplicates in the output.
94. Which key in a relational database can accept NULL values?
A) Primary key
B) Candidate key
C) Foreign key
D) Super key
Answer: C) Foreign key
Explanation: Foreign keys can have NULL values if no relationship exists.
95. What does ACID stand for in DBMS?
A) Accuracy, Consistency, Isolation, Durability
B) Atomicity, Consistency, Isolation, Durability
C) Atomicity, Correctness, Independence, Durability
D) All Changes, Integrity, Data
Answer: B) Atomicity, Consistency, Isolation, Durability
Explanation: ACID properties ensure reliable database transactions.
96. Which of the following ensures atomicity in transactions?
A) Log files
B) Commit & Rollback
C) Checkpoints
D) Deadlock handling
Answer: B) Commit & Rollback
Explanation: COMMIT confirms atomic actions, ROLLBACK cancels uncompleted ones.
97. A database index mainly improves:
A) Data integrity
B) Security
C) Query performance
D) Storage size
Answer: C) Query performance
Explanation: Indexing speeds up searches at the cost of extra storage.
98. Which of the following is an example of a NoSQL database?
A) Oracle
B) MySQL
C) MongoDB
D) MS Access
Answer: C) MongoDB
Explanation: MongoDB is a NoSQL database that stores data in JSON-like format.
99. Which of the following databases is used in Android mobile applications?
A) MySQL
B) SQLite
C) PostgreSQL
D) Oracle
Answer: B) SQLite
Explanation: SQLite is lightweight and embedded, widely used in mobile applications.
100. Which of the following best describes a distributed database?
A) A database stored on a single server
B) A database copied for backup
C) A database spread across multiple locations
D) A database without indexes
Answer: C) A database spread across multiple locations
Explanation: Distributed databases store and manage data across multiple physical locations but appear as a single system.
