ch9 questions Flashcards

1
Q

What does the word relationship mean in reference to a relational database?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the term for the process of removing duplicate data and optimizing tables?

A

Normalization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the three rules of the First Normal Form?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you make a table satisfy the Second Normal Form?

A

To satisfy Second Normal Form, columns whose data repeats across multiple rows should be removed to their own tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do you put in a column to tie together two tables that contain items having a one-to-many relationship?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you create a database with a many-to-many relationship?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What commands initiate and end a MySQL transaction?

A

BEGIN and COMMIT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What feature does MySQL provide to enable you to examine how a query will work in detail?

A

EXPLAIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command would you use to back up the database publications to a file called publications.sql?

A

mysqldump -u user -ppassword -D publications > publications.sql

How well did you know this?
1
Not at all
2
3
4
5
Perfectly