Database Design Fundamentals
- 108Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is a database?
108 questions
- 1
What is a database?
Model answer
A database is a system that stores data.
Explanation
Data can include anything that can be stored or written down, such as customers, transactions, users, or weather events.
- 2
Why is database design important?
Model answer
Database design structures data so it remains accurate, efficient, organized, and easy to manage.
Explanation
Good design helps prevent integrity problems, repeating data, update anomalies, and poor performance.
- 3
Why can database design skills be applied across different database systems?
Model answer
General database design focuses on concepts and relationships rather than the commands of one specific database management system.
Explanation
The same design principles can be applied to relational systems such as MySQL, Oracle, and SQL Server.
- 4
What is the difference between a website's front end and back end?
Model answer
The front end is what the user sees, while the back end contains the hidden processing and data storage.
Explanation
A website form may collect a username and password on the front end, while the back end stores and checks those values in a database.
- 5
How does a website use a database during login?
Model answer
Registration information is stored in the database, and later login values are checked against the stored values.
Explanation
The database allows the website to remember usernames, passwords, and email addresses.
- 6
How does a database differ from a spreadsheet when handling complex searches?
Model answer
A database can run queries to identify matching records automatically, whereas a spreadsheet may require manual inspection.
Explanation
For example, a database can find employees with at least three years of service and no more than three missed days.
- 7
How does a database provide more selective access than a spreadsheet?
Model answer
A database can return selected columns and give different users access to different information.
Explanation
A spreadsheet often provides broad access to the entire file, while a database can hide private columns or records.
- 8
What is a relational database?
Model answer
A relational database stores data in related tables.
Explanation
The tables are connected through relationships and keys rather than storing everything in one large table.
- 9
What is a relation in the mathematical sense used by relational databases?
Model answer
A relation is a connection between sets of data.
Explanation
The relational database concept comes from combining or connecting sets, not simply from the word relationship.
- 10
What is an entity?
Model answer
An entity is anything about which the database stores data.
Explanation
Examples include a person, customer, employee, order, comment, transaction, or class.
- 11
What is an attribute?
Model answer
An attribute is a characteristic or piece of information stored about an entity.
Explanation
For a person, attributes might include name, username, address, phone number, or hair color.
- 12
How are an entity and its attributes represented in a table?
Model answer
The entity is represented by a row, and its attributes are represented by columns.
Explanation
A row contains the attribute values for one entity, while a column contains values for one attribute type.
- 13
What is a row?
Model answer
A row contains all the attribute values for one specific entity.
Explanation
For example, one user's ID, name, username, email, and password together form one row.
- 14
What is a column?
Model answer
A column contains values for one specific attribute type.
Explanation
A username column contains the usernames of multiple entities.
- 15
What is another mathematical term for a row?
Model answer
A row is also called a tuple.
Explanation
The source also uses the informal spelling or pronunciation “tuple” for a row.
- 16
What is an entity type?
Model answer
An entity type is the category shared by the entities stored in a table.
Explanation
If a table stores users, its entity type is user, while individual users are separate entities.
- 17
What is an attribute type?
Model answer
An attribute type is a category of attribute, such as name, username, or password.
Explanation
Once a specific value is assigned, it becomes an instance or value of that attribute type.
- 18
What is a table?
Model answer
A table is the physical representation of a relation used to organize data.
Explanation
Tables contain rows and columns and usually represent one entity type.
- 19
What are the older database terms file, record, and field equivalent to?
Model answer
A file is another name for a table, a record is another name for a row, and a field is another name for a column.
Explanation
These terms describe the same basic database structures using older terminology.
- 20
What is a value in a database table?
Model answer
A value is the specific piece of information stored in a cell or column for an entity.
Explanation
Examples include a person's name, an ID number, a phone number, or a date.
- 21
What is an entry?
Model answer
An entry is another name for a row created when data is entered into a table.
Explanation
An entry contains the values associated with one stored entity.
- 22
What is a schema?
Model answer
A schema is a description or drawing of how data is structured.
Explanation
A schema may show tables, columns, relationships, keys, and other structural elements.
- 23
What is data integrity?
Model answer
Data integrity means that database data is correct, consistent, current, and properly connected.
Explanation
Integrity problems include incorrect values, repeating data, outdated information, and broken table relationships.
- 24
What is an update anomaly?
Model answer
An update anomaly occurs when repeated copies of data do not all update consistently.
Explanation
For example, changing one copy of a person's phone number while another copy remains unchanged creates conflicting data.
- 25
What are the conceptual, logical, and physical levels of database design?
Model answer
They are increasingly specific levels that move from general ideas about relationships to an actual implementation.
Explanation
Conceptual design identifies relationships, logical design specifies tables and columns, and physical design addresses systems, servers, access, and implementation.
- 26
What is conceptual database design?
Model answer
Conceptual design describes how data is related without focusing on implementation limitations.
Explanation
It is the general brainstorming stage for identifying entities and their relationships.
- 27
What is logical database design?
Model answer
Logical design specifies tables, columns, data types, and relationships.
Explanation
At this level, the designer creates a detailed structural plan without yet implementing it on a particular server.
- 28
What is physical database design?
Model answer
Physical design implements the logical plan using a specific database system, server, access method, security setup, and application.
Explanation
It includes selecting the database management system, configuring storage, creating users and views, programming interfaces, and testing.
- 29
Why should a database usually separate information into multiple tables?
Model answer
Separating information reduces duplicated data and helps prevent integrity and update problems.
Explanation
Storing users, orders, and favorite items in one large table can force repeated values and inconsistent updates.
- 30
What is a database management system?
Model answer
A database management system, or DBMS, is software that manages stored data and lets users query, view, modify, and organize it.
Explanation
A DBMS provides functions beyond storage, such as searching, updating, deleting, and presenting data.
- 31
What is a relational database management system?
Model answer
An RDBMS is a DBMS designed specifically to manage relational databases and their related tables.
Explanation
It supports operations on tables, values, relationships, queries, views, and transactions.
- 32
What is a query?
Model answer
A query is a request that searches or operates on stored data and returns results.
Explanation
A query could find transactions before a date or identify users who have not been active recently.
- 33
What is a view mechanism?
Model answer
A view mechanism presents selected database data in a different surface-level arrangement without changing the underlying storage.
Explanation
Different users can receive different views of the same table, such as one view containing usernames and passwords and another containing IDs and emails.
- 34
How can views improve database security?
Model answer
Views restrict users to only the columns or rows they need to access.
Explanation
For example, website users may see their own account information while administrators can access broader records.
- 35
What is a transaction?
Model answer
A transaction is a group of database operations that either completes entirely or has no effect.
Explanation
During a money transfer, all required updates must succeed; if the process fails, the changes are canceled.
- 36
What is SQL?
Model answer
SQL is a programming language used to communicate with and manipulate relational databases.
Explanation
SQL acts as an intermediary between human instructions and database operations.
- 37
What is Data Definition Language?
Model answer
Data Definition Language, or DDL, defines database structures such as databases, tables, columns, and relationships.
Explanation
Commands such as CREATE are examples of DDL operations.
- 38
What is Data Manipulation Language?
Model answer
Data Manipulation Language, or DML, inserts, searches, updates, and deletes data within existing structures.
Explanation
Changing a user's username without changing the table structure is a DML operation.
- 39
What is a SQL keyword?
Model answer
A SQL keyword is a reserved word that has a predefined meaning in SQL.
Explanation
Words such as SELECT should not normally be used as user-defined table or column names because they may cause confusion or errors.
- 40
What is a join?
Model answer
A join combines related data from multiple tables into a new result or view.
Explanation
A join can combine a user's name from one table with that user's comments or purchases from another table.
- 41
Why are joins important in a normalized relational database?
Model answer
Joins allow data to remain separated for integrity and organization while still being presented together when needed.
Explanation
A normalized database may store users and comments separately but join them into a readable result.
- 42
What is a naming convention?
Model answer
A naming convention is a repeated pattern for naming database objects consistently.
Explanation
Examples include using lowercase names, underscores instead of spaces, and matching names for related key columns.
- 43
What is an atomic value?
Model answer
An atomic value contains one individual piece of information rather than multiple separate values.
Explanation
A full name may be separated into first, middle, and last names, while a word should not normally be split into individual letters.
- 44
Why might an address be divided into several columns?
Model answer
Separating street, city, state, and postal code makes each part individually searchable and supports more precise queries.
Explanation
A database could then find all users in a particular state or city.
- 45
Why should a column not contain multiple favorite movies in one value?
Model answer
A column should contain one value for one attribute, so multiple movies should be represented through a separate relationship or table.
Explanation
Storing several movies in one field violates the atomic-value principle.
- 46
What is a database relationship?
Model answer
A database relationship describes how two entities or tables are connected.
Explanation
Relationships allow a database to split information into manageable tables while preserving connections between them.
- 47
What is a one-to-one relationship?
Model answer
A one-to-one relationship means one entity is connected to exactly one entity of another type, and vice versa.
Explanation
A person and a generally unique social security number are examples of a one-to-one relationship.
- 48
What is a one-to-many relationship?
Model answer
A one-to-many relationship means one entity can be connected to many other entities, while each entity on the many side connects to one entity on the one side.
Explanation
One user can post many comments, but each individual comment belongs to one user.
- 49
What is a many-to-many relationship?
Model answer
A many-to-many relationship means many entities on one side can connect to many entities on the other side.
Explanation
A class can have many students, and a student can take many classes.
- 50
How is a one-to-one relationship usually stored?
Model answer
It is usually stored as an attribute or column in the same table.
Explanation
A username that belongs exclusively to one account can be stored as a column in the account table.
- 51
When might a one-to-one relationship use two tables?
Model answer
It may use two tables when the related entity has many additional attributes that should be stored separately.
Explanation
A card number may be stored with a cardholder, but card-specific details such as issue date and maximum amount belong in a card table.
- 52
How is a one-to-many relationship implemented?
Model answer
The table on the many side stores a foreign key that references the primary key of the one-side table.
Explanation
Each card row can contain the ID of its owner, allowing one user to own many cards.
- 53
Why can a many-to-many relationship not be stored directly in a relational table?
Model answer
Direct storage would require repeating columns or multiple values in one column, causing wasted space and violating atomicity.
Explanation
A student taking an unpredictable number of classes cannot be represented efficiently with fixed columns such as class one, class two, and class three.
- 54
What is an intermediary or junction table?
Model answer
It is a table that resolves a many-to-many relationship by storing foreign keys to both related tables.
Explanation
A student-class junction table can contain student ID and class ID for each enrollment.
- 55
What is a parent table in a parent-child relationship?
Model answer
The parent table contains the primary key that is referenced by a child table.
Explanation
A user table is the parent of a comments table when comments reference the user's ID.
- 56
What is a child table in a parent-child relationship?
Model answer
The child table contains a foreign key that points to the parent's primary key.
Explanation
The child depends on the parent for the referenced entity, such as a comment depending on its posting user.
- 57
What is a key in database design?
Model answer
A key is a column or group of columns used to identify rows uniquely or connect related tables.
Explanation
Keys support uniqueness, relationships, integrity, and efficient data access.
- 58
What are the three main requirements for a primary key?
Model answer
A primary key should be unique, never empty, and normally never change.
Explanation
These properties allow the key to identify one row consistently throughout the database.
- 59
What is a primary key?
Model answer
A primary key is the selected key that uniquely identifies each row in a table.
Explanation
A table has one primary key, although that key may consist of multiple columns.
- 60
What is a foreign key?
Model answer
A foreign key is a column that references a primary key, usually in another table.
Explanation
A comments table can use a user ID foreign key to identify the user who posted each comment.
- 61
What is a natural key?
Model answer
A natural key is a naturally occurring attribute that already has meaning in the stored data and can uniquely identify a row.
Explanation
A unique username or email address may serve as a natural key.
- 62
What is a surrogate key?
Model answer
A surrogate key is an artificial identifier, often an automatically generated number, added for database purposes.
Explanation
A surrogate ID has no intended real-world meaning and is commonly used to connect tables.
- 63
What is a super key?
Model answer
A super key is any set of one or more columns that uniquely identifies every row.
Explanation
A super key may contain more columns than are necessary to ensure uniqueness.
- 64
What is a candidate key?
Model answer
A candidate key is the smallest set of columns needed to uniquely identify every row.
Explanation
A table may have multiple candidate keys, such as a unique username and a unique email.
- 65
What is an alternate key?
Model answer
An alternate key is a candidate key that was not selected as the table's primary key.
Explanation
Alternate keys may still be enforced as unique or indexed for searching.
- 66
What is a simple key?
Model answer
A simple key consists of one column.
Explanation
A single user ID or username can be a simple key.
- 67
What is a composite key?
Model answer
A composite key consists of two or more columns whose combined values provide uniqueness.
Explanation
A combination such as first name, last name, and email can form a composite key.
- 68
What is a compound key in the terminology used here?
Model answer
A compound key is a multi-column key in which the component columns are themselves keys, commonly used in junction tables.
Explanation
A student ID and class ID can together identify a unique enrollment, while each also references another table.
- 69
What is referential integrity?
Model answer
Referential integrity ensures that foreign-key references remain valid and connected to existing parent records.
Explanation
A comment should not reference a user who does not exist unless the database rule explicitly handles that situation.
- 70
What does the NOT NULL constraint do?
Model answer
The NOT NULL constraint requires every row to contain a value in the specified column.
Explanation
Applying it to a foreign key makes the relationship mandatory for every row.
- 71
How do foreign-key constraints help maintain integrity?
Model answer
They prevent invalid references and specify what happens to child records when a parent is updated or deleted.
Explanation
Possible actions include restricting the change, cascading it to children, or setting the foreign-key value to null.
- 72
What does ON DELETE RESTRICT do?
Model answer
It prevents deletion of a parent when related child records exist and produces an error.
Explanation
This protects the database from leaving children that refer to a deleted parent.
- 73
What does ON DELETE CASCADE do?
Model answer
It automatically deletes related child records when the parent is deleted.
Explanation
Deleting a user can therefore delete all comments that belong to that user.
- 74
What does ON DELETE SET NULL do?
Model answer
It keeps the child row but changes its foreign-key value to null when the parent is deleted.
Explanation
This option requires the foreign-key column to allow null values.
- 75
What is a lookup table?
Model answer
A lookup table stores a fixed set of allowable options and is referenced by another table.
Explanation
A membership table can store options such as bronze, silver, and gold while member rows store only the corresponding key.
- 76
How does a lookup table reduce repeating data?
Model answer
It stores each option once and lets many records reference that single row through a foreign key.
Explanation
Changing the description of a membership type then requires updating only the lookup row.
- 77
What are the three main types of data integrity discussed?
Model answer
They are entity integrity, referential integrity, and domain integrity.
Explanation
They address uniqueness of entities, validity of relationships, and acceptable values in columns.
- 78
What is entity integrity?
Model answer
Entity integrity ensures that each entity is uniquely identifiable and that rows are not duplicated as the same entity.
Explanation
A primary key or ID distinguishes two people who might otherwise have the same name or phone number.
- 79
What is domain integrity?
Model answer
Domain integrity ensures that column values belong to the acceptable set or type of values for that column.
Explanation
A phone-number column should contain an appropriate numeric phone value rather than a word such as “cake.”
- 80
What is normalization?
Model answer
Normalization is a systematic process of organizing tables to reduce redundancy and prevent integrity problems.
Explanation
The main normal forms discussed are first normal form, second normal form, and third normal form.
- 81
What does first normal form require?
Model answer
First normal form requires atomic values and prevents multiple independent values from being stored in one field.
Explanation
Addresses may be separated into components, and multiple email addresses should be stored as separate related rows.
- 82
What is a partial dependency?
Model answer
A partial dependency occurs when a non-key column depends on only part of a composite primary key.
Explanation
Second normal form removes partial dependencies by moving attributes to the table representing the key they depend on.
- 83
What does second normal form require?
Model answer
Second normal form requires first normal form and the removal of partial dependencies.
Explanation
A table with a single-column primary key is already free of partial dependencies because the key has no smaller part.
- 84
What is a transitive dependency?
Model answer
A transitive dependency occurs when a column depends on another non-key column that itself depends on the primary key.
Explanation
A star meaning may depend on a star rating, while the star rating depends on the review ID.
- 85
What does third normal form require?
Model answer
Third normal form requires second normal form and the removal of transitive dependencies.
Explanation
The dependent columns are moved to another table and referenced through a foreign key.
- 86
What is an index?
Model answer
An index is a data structure that helps a database locate rows more efficiently.
Explanation
Like a book index, it avoids searching every record when a query looks for a particular value.
- 87
What is a table scan?
Model answer
A table scan checks rows throughout a table to find matching data.
Explanation
Scanning millions of rows can be slow when no useful index is available.
- 88
What is an index seek?
Model answer
An index seek uses an index to go directly to the relevant part of the data.
Explanation
An index can locate a specific user ID without examining every row.
- 89
What is a clustered index?
Model answer
A clustered index organizes the actual table data according to the indexed values.
Explanation
Because the data can be physically organized in only one primary order, a table generally has only one clustered index.
- 90
What is a nonclustered index?
Model answer
A nonclustered index is a separate structure that points to the locations of matching data.
Explanation
A table can have multiple nonclustered indexes because they do not determine the table's single physical order.
- 91
What is a composite index?
Model answer
A composite index is an index built from two or more columns.
Explanation
An index on last name and first name can support searches using both columns and, in some systems, the leftmost column alone.
- 92
What is a disadvantage of indexes?
Model answer
Indexes improve searches but require additional storage and must be updated when the underlying data changes.
Explanation
Extra indexes can slow inserts, updates, and deletes if they are not useful.
- 93
What are the three broad database data-type categories?
Model answer
The three broad categories are string, numeric, and date/time.
Explanation
Specific names vary among database systems, but these general categories are widely used.
- 94
What is a string data type?
Model answer
A string stores characters or text.
Explanation
A value such as a word or a number enclosed as text is treated as a string rather than a numeric quantity.
- 95
What is the difference between CHAR and VARCHAR?
Model answer
CHAR stores a fixed-length character value, while VARCHAR stores a variable-length character value.
Explanation
A fixed-length field may reserve unused character positions, whereas a variable-length field uses a length appropriate to the stored value.
- 96
What is an integer data type?
Model answer
An integer stores whole numbers without fractional parts.
Explanation
Examples include positive or negative whole numbers such as 512 or −52.
- 97
What is the difference between signed and unsigned numeric data?
Model answer
Unsigned values cannot be negative, while signed values can be positive or negative.
Explanation
Choosing unsigned is useful when a value cannot logically fall below zero.
- 98
Why can decimal values be preferable to floating-point values when exactness matters?
Model answer
Decimal values represent base-ten quantities more directly, while binary floating-point values may approximate some decimal fractions.
Explanation
A value such as 0.1 cannot be represented exactly in a binary fraction system.
- 99
What is a timestamp?
Model answer
A timestamp records the time at which an event or database operation occurred.
Explanation
It can record when a row was created, a transaction occurred, or a value was updated.
- 100
What is an inner join?
Model answer
An inner join returns only rows that have matching related values in both joined tables.
Explanation
Customers without cards and cards without customers are excluded from an inner-join result.
- 101
What is a left outer join?
Model answer
A left outer join returns every row from the left table and matching rows from the right table.
Explanation
Rows on the left without a match are still included, with missing right-side values represented as null where allowed.
- 102
What is a right outer join?
Model answer
A right outer join returns every row from the right table and matching rows from the left table.
Explanation
It is functionally similar to reversing the table order and using a left outer join.
- 103
What is a full outer join?
Model answer
A full outer join returns all rows from both tables, matching related rows where possible.
Explanation
Rows without a match on either side are retained with missing values on the opposite side.
- 104
How does an inner join across three tables work?
Model answer
It joins the first two tables and then joins that result with the third table using another join condition.
Explanation
Each additional inner join can reduce the result because rows must satisfy all relationship conditions.
- 105
What is an alias in SQL?
Model answer
An alias is a temporary alternate name assigned to a table or column.
Explanation
Aliases can make queries shorter, distinguish multiple uses of one table, and produce more readable result headings.
- 106
What is a self join?
Model answer
A self join joins a table to itself using different aliases for the two roles.
Explanation
A user table can be self-joined to replace a referrer's ID with the referrer's name or email.
- 107
What is the purpose of the ON clause in a join?
Model answer
The ON clause specifies how rows in the joined tables are related.
Explanation
A common condition compares a foreign-key column with the corresponding primary-key column.
- 108
How can a join improve the presentation of normalized data?
Model answer
A join combines separated, normalized data into a readable result for users or applications without changing the stored structure.
Explanation
For example, it can replace a numeric user ID in a comment record with the user's actual username.

Ask anything
We've read this whole study set, so questions about it get the best answers.