What is the main role of a DBMS?
A Compile source code
B Route network packets
C Control processor clocks
D Manage and access data
Answer: D. Manage and access data. A database management system stores, organizes, and provides controlled access to data.
In a relational database, what is a relation?
A Row
B Column
C Table
D Index page
Answer: C. Table. A relation is represented as a table of tuples and attributes.
What is a tuple in a relation?
A Column
B Database schema
C Query plan
D Row
Answer: D. Row. A tuple is one row or record in a relational table.
What is an attribute in a relation?
A Column
B Row
C Transaction log
D Database user
Answer: A. Column. An attribute is a named column that describes one property of each tuple.
What does a database schema describe?
A Current row values only
B Structure of the database
C Query execution time
D Backup location only
Answer: B. Structure of the database. A schema defines database structures such as tables, columns, and constraints.
What is a database instance?
A Table structure definition
B Current stored data
C SQL language standard
D Database engine source
Answer: B. Current stored data. An instance is the current contents of a database at a given moment.
What must a primary key provide?
A Duplicate nullable values
B Sorted insertion order
C A default value always
D Unique nonnull row identity
Answer: D. Unique nonnull row identity. A primary key uniquely identifies each row and cannot be null.
What is a candidate key?
A Minimal unique attribute set
B Any nonunique column
C A foreign key only
D A table name alias
Answer: A. Minimal unique attribute set. A candidate key uniquely identifies rows and has no unnecessary attributes.
What is an alternate key?
A Candidate key not selected primary
B Foreign key referencing itself
C A key with duplicate values
D A database backup key
Answer: A. Candidate key not selected primary. An alternate key is a candidate key chosen not to be the primary key.
What does a foreign key reference?
A A query parameter
B A database file name
C A nonunique comment
D Referenced table key
Answer: D. Referenced table key. A foreign key enforces a relationship by referencing a key in a table.
What is a composite key?
A Key with duplicate values
B External database key
C Key that cannot identify rows
D Key made from multiple attributes
Answer: D. Key made from multiple attributes. A composite key uses more than one attribute to identify a tuple.
What does entity integrity require?
A Primary key values are nonnull
B All columns are unique
C Every table has a timestamp
D Foreign keys are sorted
Answer: A. Primary key values are nonnull. Entity integrity prevents null values in primary key attributes.
What does referential integrity protect?
A Unique query results
B Valid foreign key references
C Sorted table storage
D Column data types only
Answer: B. Valid foreign key references. Referential integrity keeps foreign key values consistent with referenced rows.
What is a domain constraint?
A Allowed values for an attribute
B Schema table count
C Order of rows on disk
D A required index type
Answer: A. Allowed values for an attribute. A domain constraint limits an attribute to valid values or types.
What does an ER diagram model?
A Query execution steps
B Disk blocks and indexes
C Program classes only
D Entities and relationships
Answer: D. Entities and relationships. Entity relationship diagrams represent data entities and their relationships.
What does one to many cardinality mean?
A One relates to many
B Every row relates to itself
C Many tables share one schema
D One column, many types
Answer: A. One relates to many. One instance on one side can relate to many instances on the other.
What does relational algebra selection do?
A Chooses columns
B Combines tables by keys
C Filters rows by condition
D Renames a relation
Answer: C. Filters rows by condition. Selection returns tuples that satisfy a predicate.
What does relational algebra projection do?
A Filters rows by condition
B Joins two tables
C Chooses columns
D Sorts tuples
Answer: C. Chooses columns. Projection returns specified attributes from a relation.
What does a Cartesian product form?
A Only matching key rows
B All row pairs across relations
C Unique rows from both tables
D Rows meeting a filter
Answer: B. All row pairs across relations. The Cartesian product pairs every tuple from one relation with every tuple of another.
What does relational algebra rename change?
A Relation or attribute name
B Tuple values
C Column data types
D Database permissions
Answer: A. Relation or attribute name. Rename changes the name of a relation or its attributes.
When can relational UNION combine two relations?
A They share a primary key
B They have compatible attributes
C Same number of rows
D They use identical indexes
Answer: B. They have compatible attributes. Union requires relations with compatible schemas and corresponding domains.
What does relational difference return?
A Rows in both relations
B All row pairs
C Rows in first relation only
D Columns from first relation
Answer: C. Rows in first relation only. Set difference returns tuples present in the first relation but absent in the second.
What does database metadata describe?
A Only end user values
B Only transaction results
C Data structure and definitions
D Network cable status
Answer: C. Data structure and definitions. Metadata describes database objects, types, constraints, and other structural information.
What does physical data independence allow?
A Table change, same applications
B Storage change, same schema
C Queries without tables
D Users to bypass permissions
Answer: B. Storage change, same schema. Physical independence separates storage representation from the logical schema.
What is a database view?
A Physical copy of every database
B A primary key index
C Named query as table
D Transaction lock only
Answer: C. Named query as table. A view is a stored query that presents selected data as a virtual table.