Tap an option to check your answer — the correct answer and full explanation appear after you choose.
Computer ScienceDatabases & DBMSID: DB-006
In an ER diagram, a multi-valued attribute is drawn as a:
ASingle ellipse
BDashed ellipse
CDouble ellipse ✓ Correct answer
DUnderlined ellipse
✓ Correct answer: Double ellipse
Full explanation
A multi-valued attribute, such as a student's several phone numbers, is drawn as a double ellipse. A single ellipse is an ordinary attribute and a dashed ellipse is a derived attribute.
Computer ScienceDatabases & DBMSID: DB-007
In an ER diagram, a derived attribute — one calculated from other attributes, such as age from date of birth — is drawn as a:
ADouble ellipse
BUnderlined ellipse
CDashed ellipse ✓ Correct answer
DDouble rectangle
✓ Correct answer: Dashed ellipse
Full explanation
A derived attribute is drawn as a dashed ellipse, because its value is worked out from another attribute and is not stored itself.
Computer ScienceDatabases & DBMSID: DB-008
A composite attribute in an ER model is one that:
ACan be divided into smaller parts, such as a name into first and last name ✓ Correct answer
BHas many values at once
CIs calculated from another attribute
DUniquely identifies an entity
✓ Correct answer: Can be divided into smaller parts, such as a name into first and last name
Full explanation
A composite attribute can be split into smaller parts: a full name divides into first name and last name, and an address into street, city and country. A simple attribute cannot be split.
Computer ScienceDatabases & DBMSID: DB-009
A relationship in which three entity sets take part is called a:
AUnary relationship
BBinary relationship
CTernary relationship ✓ Correct answer
DRecursive relationship
✓ Correct answer: Ternary relationship
Full explanation
The degree of a relationship is the number of entity sets taking part: one is unary (recursive), two is binary, and three is ternary.
Computer ScienceDatabases & DBMSID: DB-010
In an ER model, total participation means that:
AEvery entity in the set must take part in the relationship ✓ Correct answer
BOnly some entities take part in the relationship
CThe relationship is many-to-many
DThe entity has no key
✓ Correct answer: Every entity in the set must take part in the relationship
Full explanation
Total participation (double line) means every entity of the set must take part — for example every employee must belong to a department. Partial participation (single line) means some may not.
Computer ScienceDatabases & DBMSID: DB-011
A strong entity differs from a weak entity because a strong entity:
AHas its own primary key and can exist on its own ✓ Correct answer
BDepends on an owner entity
CHas no attributes
DIs always drawn with a double rectangle
✓ Correct answer: Has its own primary key and can exist on its own
Full explanation
A strong entity has its own primary key and exists independently. A weak entity has no key of its own, is drawn with a double rectangle, and cannot exist without its owner entity.
Computer ScienceDatabases & DBMSID: DB-012
When an ER diagram with a many-to-many relationship is converted into tables, the relationship is stored in:
AThe table of the first entity
BThe table of the second entity
CA new separate table holding both primary keys ✓ Correct answer
DNo table at all
✓ Correct answer: A new separate table holding both primary keys
Full explanation
A many-to-many relationship cannot live in either entity's table, so it gets its own table whose key is the two primary keys together — for example an Enrolment table holding student_id and course_id.
Computer ScienceDatabases & DBMSID: DB-013
When a one-to-many relationship is converted into tables, the primary key of the 'one' side is placed as a foreign key in:
AA new separate table
BBoth tables
CThe table on the 'one' side
DThe table on the 'many' side ✓ Correct answer
✓ Correct answer: The table on the 'many' side
Full explanation
In a one-to-many relationship the foreign key goes on the 'many' side: each employee row carries the department_id of its one department. No separate table is needed.
Computer ScienceDatabases & DBMSID: DB-014
The Entity-Relationship model was proposed by Peter Chen in:
A1966
B1996
C1986
D1976 ✓ Correct answer
✓ Correct answer: 1976
Full explanation
Peter Chen proposed the Entity-Relationship model in 1976, giving database design its standard drawing: entities as rectangles, attributes as ellipses and relationships as diamonds.
Computer ScienceDatabases & DBMSID: DB-015
A super key in a relational table is:
AA minimal set of columns that identifies a row
BA key that links two tables
CThe key chosen as the primary key
DAny set of columns that uniquely identifies each row ✓ Correct answer
✓ Correct answer: Any set of columns that uniquely identifies each row
Full explanation
A super key is any set of columns whose values identify each row. A candidate key is a minimal super key — no column can be removed from it — and the primary key is the candidate key the designer chooses.
Computer ScienceDatabases & DBMSID: DB-016
An alternate key is a candidate key that:
AWas not chosen as the primary key ✓ Correct answer
BLinks two tables
CContains duplicate values
DIs made of a single column only
✓ Correct answer: Was not chosen as the primary key
Full explanation
A table can have several candidate keys. The one chosen becomes the primary key, and the rest become alternate keys. All of them could identify a row.
Computer ScienceDatabases & DBMSID: DB-017
In the relational model, a domain is:
AA row of a table
BThe primary key of a table
CA relationship between tables
DThe set of permitted values for an attribute ✓ Correct answer
✓ Correct answer: The set of permitted values for an attribute
Full explanation
A domain is the set of values an attribute is allowed to hold — for example the domain of a marks column might be the whole numbers from 0 to 100.
Computer ScienceDatabases & DBMSID: DB-018
The entity integrity rule of the relational model states that:
AA foreign key must match a primary key
BA primary key may repeat once
CEvery table must have a foreign key
DNo part of a primary key may be null ✓ Correct answer
✓ Correct answer: No part of a primary key may be null
Full explanation
Entity integrity says no part of a primary key can be null, because a null value could not identify a row. A primary key must always be present and unique.
Computer ScienceDatabases & DBMSID: DB-019
The referential integrity rule states that a foreign key value must either be null or:
AMatch a primary key value in the referenced table ✓ Correct answer
BBe larger than the primary key
CBe unique in its own table
DContain only numbers
✓ Correct answer: Match a primary key value in the referenced table
Full explanation
Referential integrity says a foreign key must point at a row that really exists: its value must match a primary key value in the referenced table, or be null. It stops orphan rows.
Computer ScienceDatabases & DBMSID: DB-020
Which of the following is true of a foreign key?
AIt must be unique in every row
BIt must be the primary key of its own table
CIt cannot be part of any index
DIt may repeat and may be null unless restricted ✓ Correct answer
✓ Correct answer: It may repeat and may be null unless restricted
Full explanation
A foreign key may repeat — many employees can share one department_id — and it may be null unless a NOT NULL rule forbids it. Only the primary key must be unique and not null.
Computer ScienceDatabases & DBMSID: DB-021
The degree of a relation is the number of:
ARows in the table
BKeys in the table
CTables in the database
DAttributes (columns) of the table ✓ Correct answer
✓ Correct answer: Attributes (columns) of the table
Full explanation
The degree of a relation is its number of attributes (columns). A table with five columns has degree five.
Computer ScienceDatabases & DBMSID: DB-022
The cardinality of a relation is the number of:
AAttributes of the table
BRelationships of the table
CCandidate keys
DTuples (rows) in the table ✓ Correct answer
✓ Correct answer: Tuples (rows) in the table
Full explanation
The cardinality of a relation is its number of tuples (rows). Do not confuse it with cardinality in an ER diagram, which is about how many instances relate to each other.
Computer ScienceDatabases & DBMSID: DB-023
Which SQL command changes the values already stored in a row?
AINSERT
BSELECT
CDELETE
DUPDATE ✓ Correct answer
✓ Correct answer: UPDATE
Full explanation
UPDATE changes existing rows, usually with SET and a WHERE clause: UPDATE students SET marks = 90 WHERE id = 5. INSERT adds a row, DELETE removes one, SELECT only reads.
Computer ScienceDatabases & DBMSID: DB-024
Which SQL command takes back a privilege that was given with GRANT?
AREVOKE ✓ Correct answer
BREMOVE
CDENY
DDROP
✓ Correct answer: REVOKE
Full explanation
GRANT gives a privilege and REVOKE takes it back: REVOKE SELECT ON students FROM ali. Both belong to the Data Control Language (DCL).
Computer ScienceDatabases & DBMSID: DB-025
In a transaction, a SAVEPOINT is used to:
ASave the whole database to disk
BMark a point to roll back to without undoing the whole transaction ✓ Correct answer
CGrant a privilege to a user
DCreate a backup copy of a table
✓ Correct answer: Mark a point to roll back to without undoing the whole transaction
Full explanation
A SAVEPOINT marks a point inside a transaction. ROLLBACK TO SAVEPOINT undoes only the work after that point, while the rest of the transaction survives.