ch9 questions Flashcards
What does the word relationship mean in reference to a relational database?
The term relationship refers to the connection between two pieces of data that have some association, such as a book and its author, or a book and the customer who bought the book. A relational database such as MySQL specializes in storing and retrieving such relations.
What is the term for the process of removing duplicate data and optimizing tables?
Normalization
What are the three rules of the First Normal Form?
The three rules of the First Normal Form are:
- There should be no repeating columns containing the same kind of data.
- All columns should contain a single value.
- There should be a primary key to uniquely identify each row.
How do you make a table satisfy the Second Normal Form?
To satisfy Second Normal Form, columns whose data repeats across multiple rows should be removed to their own tables.
What do you put in a column to tie together two tables that contain items having a one-to-many relationship?
In a one-to-many relationship, the primary key from the table on the “one” side must be added as a separate column (a foreign key) to the table on the “many” side.
How can you create a database with a many-to-many relationship?
To create a database with many-to-many relationship, you create an intermediary table containing keys from two other tables. The other tables can then reference each other via the third.
What commands initiate and end a MySQL transaction?
BEGIN and COMMIT
What feature does MySQL provide to enable you to examine how a query will work in detail?
EXPLAIN
What command would you use to back up the database publications to a file called publications.sql?
mysqldump -u user -ppassword -D publications > publications.sql