Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Databases, SQL, Normalization

Databases, SQL, Normalization

Taylor Caldwell

February 22, 2016
Tweet

Other Decks in Technology

Transcript

  1. A COLLECTION OF INFORMATION THAT IS ORGANIZED SO THAT IT

    CAN EASILY BE ACCESSED, MANAGED, AND UPDATED. WhatIs.com DEFINITION
  2. TYPES OF DATABASE MANAGEMENT SYSTEMS RELATIONAL (SQL) ▸ Oracle ▸

    MySQL ▸ Microsoft SQL Server ▸ PostgreSQL ▸ IBM DB2 ▸ SQLite
  3. TYPES OF DATABASE MANAGEMENT SYSTEMS NON-RELATIONAL (‘NOSQL’) ▸ Column: Accumulo,

    Cassandra ▸ Document: Couchbase, MongoDB ▸ Key-value: CouchDB, Dynamo, Redis ▸ Graph: AllegroGraph, Virtuoso, InfiniteGraph ▸ Multi-model: MarkLogic, OrientDB
  4. BASICS OF SQL - MANAGING YOUR DATA RETRIEVING, ADDING, CHANGING,

    REMOVING. ▸ SQL is equipped with data manipulation language (DML). DML modifies the database instance by inserting, updating and deleting its data. ▸ SQL contains the following set of commands in its DML section − ▸ SELECT/FROM/WHERE ▸ INSERT INTO/VALUES ▸ UPDATE/SET/WHERE ▸ DELETE FROM/WHERE
  5. BASICS OF SQL - RETRIEVING DATA SELECT/FROM/WHERE ▸ SELECT -

    Fundamental query command of SQL. Selects columns based on the condition described by WHERE clause. ▸ FROM - This clause takes a table/relation name as an argument from which columns are to be selected. ▸ WHERE - This clause defines conditions which must match in order to qualify the columns to be selected.
  6. BASICS OF SQL - RETRIEVING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 Movie SELECT title, genre FROM Movie;
  7. BASICS OF SQL - RETRIEVING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 title genre Metropolis Sci-Fi Nosferatu Horror The Kid Comedy The Gold Rush Adventure Movie SELECT title, genre FROM Movie;
  8. BASICS OF SQL - RETRIEVING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 Movie SELECT title, genre FROM Movie WHERE id = 3;
  9. BASICS OF SQL - RETRIEVING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 title genre The Kid Comedy Movie SELECT title, genre FROM Movie WHERE id = 3;
  10. BASICS OF SQL - RETRIEVING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 Movie SELECT * FROM Movie WHERE id = 3;
  11. BASICS OF SQL - RETRIEVING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 id title genre duration 3 The Kid Comedy 68 Movie SELECT * FROM Movie WHERE id = 3;
  12. BASICS OF SQL - ADDING DATA INSERT INTO/VALUES ▸ Used

    for inserting values into the rows of a table (relation).
 ▸ INSERT INTO table (column1, column2, column3 ... ) VALUES (value1, value2, value3 …)
 ▸ INSERT INTO table VALUES (value1, value2, ... )
  13. BASICS OF SQL - ADDING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 Movie INSERT INTO Movie VALUES (4, “The Gold Rush”, “Adventure”, 95);
  14. BASICS OF SQL - ADDING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 Movie INSERT INTO Movie VALUES (4, “The Gold Rush”, “Adventure”, 95); id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95
  15. BASICS OF SQL - ADDING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 Movie INSERT INTO Movie (duration, title, genre, id) VALUES (95, “The Gold Rush”, “Adventure”, 4);
  16. BASICS OF SQL - ADDING DATA id title genre duration

    1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 Movie INSERT INTO Movie (duration, title, genre, id) VALUES (95, “The Gold Rush”, “Adventure”, 4); id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95
  17. BASICS OF SQL - CHANGING DATA UPDATE/SET/WHERE ▸ Used for

    updating or modifying the values of columns in a table (relation).
 ▸ UPDATE table_name SET column_name = value [, column_name = value ...] [WHERE condition]
  18. BASICS OF SQL - CHANGING DATA Movie UPDATE Movie SET

    genre = “Romance” WHERE id = 1 OR id = 3; id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95
  19. BASICS OF SQL - CHANGING DATA Movie UPDATE Movie SET

    genre = “Romance” WHERE id = 1 OR id = 3; id title genre duration 1 Metropolis Romance 153 2 Nosferatu Horror 94 3 The Kid Romance 68 4 The Gold Rush Adventure 95 id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95
  20. BASICS OF SQL - REMOVING DATA DELETE FROM/WHERE ▸ Used

    for removing one or more rows from a table (relation).
 ▸ DELETE FROM table_name [WHERE condition];
  21. BASICS OF SQL - REMOVING DATA Movie DELETE FROM Movie

    WHERE id = 3; id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95
  22. BASICS OF SQL - REMOVING DATA Movie DELETE FROM Movie

    WHERE id = 3; id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 3 The Kid Comedy 68 4 The Gold Rush Adventure 95 id title genre duration 1 Metropolis Sci-Fi 153 2 Nosferatu Horror 94 4 The Gold Rush Adventure 95
  23. BASICS OF SQL - OPERATORS ARITHMETIC OPERATORS + Addition -

    Adds values on either side of the operator - Subtraction - Subtracts right hand operand from left hand operand * Multiplication - Multiplies values on either side of the operator / Division - Divides left hand operand by right hand operand % Modulus - Divides left hand operand by right hand operand and returns remainder
  24. BASICS OF SQL - OPERATORS COMPARISON OPERATORS = Checks if

    the values of two operands are equal or not, if yes then condition becomes true. != Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. <> Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. > Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. < Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. >= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. <= Checks if the value of left operand is less than or equal to the value of
  25. BASICS OF SQL - OPERATORS LOGICAL OPERATORS ALL Used to

    compare a value to all values in another value set. AND Allows the existence of multiple conditions in an SQL statement's WHERE clause. BETWEEN Used to search for values that are within a set of values, given the minimum value and the maximum value. IN Used to compare a value to a list of literal values that have been specified. LIKE Used to compare a value to similar values using wildcard operators. NOT Reverses the meaning of the logical operator with which it is used. Eg: NOT BETWEEN, NOT IN, etc. This is a negate operator. OR Used to combine multiple conditions in an SQL statement's WHERE clause. IS NULL Used to compare a value with a NULL value. UNIQUE Searches every row of a specified table for uniqueness (no duplicates).
  26. HOW CAN I CREATE, DELETE, AND MANIPULATE MY OWN DATABASE

    AND TABLES? Random Person BASICS OF SQL
  27. BASICS OF SQL - MANAGING YOUR DATABASES AND TABLES CREATING

    AND DROPPING. ▸ SQL is equipped with data definition language (DDL) to define database schema. SQL contains the following set of commands in its DDL section − ▸ CREATE ▸ DROP ▸ ALTER (We’ll skip this for now…)
  28. BASICS OF SQL - CREATE CREATE ▸ Creates new databases,

    and tables from RDBMS. ▸ The syntax for creating a database is pretty simple… ▸ CREATE DATABASE DatabaseName; ▸ To create a table, we need to first learn about Data Types and Constraints.
  29. BASICS OF SQL - DATA TYPES NUMERIC DATA TYPES Data

    Type From To bigint -9,223,372,036,854,7 75,808 9,223,372,036,854,7 75,807 int -2,147,483,648 2,147,483,647 smallint -32,768 32,767 tinyint 0 255 decimal -10^38 +1 10^38 -1 float -1.79E+308 1.79E+308 real -3.40E+38 3.40E+38
  30. BASICS OF SQL - DATA TYPES DATE AND TIME DATA

    TYPES Data Type From To datetime Jan 1, 1753 Dec 31, 9999 smalldatetime Jan 1, 1900 Jun 6, 2079 date Stores a date like June 30, 1991 time Stores a time of day like 12:30 P.M.
  31. BASICS OF SQL - DATA TYPES CHARACTER STRING DATA TYPES

    Data Type Description char Maximum length of 8,000 characters.( Fixed length non- Unicode characters) varchar Maximum of 8,000 characters. (Variable-length non-Unicode data). text Variable-length non-Unicode data with a maximum length of 2,147,483,647 characters.
  32. BASICS OF SQL - DATA TYPES BINARY DATA TYPES Data

    Type Description binary Maximum length of 8,000 bytes(Fixed-length binary data ) varbinary Maximum length of 8,000 bytes.(Variable length binary data) image Maximum length of 2,147,483,647 bytes. ( Variable length Binary Data)
  33. BASICS OF SQL - DATA CONSTRAINTS CONSTRAINTS ▸ Constraints are

    the rules enforced on data columns on table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
  34. BASICS OF SQL - DATA CONSTRAINTS LIST OF CONSTRAINTS ▸

    NOT NULL: Ensures that a column cannot have NULL value. ▸ DEFAULT: Provides a default value for a column when none is specified. ▸ UNIQUE: Ensures that all values in a column are different. ▸ PRIMARY Key: Uniquely identified each rows/records in a database table. ▸ FOREIGN Key: Uniquely identified a rows/records in any another database table. ▸ CHECK: Ensures that all values in a column satisfy certain conditions.
  35. BASICS OF SQL - CREATE TABLE BACK TO CREATING TABLES…

    ▸ The syntax for creating a table:
 
 CREATE TABLE table_name(
 column1 datatype,
 column2 datatype,
 column3 datatype,
 .....
 columnN datatype,
 PRIMARY KEY( one or more columns )
 );
  36. BASICS OF SQL - CREATE TABLE CREATING TABLES… ▸ An

    example of how to create a table:
 
 CREATE TABLE CUSTOMERS(
 ID INT NOT NULL,
 NAME VARCHAR (20) NOT NULL,
 AGE INT NOT NULL,
 ADDRESS CHAR (25) ,
 SALARY DECIMAL (18, 2), 
 PRIMARY KEY (ID)
 );
  37. BASICS OF SQL - CREATE TABLE CREATING TABLES… ▸ An

    example of how to create a table:
 
 CREATE TABLE CUSTOMERS(
 ID INT NOT NULL,
 NAME VARCHAR (20) NOT NULL,
 AGE INT NOT NULL,
 ADDRESS CHAR (25) ,
 SALARY DECIMAL (18, 2), 
 PRIMARY KEY (ID)
 );
  38. BASICS OF SQL - CREATE TABLE CREATING TABLES… ▸ An

    example of how to create a table:
 
 CREATE TABLE CUSTOMERS(
 ID INT NOT NULL,
 NAME VARCHAR (20) NOT NULL,
 AGE INT NOT NULL,
 ADDRESS CHAR (25) ,
 SALARY DECIMAL (18, 2), 
 PRIMARY KEY (ID)
 );
  39. BASICS OF SQL - CREATE TABLE CREATING TABLES… ▸ An

    example of how to create a table:
 
 CREATE TABLE CUSTOMERS(
 ID INT NOT NULL,
 NAME VARCHAR (20) NOT NULL,
 AGE INT NOT NULL,
 ADDRESS CHAR (25) ,
 SALARY DECIMAL (18, 2), 
 PRIMARY KEY (ID)
 );
  40. BASICS OF SQL - DROP DROP ▸ Drops databases, and

    tables from RDBMS. ▸ To drop a database - ▸ DROP DATABASE DatabaseName; ▸ To drop a table - ▸ DROP TABLE TableName;
  41. BASICS OF SQL - AGGREGATE FUNCTIONS AGGREGATE FUNCTIONS ▸ SQL

    aggregate functions return a single value, calculated from values in a column. ▸ AVG() - Returns the average value ▸ COUNT() - Returns the number of rows ▸ FIRST() - Returns the first value ▸ LAST() - Returns the last value ▸ MAX() - Returns the largest value ▸ MIN() - Returns the smallest value ▸ SUM() - Returns the sum
  42. BASICS OF SQL - AGGREGATE FUNCTIONS AGGREGATE FUNCTIONS ▸ SQL

    aggregate functions return a single value, calculated from values in a column. ▸ AVG() - Returns the average value ▸ COUNT() - Returns the number of rows ▸ FIRST() - Returns the first value ▸ LAST() - Returns the last value ▸ MAX() - Returns the largest value ▸ MIN() - Returns the smallest value ▸ SUM() - Returns the sum
  43. BASICS OF SQL - AGGREGATE FUNCTIONS GROUP BY ▸ The

    GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns. ▸ Example syntax -
 SELECT column_name, aggregate_function(column_name)
 FROM table_name
 GROUP BY column_name;
  44. BASICS OF SQL - AGGREGATE FUNCTIONS id name age salary

    1 Bob 18 30,000.00 2 John 21 35,000.00 3 John 23 45,000.00 4 Matty 30 20,000.00 5 Matty 32 50,000.00 6 William 27 50,000.00 Person SELECT name, SUM(salary) FROM Person GROUP BY name;
  45. BASICS OF SQL - AGGREGATE FUNCTIONS id name age salary

    1 Bob 18 30,000.00 2 John 21 35,000.00 3 John 23 45,000.00 4 Matty 30 20,000.00 5 Matty 32 50,000.00 6 William 27 50,000.00 Person SELECT name, SUM(salary) FROM Person GROUP BY name; name salary Bob 30,000.00 John 80,000.00 Matty 70,000.00 William 50,000.00
  46. BASICS OF SQL - JOINS JOINS ▸ The SQL Joins

    clause is used to combine records from two or more tables in a database. A JOIN is a means for combining fields from two tables by using values common to each.
  47. BASICS OF SQL - JOINS JOIN TYPES ▸ INNER JOIN:

    returns rows when there is a match in both tables. ▸ LEFT JOIN: returns all rows from the left table, even if there are no matches in the right table. ▸ RIGHT JOIN: returns all rows from the right table, even if there are no matches in the left table. ▸ FULL JOIN: returns rows when there is a match in one of the tables. ▸ SELF JOIN: is used to join a table to itself as if the table were two tables, temporarily renaming at least one table in the SQL statement. ▸ CARTESIAN JOIN: returns the Cartesian product of the sets of records from the two or more joined tables.
  48. BASICS OF SQL - JOINS JOIN TYPES ▸ INNER JOIN:

    returns rows when there is a match in both tables. ▸ LEFT JOIN: returns all rows from the left table, even if there are no matches in the right table. ▸ RIGHT JOIN: returns all rows from the right table, even if there are no matches in the left table. ▸ FULL JOIN: returns rows when there is a match in one of the tables. ▸ SELF JOIN: is used to join a table to itself as if the table were two tables, temporarily renaming at least one table in the SQL statement. ▸ CARTESIAN JOIN: returns the Cartesian product of the sets of records from the two or more joined tables.
  49. BASICS OF SQL - JOINS INNER JOIN ▸ The INNER

    JOIN keyword selects all rows from both tables as long as there is a match between the columns in both tables. ▸ SELECT column_name(s)
 FROM table1
 INNER JOIN table2
 ON table1.column_name=table2.column_name;
  50. BASICS OF SQL - JOINS id name 1 Bob 2

    John 3 Matty 4 William Person SELECT name, model_name FROM Person INNER JOIN Phone ON Person.id = Phone.owner_id; phone_id model_name owner_id 1 iPhone 3 2 Android 2 3 iPhone 2 4 Windows 4 Phone
  51. BASICS OF SQL - JOINS name model_name Matty iPhone John

    Android John iPhone William Windows SELECT name, model_name FROM Person INNER JOIN Phone ON Person.id = Phone.owner_id;
  52. BASICS OF SQL - JOINS id name age salary 1

    Bob 18 30,000.00 2 John 21 35,000.00 3 Matty 32 50,000.00 4 William 27 50,000.00 Person SELECT id, name, amount, date FROM Person INNER JOIN Order ON Person.id = Order.person_id; order_id date amount person_id 101 2009-10-08 3,000 3 102 2009-10-08 1,500 2 103 2009-11-20 2,000 2 104 2008-05-20 2,500 4 Order
  53. BASICS OF SQL - JOINS SELECT id, name, amount, date

    FROM Person INNER JOIN Order ON Person.id = Order.person_id; id name amount date 3 Matty 3,000 2009-10-08 2 John 1,500 2009-10-08 2 John 2,000 2009-11-20 4 William 2,500 2008-05-20
  54. BASICS OF SQL - JOINS LEFT JOIN ▸ The LEFT

    JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match. ▸ SELECT column_name(s)
 FROM table1
 LEFT JOIN table2
 ON table1.column_name=table2.column_name; ▸ *Note - In some databases, LEFT JOIN is called LEFT OUTER JOIN.
  55. BASICS OF SQL - JOINS id name 1 Bob 2

    John 3 Matty 4 William Person SELECT name, model_name FROM Person LEFT JOIN Phone ON Person.id = Phone.owner_id; phone_id model_name owner_id 1 iPhone 3 2 Android 2 3 iPhone 2 4 Windows 4 Phone
  56. BASICS OF SQL - JOINS name model_name Bob NULL John

    Android John iPhone Matty iPhone William Windows SELECT name, model_name FROM Person LEFT JOIN Phone ON Person.id = Phone.owner_id;
  57. BASICS OF SQL - JOINS RIGHT JOIN ▸ The RIGHT

    JOIN keyword returns all rows from the right table (table2), with the matching rows in the left table (table1). The result is NULL in the left side when there is no match. ▸ SELECT column_name(s)
 FROM table1
 RIGHT JOIN table2
 ON table1.column_name=table2.column_name; ▸ *Note - In some databases, RIGHT JOIN is called RIGHT OUTER JOIN.
  58. BASICS OF SQL - JOINS id name 1 Bob 2

    John 3 Matty 4 William Person SELECT name, model_name FROM Person RIGHT JOIN Phone ON Person.id = Phone.owner_id; phone_id model_name owner_id 1 iPhone 3 2 Android 3 3 iPhone 4 4 Windows 5 5 Android 6 Phone
  59. BASICS OF SQL - JOINS name model_name Matty iPhone Matty

    Android William iPhone NULL Windows NULL Android SELECT name, model_name FROM Person RIGHT JOIN Phone ON Person.id = Phone.owner_id;
  60. BASICS OF SQL - JOINS FULL JOIN ▸ The FULL

    OUTER JOIN keyword returns all rows from the left table (table1) and from the right table (table2). ▸ The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins. ▸ SELECT column_name(s)
 FROM table1
 FULL JOIN table2
 ON table1.column_name=table2.column_name; ▸ *Note - In some databases, FULL JOIN is called FULL OUTER JOIN.
  61. BASICS OF SQL - JOINS id name 1 Bob 2

    John 3 Matty 4 William Person SELECT name, model_name FROM Person FULL JOIN Phone ON Person.id = Phone.owner_id; phone_id model_name owner_id 1 iPhone 3 2 Android 3 3 iPhone 4 4 Windows 5 5 Android 6 Phone
  62. BASICS OF SQL - JOINS SELECT name, model_name FROM Person

    FULL JOIN Phone ON Person.id = Phone.owner_id; name model_name Bob NULL John NULL Matty iPhone Matty Android William iPhone NULL Windows NULL Android
  63. NORMALIZATION NORMALIZATION ▸ Normalization is the process of organizing data

    in a database. This includes creating tables and establishing relationships between those tables according to rules designed both to protect the data and to make the database more flexible by eliminating redundancy and inconsistent dependency. ▸ Redundant data wastes disk space and creates maintenance problems. If data that exists in more than one place must be changed, the data must be changed in exactly the same way in all locations. A customer address change is much easier to implement if that data is stored only in the Customers table and nowhere else in the database.
  64. NORMALIZATION INCONSISTENT DEPENDENCIES ▸ What is an "inconsistent dependency"? While

    it is intuitive for a user to look in the Customers table for the address of a particular customer, it may not make sense to look there for the salary of the employee who calls on that customer. The employee's salary is related to, or dependent on, the employee and thus should be moved to the Employees table. Inconsistent dependencies can make data difficult to access because the path to find the data may be missing or broken.
  65. NORMALIZATION NORMAL FORMS ▸ There are a few rules for

    database normalization. Each rule is called a "normal form." If the first rule is observed, the database is said to be in "first normal form." If the first three rules are observed, the database is considered to be in "third normal form." Although other levels of normalization are possible, third normal form is considered the highest level necessary for most applications.
  66. NORMALIZATION FIRST NORMAL FORM - NO REPEATING GROUPS ▸ Eliminate

    repeating groups in individual tables. ▸ Create a separate table for each set of related data. ▸ Identify each set of related data with a primary key. ▸ Do not use multiple fields in a single table to store similar data. ▸ Adding more fields is not the answer; it requires program and table modifications.
  67. NORMALIZATION FIRST NORMAL FORM - NO REPEATING GROUPS Student# Advisor

    Adv-Room Class1 Class2 Class3 1022 Jones 412 101-07 143-01 159-02 4123 Smith 216 201-01 211-02 214-01
  68. NORMALIZATION FIRST NORMAL FORM - NO REPEATING GROUPS Student# Advisor

    Adv-Room Class# 1022 Jones 412 101-07 1022 Jones 412 143-01 1022 Jones 412 159—02 4123 Smith 216 201-01 4123 Smith 216 211-02 4123 Smith 216 214-01
  69. NORMALIZATION SECOND NORMAL FORM - ELIMINATE REDUNDANT DATA ▸ Create

    separate tables for sets of values that apply to multiple records. ▸ Relate these tables with a foreign key. ▸ Records should not depend on anything other than a table's primary key (a compound key, if necessary).
  70. NORMALIZATION SECOND NORMAL FORM - ELIMINATE REDUNDANT DATA Student# Advisor

    Adv-Room 1022 Jones 412 4123 Smith 216 Student# Class# 1022 101-07 1022 143-01 1022 159—02 4123 201-01 4123 211-02 4123 214-01 Students Registration
  71. NORMALIZATION THIRD NORMAL FORM - ELIMINATE REDUNDANT DATA NOT DEPENDENT

    ON KEY ▸ Eliminate fields that do not depend on the key. ▸ Values in a record that are not part of that record's key do not belong in the table. ▸ In general, any time the contents of a group of fields may apply to more than a single record in the table, consider placing those fields in a separate table.
  72. NORMALIZATION THIRD NORMAL FORM - ELIMINATE REDUNDANT DATA NOT DEPENDENT

    ON KEY Student# Advisor 1022 Jones 4123 Smith Student# Class# 1022 101-07 1022 143-01 1022 159—02 4123 201-01 4123 211-02 4123 214-01 Students Registration Advisor Room Dept Jones 412 42 Smith 216 42 Faculty