Jump to content

Normalizing Tables


Recommended Posts

OK, so I'm in the process of creating tables for my database. In my example I have a field for book title, book author, book genre, book release date, book language, book publisher, book excerpt, book added by (who added it to the system) and date added. Below is the initial tables query I cam up with (some tables have not been added yet).Can someone take a look at it and tell me how to go through at least the second and third normalization? And can someone explain what the fourth and fifth normalization are? Most beginning SQL books don't really go into it.

CREATE TABLE users (user_id INT NOT NULL AUTO_INCREMENT,user_name VARCHAR(150),first_name VARCHAR(150),last_name VARCHAR(150),email VARCHAR(150),password VARCHAR(150),access INT NOT NULL,PRIMARY KEY (user_id));CREATE TABLE books (book_id INT NOT NULL AUTO_INCREMENT,book_title VARCHAR(150),author_id INT NOT NULL,genre_id INT NOT NULL,language_id INT NOT NULL,release_year_id INT NOT NULL,excerpt text,PRIMARY KEY (song_id));CREATE TABLE authors (author_id INT NOT NULL AUTO_INCREMENT,author VARCHAR(150) NOT NULL,PRIMARY KEY (author_id));CREATE TABLE genre (genre_id INT NOT NULL AUTO_INCREMENT,genre VARCHAR(150),PRIMARY KEY (genre_id));CREATE TABLE languages (language_id INT NOT NULL AUTO_INCREMENT,language VARCHAR(150),PRIMARY KEY (language_id));CREATE TABLE releaseyear (release_year_id INT NOT NULL AUTO_INCREMENT,release_year INT(4),PRIMARY KEY (release_year_id));

Thanks. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...