What does DBMS stand for?
- A. Digital Base Memory System
- B. Data Building Model System
- C. Data Backup Management Software
- D. Database Management System (correct)
Which of these is a relational database?
- A. PostgreSQL (correct)
- B. Cassandra
- C. Redis
- D. MongoDB
In a relational database, data is stored in:
- A. Documents only
- B. Folders
- C. Spreadsheets
- D. Tables (correct)
What is a column in a table also called?
- A. A tuple
- B. A record
- C. A relation
- D. An attribute or field (correct)
What is a schema?
- A. A backup file
- B. A row in a table
- C. A type of query
- D. The structure of a database: its tables, columns and relationships (correct)
What is redundancy in a database?
- A. The same data stored in more than one place (correct)
- B. Fast queries
- C. Encrypted data
- D. Deleted data
What does an ER diagram show?
- A. Server load
- B. Network cables
- C. Entities, their attributes and relationships (correct)
- D. Query results
Which is a NoSQL database type?
- A. Flat file only
- B. Document store (correct)
- C. Spreadsheet
- D. Relational table
Which language is used to query relational databases?
- A. HTML
- B. XML
- C. CSS
- D. SQL (correct)
What is a tuple in relational terminology?
- A. A row (correct)
- B. A table
- C. A key
- D. A column
What is the main goal of database normalization?
- A. Making all values lowercase
- B. Organizing tables to reduce redundancy and update anomalies (correct)
- C. Backing up a database
- D. Adding indexes
A table is in First Normal Form (1NF) when:
- A. It has a primary key only
- B. Every column holds atomic values and there are no repeating groups (correct)
- C. It has no foreign keys
- D. It has fewer than 10 columns
A table in 2NF must also have:
- A. No NULL values
- B. No foreign keys
- C. No partial dependency of non-key columns on part of a composite key (correct)
- D. Only one column
3NF removes which kind of dependency?
- A. Transitive dependency of non-key columns on other non-key columns (correct)
- B. Partial dependency only
- C. Foreign key dependency
- D. Multi-valued dependency
What is a candidate key?
- A. A foreign key
- B. A key that might be deleted
- C. A minimal set of columns that can uniquely identify a row (correct)
- D. Any column with numbers
What is a super key?
- A. The largest key
- B. Any set of columns that uniquely identifies a row (correct)
- C. A key across databases
- D. A key used by the admin
What is a one-to-many relationship?
- A. Two tables with the same rows
- B. One row in a table relates to many rows in another (correct)
- C. A table with one column
- D. Every row relates to every row
How is a many-to-many relationship usually implemented?
- A. With a view
- B. With one foreign key
- C. With an index
- D. With a junction table holding two foreign keys (correct)
What is referential integrity?
- A. Backups are verified
- B. All data is encrypted
- C. Foreign keys always point to existing rows (correct)
- D. Every table has an index
What is a weak entity?
- A. An entity with no relationships
- B. An entity that cannot be identified without a related strong entity (correct)
- C. An entity with few rows
- D. A deleted entity
What is data independence?
- A. Changing storage or schema at one level without affecting higher levels (correct)
- B. Data without a type
- C. Data with no relationships
- D. Data stored on separate servers
What is a deadlock in a database?
- A. Two transactions each waiting for a lock held by the other (correct)
- B. A crashed server
- C. A full disk
- D. A failed backup
What is the purpose of a lock in a database?
- A. To control concurrent access to data (correct)
- B. To speed up SELECTs
- C. To encrypt data
- D. To delete old data
What is a B-tree index?
- A. A balanced tree structure that keeps keys sorted for fast search (correct)
- B. A list of backups
- C. A binary tree with two keys
- D. A hash table
Which index type is best for exact equality lookups but not ranges?
- A. Hash index (correct)
- B. B-tree index
- C. Bitmap only
- D. Full-text index
What is BCNF?
- A. A query language
- B. A NoSQL model
- C. A backup format
- D. A stricter 3NF where every determinant is a candidate key (correct)
What is a functional dependency A → B?
- A. B is computed by a function of A at runtime
- B. Each value of A determines exactly one value of B (correct)
- C. A and B are in different tables
- D. A is a foreign key to B
What does write-ahead logging (WAL) ensure?
- A. Queries run faster
- B. Logs are deleted before writes
- C. Changes are logged before being applied, so the database can recover after a crash (correct)
- D. Writes happen in alphabetical order
What is two-phase locking?
- A. Locking reads and writes separately
- B. Locking a table twice
- C. Using two databases
- D. Transactions acquire all locks before releasing any, ensuring serializability (correct)
What is a phantom read?
- A. Reading a deleted row
- B. A query returns new rows that another transaction inserted between two reads (correct)
- C. Reading data from cache
- D. Reading uncommitted data
What does denormalization trade for faster reads?
- A. Fewer tables to query only
- B. Extra redundancy and more complex updates (correct)
- C. Smaller storage
- D. Data integrity is removed entirely
What is a clustered index?
- A. An index on several servers
- B. An index that defines the physical order of rows in the table (correct)
- C. An index stored in memory only
- D. An index with duplicate keys
What is MVCC (multi-version concurrency control)?
- A. Storing multiple backups
- B. Versioning the schema
- C. Running several database servers
- D. Keeping several versions of rows so readers do not block writers (correct)
What is the main idea of the CAP theorem for distributed databases?
- A. It only applies to SQL databases
- B. It is about CPU, API and Performance
- C. During a network partition you must choose between consistency and availability (correct)
- D. You can always have all three guarantees
What is horizontal partitioning (sharding)?
- A. Copying a table to a backup
- B. Splitting rows of a table across several databases (correct)
- C. Splitting columns into separate tables
- D. Indexing every column
Which of these is NOT a DBMS?
- A. Oracle Database
- B. MySQL
- C. Microsoft Word (correct)
- D. SQLite
What is a primary key's main job?
- A. Linking to another database server
- B. Sorting rows alphabetically
- C. Encrypting the table
- D. Uniquely identifying each row in a table (correct)
What is a DDL command?
- A. A command that reads data, such as SELECT
- B. A command that ends a transaction
- C. A command that defines structure, such as CREATE or ALTER (correct)
- D. A command that controls access, such as GRANT
Which of these is a DML command?
- A. GRANT
- B. DROP
- C. INSERT (correct)
- D. CREATE
What does the GRANT command do?
- A. Creates a new table
- B. Backs up the database
- C. Deletes a user
- D. Gives a user permissions on database objects (correct)
What is a database trigger?
- A. A type of index
- B. A scheduled backup
- C. A user account
- D. Code that runs automatically when a specified event occurs on a table (correct)
What is a stored procedure?
- A. A backup procedure
- B. An index rebuild
- C. A cached query result
- D. A saved set of SQL statements that runs on the database server (correct)