WorksheetsDBC - CH03
Total questions: 20
Worksheet time: 10mins
Your university stores each student’s ID, name, and course in a table. What key ensures no duplicate student IDs exist?
Foreign Key
Composite Key
Primary Key
Secondary Key
In a ride-hailing app, a driver can complete many trips, but each trip is linked to only one driver. What kind of relationship is this?
M:N
1:1
Recursive
1:M
Which key is used only for data retrieval and not for entity identification?
Super Key
Primary Key
Composite Key
Secondary Key
You're designing a database for a smart fridge that tracks expiry dates of items. Which attribute would most likely allow NULL values?
Item Name
Expiry Date
Storage Temperature
Disposal Date
Which key contains minimum required attributes to uniquely identify a row?
Candidate Key
Super Key
Composite Key
Foreign Key
Why should NULLs be avoided in primary keys?
They confuse programmers
They slow down queries
They violate uniqueness
They make data visually messy
A mobile wallet links user payments to bank accounts. Which key ensures each payment references the correct bank account?
Composite Key
Primary Key
Foreign Key
Candidate Key
Which type of relationship cannot be directly implemented in the relational model?
1:1
1:M
M:N
Self-join
What happens if a foreign key value doesn’t match any primary key in the referenced table?
Nothing
Referential integrity is violated
Table is deleted
Index is corrupted
You are building a library system. Each book has one ISBN. Some books have two authors. What model would help represent this?
Add ISBN to author table
Use 1:1 relationship
Implement M:N with a junction table
Use NULLs for second author
What is a composite key?
Key used for indexing
Key made of multiple attributes
Key with NULL values
Duplicate of a primary key
A fitness app tracks users’ daily steps and calories. What key would link a user to their daily health logs?
Secondary Key
Foreign Key
Unique Key
Primary Key
Which of the following is true about data redundancy?
It is always bad
It helps in referential integrity
It can cause anomalies if uncontrolled
It improves query speed
What is the main function of an index in a table?
Delete duplicate rows
Restrict NULLs
Speed up data retrieval
Secure data entries
If Shopee wanted to show buyers only items they've searched before, what concept would help link buyer behavior with product logs?
Composite Key
Candidate Key
Foreign Key
Index Key
Which of the following would be stored in a data dictionary?
Usernames and passwords
Rows of data
Table names and attribute types
Shopping cart contents
You’re building a COVID-19 vaccine database. Some patients skipped second dose. Which attribute can allow NULL?
Patient ID
First dose date
Second dose date
Vaccine name
What is functional dependence?
When an attribute is optional
When a table depends on another
When value of one attribute determines another
When all keys are foreign
A super key must:
Be made of multiple attributes only
Be a key used only for retrieval
Uniquely identify each row
Always include foreign keys
In a multi-user music streaming app, users create playlists. Each playlist contains multiple songs, and songs appear in multiple playlists. What relationship is this?
1:M
M:N
1:1
Composite
