Hour 4, The Normalization Process

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Appendix C.  Answers to Quizzes and Exercises


Hour 4, "The Normalization Process"

Quiz Answers

1:

True or false: Normalization is the process of grouping data into logical related groups.

A1:

True.

2:

True or false: Having no duplicate or redundant data in a database, and having everything in the database normalized, is always the best way to go.

A2:

False. Not always; normalization can and does slow performance because more tables must be joined which results in more I/O and CPU time.

3:

True or false: If data is in the third normal form, it is automatically in the first and second normal forms.

A3:

True.

4:

What is a major advantage of a denormalized database versus a normalized database?

A4:

Improved performance.

5:

What are some major disadvantages of denormalization?

A5:

Having redundant and duplicate data takes up valuable space; it is harder to code, and much more data maintenance is required.

Exercise Answers

1:

You are developing a new database for a small company. Take the following data and normalize it. Keep in mind that there would be many more items for a small company than you are given here.

Employees:

Angela Smith, secretary, 317-545-6789, RR 1 Box 73, Greensburg, Indiana, 47890, $9.50 hour, date started January 22, 1996, SSN is 323149669.

Jack Lee Nelson, salesman , 3334 N Main St, Brownsburg, IN, 45687, 317-852-9901, salary of $35,000.00 year, SSN is 312567342, date started 10/28/95.

Customers:

Robert's Games and Things, 5612 Lafayette Rd, Indianapolis, IN, 46224, 317-291-7888, customer ID is 432A.

Reed's Dairy Bar, 4556 W 10th St, Indianapolis, IN, 46245, 317-271-9823, customer ID is 117A.

Customer Orders:

Customer ID is 117A, date of last order is December 20, 1999, product ordered was napkins and the product ID is 661.

A1:

Employees

Customers

Orders

SSN

CUSTOMER ID

CUSTOMER ID

NAME

NAME

PRODUCT ID

STREET ADDRESS

STREET ADDRESS

PRODUCT

CITY

CITY

DATE ORDERED

STATE

STATE

 

ZIP

ZIP

 

PHONE NUMBER

PHONE NUMBER

 

SALARY

   

HOURLY PAY

   

START DATE

   

POSITION

   
2:

Navigate to the folder on your computer where you installed MySQL, and then to the bin folder. Double-click on the mysql.exe executable to invoke MySQL. Then type the following at the command prompt to use your database:

  use learnsql;  
3:

At the mysql> prompt, enter CREATE TABLE statements based on the tables you defined in Exercise 1.


Team-Fly    
Top
 


Sams Teach Yourself SQL in 24 Hours
Sams Teach Yourself SQL in 24 Hours (5th Edition) (Sams Teach Yourself -- Hours)
ISBN: 0672335417
EAN: 2147483647
Year: 2002
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net