Q1. Which specific SQL command is used to remove a table structure completely from the database (not just the data)?

A) DELETE

B) REMOVE

C) DROP

D) TRUNCATE

E) ERASE

Answer: C (DROP removes the table schema; TRUNCATE empties it but keeps the structure; DELETE removes rows).

 

Q2. In the context of the ACID properties of a transaction, what does "I" stand for?

A) Integrity

B) Isolation

C) Immediate

D) Identification

E) Initialization

Answer: B (Isolation ensures transactions don't interfere with each other).

 

Q3. Which normal form ensures that there are no "Partial Dependencies" (i.e., Non-key attributes must depend on the entire Primary Key)?

A) First Normal Form (1NF)

B) Second Normal Form (2NF)

C) Third Normal Form (3NF)

D) BCNF

E) 4NF

Answer: B (This is the definition of 2NF).

 

Q4. The "Foreign Key" constraint is primarily used to enforce:

A) Entity Integrity

B) Domain Integrity

C) Referential Integrity

D) User Defined Integrity

E) Security Integrity

Answer: C (Ensures links between tables remain valid).

 

Q5. What is the result of a "Cartesian Product" (CROSS JOIN) between a table with 5 rows and a table with 4 rows?

A) 9 rows

B) 20 rows

C) 1 row

D) 5 rows

E) 4 rows

Answer: B (

5

×

4

=

20

5×4=20

).

 

Q6. Which SQL clause is used to filter the results of a "GROUP BY" query (filtering groups, not individual rows)?

A) WHERE

B) HAVING

C) ORDER BY

D) SELECT

E) LIMIT

Answer: B (WHERE filters rows before grouping; HAVING filters groups after grouping).

 

Q7. Which of the following is a DCL (Data Control Language) command?

A) CREATE

B) SELECT

C) INSERT

D) GRANT

E) COMMIT

Answer: D (GRANT and REVOKE).

 

Q8. A "Candidate Key" that is NOT selected as the Primary Key is called a(n):

A) Foreign Key

B) Alternate Key

C) Super Key

D) Secondary Key

E) Composite Key

Answer: B

 

Q9. The "Diamond" shape in an E-R (Entity-Relationship) Diagram represents:

A) Entity

B) Attribute

C) Relationship

D) Weak Entity

E) Key

Answer: C

 

Q10. Which SQL function would you use to find the total number of records in a table, including those with NULL values?

A) COUNT(column_name)

B) COUNT()

C) SUM()

D) TOTAL()

E) ADD()

Answer: B (COUNT() counts rows; COUNT(column) ignores NULLs).*

 

Q11. "Data Independence" refers to:

A) The ability to modify the schema at one level without affecting the schema at the next higher level.

B) Storing data in the cloud.

C) Data having no relationship.

D) Removing all keys.

E) Users working independently.

Answer: A

 

Q12. What is the major difference between "DELETE" and "TRUNCATE"?

A) DELETE is DDL; TRUNCATE is DML.

B) TRUNCATE is DDL (faster, cannot be easily rolled back in some systems); DELETE is DML (slower, logs every row).

C) DELETE removes the table structure.

D) TRUNCATE allows a WHERE clause.

E) There is no difference.

Answer: B

 

Q13. In a Relational Model, the term "Cardinality" refers to:

A) The number of Columns.

B) The number of Rows (Tuples) in a relation.

C) The size of the file.

D) The number of tables.

E) The data type.

Answer: B

 

Q14. Which operator is used for Pattern Matching in SQL (e.g., finding names starting with 'A')?

A) =

B) MATCH

C) LIKE

D) SIMILAR

E) SAME

Answer: C (e.g., LIKE 'A%').

 

Q15. "Third Normal Form" (3NF) is achieved when:

A) A table is in 2NF and has no Transitive Dependencies.

B) A table has no repeating groups.

C) A table has a Composite Key.

D) A table is in BCNF.

E) A table has no Foreign Keys.

Answer: A

 

Q16. "Metadata" is defined as:

A) Big Data.

B) Data about Data (e.g., Table names, Column types).

C) Corrupted Data.

D) User Data.

E) Backup Data.

Answer: B

 

Q17. Which command is used to undo transactions that have not yet been committed to the database?

A) RESTORE

B) ROLLBACK

C) RETURN

D) REVOKE

E) DELETE

Answer: B

 

Q18. The "Degree" of a relation refers to:

A) The number of Rows.

B) The number of Attributes (Columns).

C) The number of Relations.

D) The complexity of the query.

E) The size of memory.

Answer: B

 

Q19. Which constraint ensures that all values in a column are unique, but allows ONE Null value?

A) PRIMARY KEY

B) FOREIGN KEY

C) UNIQUE

D) CHECK

E) NOT NULL

Answer: C (Primary Key does NOT allow Nulls).

 

Q20. "Atomicity" in ACID properties means:

A) Transactions happen in isolation.

B) The "All or Nothing" rule (Either the whole transaction happens, or none of it does).

C) Data is saved permanently.

D) Data is accurate.

E) Transactions are atomic (small).

Answer: B

 

Q21. A "View" in SQL is:

A) A physical table.

B) A virtual table based on the result-set of a query (does not store data itself).

C) A backup.

D) A diagram.

E) A type of key.

Answer: B

 

Q22. Which SQL keyword is used to eliminate duplicate rows in the result set?

A) UNIQUE

B) DIFFERENT

C) DISTINCT

D) ONLY

E) NO_DUPLICATE

Answer: C

 

Q23. The "Left Outer Join" returns:

A) All rows from the Right table.

B) All rows from the Left table, and matched rows from the Right table.

C) Only matched rows.

D) All rows from both tables.

E) A Cartesian product.

Answer: B

 

Q24. A "Weak Entity" in an E-R Diagram:

A) Has no attributes.

B) Cannot be uniquely identified by its own attributes alone (Needs a Foreign Key from a specific owner).

C) Is represented by a single rectangle.

D) Has no relationship.

E) Is optional.

Answer: B (Represented by a Double Rectangle).

 

Q25. "DBA" stands for:

A) Data Base Access

B) Database Administrator

C) Data Basic Authority

D) Database Analyst

E) Data Base Application

Answer: B

 

Q26. Which command is used to modify the structure of an existing table (e.g., adding a column)?

A) UPDATE TABLE

B) MODIFY TABLE

C) ALTER TABLE

D) CHANGE TABLE

E) EDIT TABLE

Answer: C

 

Q27. The wildcard character _ (Underscore) in SQL LIKE operator represents:

A) Zero or more characters.

B) Exactly one character.

C) A space.

D) A number.

E) A symbol.

Answer: B (% represents zero or more).

 

Q28. "Concurrency Control" deals with:

A) Managing multiple transactions executing at the same time to ensure data consistency.

B) Speeding up queries.

C) Connecting to the internet.

D) Backing up data.

E) Printing reports.

Answer: A

 

Q29. A "Deadlock" occurs when:

A) The system crashes.

B) Two transactions are waiting for each other to release a lock indefinitely.

C) The hard drive fails.

D) A user logs out.

E) The database is full.

Answer: B

 

Q30. "Normalization" is mainly done to:

A) Increase Redundancy.

B) Minimize Redundancy and dependency.

C) Create complex queries.

D) Secure the data.

E) Make the database larger.

Answer: B

 

Q31. Which of the following is NOT a type of Database Model?

A) Relational

B) Hierarchical

C) Network

D) Flowchart

E) Object-Oriented

Answer: D

 

Q32. The "CHECK" constraint is used to:

A) Verify passwords.

B) Limit the value range that can be placed in a column (e.g., Salary > 0).

C) Check for duplicates.

D) Check if table exists.

E) Check spelling.

Answer: B

 

Q33. "Data Warehousing" refers to:

A) Real-time transaction processing.

B) Storing large amounts of historical data for analysis and reporting (OLAP).

C) Storing data in a warehouse building.

D) Deleting old data.

E) Cloud storage.

Answer: B

 

Q34. "OLTP" stands for:

A) Online Transaction Processing (e.g., ATM, Bank transactions).

B) Online Table Processing.

C) Offline Transaction Protocol.

D) Online Text Processing.

E) Old Transfer Protocol.

Answer: A

 

Q35. "Data Mining" is the process of:

A) Entering data.

B) Discovering patterns and knowledge from large datasets.

C) Mining Bitcoin.

D) Hiding data.

E) Encrypting data.

Answer: B

 

Q36. Which SQL aggregate function returns the average value?

A) MEAN()

B) AVERAGE()

C) AVG()

D) COUNT()

E) MEDIAN()

Answer: C

 

Q37. A "Composite Key" is:

A) A key made of metal.

B) A Primary Key that consists of two or more columns.

C) A Foreign Key.

D) A Super Key.

E) A weak key.

Answer: B

 

Q38. "Referential Integrity" rule states that:

A) Primary Keys cannot be Null.

B) Foreign Key values must match a Primary Key in the parent table (or be Null).

C) All data must be text.

D) No duplicates allowed.

E) Users must be admin.

Answer: B

 

Q39. Which command saves the transaction permanently?

A) SAVEPOINT

B) ROLLBACK

C) COMMIT

D) DONE

E) GRANT

Answer: C

 

Q40. "BCNF" (Boyce-Codd Normal Form) is essentially:

A) A weaker version of 3NF.

B) A stronger version of 3NF (every determinant must be a candidate key).

C) 1NF.

D) 2NF.

E) Unnormalized.

Answer: B

 

Q41. "SQL Injection" is:

A) A way to insert data faster.

B) A security vulnerability where an attacker interferes with the queries an application makes to its database.

C) An injection of speed.

D) A database update.

E) A type of Join.

Answer: B

 

Q42. The "ORDER BY" clause sorts data in Ascending order by default. To sort in Descending, which keyword is used?

A) DOWN

B) DESC

C) REV

D) SORT_DESC

E) LOWER

Answer: B

 

Q43. Which of the following is an example of a NoSQL database?

A) MySQL

B) Oracle

C) MongoDB

D) SQL Server

E) PostgreSQL

Answer: C

 

Q44. "Data Redundancy" means:

A) Data is lost.

B) Data is accurate.

C) Duplication of data (same data stored in multiple places).

D) Data is encrypted.

E) Data is unique.

Answer: C

 

Q45. A "Stored Procedure" is:

A) A physically stored table.

B) Pre-compiled SQL code saved in the database for reuse.

C) A backup.

D) A log file.

E) A user permission.

Answer: B

 

Q46. The schema that describes the physical storage structure of the database is the:

A) External Schema

B) Conceptual Schema

C) Internal (Physical) Schema

D) Logical Schema

E) View Schema

Answer: C

 

Q47. "TCL" commands include:

A) SELECT, INSERT

B) GRANT, REVOKE

C) CREATE, DROP

D) COMMIT, ROLLBACK, SAVEPOINT

E) UPDATE, DELETE

Answer: D (Transaction Control Language).

 

Q48. Which relationship is created when a Primary Key of one table is added to another table as a Foreign Key?

A) One-to-One or One-to-Many

B) Many-to-Many (requires a junction table)

C) None

D) Infinite

E) Circular

Answer: A

 

Q49. The "BETWEEN" operator includes:

A) The start value only.

B) The end value only.

C) Both the start and end values (Inclusive).

D) Neither value.

E) Only text.

Answer: C

 

Q50. "Durability" in ACID ensures:

A) Transactions are fast.

B) Once a transaction is committed, it remains saved even in the event of power loss or crash.

C) Users are isolated.

D) Data is consistent.

E) Data is atomic.

Answer: B

 

Q51. What is a "Surrogate Key"?

A) A natural key like Email.

B) An artificial key (usually an auto-incrementing number) assigned by the system, having no business meaning.

C) A foreign key.

D) A composite key.

E) A password.

Answer: B

 

Q52. "Entities" in a database usually correspond to what in the real world?

A) Actions

B) Verbs

C) Objects or Nouns (Student, Car, Employee).

D) Adjectives.

E) Colors.

Answer: C

 

Q53. A "Trigger" executes:

A) Manually by the user.

B) Automatically in response to certain events (INSERT, UPDATE, DELETE) on a table.

C) At midnight only.

D) Only on errors.

E) When the DB starts.

Answer: B

 

Q54. "Denormalization" is sometimes used to:

A) Save space.

B) Improve read performance (Speed up queries) by adding redundancy.

C) Increase security.

D) Clean data.

E) Remove keys.

Answer: B

 

Q55. Which SQL operator is used to check for NULL values?

A) = NULL

B) IS NULL

C) LIKE NULL

D) EQUALS NULL

E) == NULL

Answer: B (You cannot use '=' with NULL).

 

Q56. "Big Data" technologies like Hadoop use which file system?

A) NTFS

B) FAT32

C) HDFS (Hadoop Distributed File System)

D) EXT4

E) APFS

Answer: C

 

Q57. A "Self Join" is:

A) Joining a table to itself.

B) Joining two databases.

C) Joining a view.

D) An error.

E) Joining with XML.

Answer: A

 

Q58. "Grant Option" in the GRANT command allows:

A) The user to delete data.

B) The user to pass on (grant) the specific privilege to other users.

C) The user to see passwords.

D) The user to create tables.

E) The user to stop the server.

Answer: B

 

Q59. The "UNION" operator combines results of two queries and:

A) Keeps duplicates.

B) Removes duplicates by default.

C) Sorts them.

D) Deletes them.

E) Multiplies them.

Answer: B (Use UNION ALL to keep duplicates).

 

Q60. Which of the following is NOT a property of a Transaction?

A) Atomicity

B) Consistency

C) Isolation

D) Redundancy

E) Durability

Answer: D (Redundancy is generally bad; ACID are the good properties).