SlideShare a Scribd company logo
1 of 65
Normalization & SQL using
Oracle
Course:-BSC CS-II
Subject:-Database Management System
Unit:-4
 This is the process which allows you to winnow out
redundant data within your database.
 This involves restructuring the tables to successively
meeting higher forms of Normalization.
 A properly normalized database should have the
following characteristics
 Scalar values in each fields
 Absence of redundancy.
 Minimal use of null values.
 Minimal loss of information.
Definition
 Levels of normalization based on the amount of
redundancy in the database.
 Various levels of normalization are:
 First Normal Form (1NF)
 Second Normal Form (2NF)
 Third Normal Form (3NF)
 Boyce-Codd Normal Form (BCNF)
 Fourth Normal Form (4NF)
 Fifth Normal Form (5NF)
 Domain Key Normal Form (DKNF)
Levels of Normalization
Redundancy
NumberofTables
 Most databases should be 3NF or BCNF in order to avoid
the database anomalies.
 Most databases should be 3NF or BCNF in order to avoid
the database anomalies.
Complexity
Levels of Normalization
Each higher level is a subset of the lower level
DKNF
1NF
2NF
3NF
4NF
5NF
A table is considered to be in 1NF if all the fields contain
only scalar values (as opposed to list of values).
Example (Not 1NF)
First Normal Form (1NF)
Author and AuPhone columns are not scalarAuthor and AuPhone columns are not scalar
0-321-32132-1 Balloon Sleepy,
Snoopy,
Grumpy
321-321-1111,
232-234-1234,
665-235-6532
Small House 714-000-0000 $34.00
0-55-123456-9 Main Street Jones,
Smith
123-333-3333,
654-223-3455
Small House 714-000-0000 $22.95
0-123-45678-0 Ulysses Joyce 666-666-6666 Alpha Press 999-999-9999 $34.00
1-22-233700-0 Visual
Basic
Roman 444-444-4444 Big House 123-456-7890 $25.00
ISBN Title AuName AuPhone PubName PubPhone Price
1. Place all items that appear in the repeating group in a new table
2. Designate a primary key for each new table produced.
3. Duplicate in the new table the primary key of the table from
which the repeating group was extracted or vice versa.
Example (1NF)
1NF - Decomposition
0-321-32132-1 Balloon Small House 714-000-0000 $34.00
0-55-123456-9 Main Street Small House 714-000-0000 $22.95
0-123-45678-0 Ulysses Alpha Press 999-999-9999 $34.00
1-22-233700-0 Visual
Basic
Big House 123-456-7890 $25.00
ISBN Title PubName PubPhone Price
ISBN AuName AuPhone
0-123-45678-0 Joyce 666-666-6666
1-22-233700-0 Roman 444-444-4444
0-55-123456-9 Smith 654-223-3455
0-55-123456-9 Jones 123-333-3333
0-321-32132-1 Grumpy 665-235-6532
0-321-32132-1 Snoopy 232-234-1234
0-321-32132-1 Sleepy 321-321-1111
1. If one set of attributes in a table determines
another set of attributes in the table, then the
second set of attributes is said to be functionally
dependent on the first set of attributes.
Example 1
Functional Dependencies
0-321-32132-1 Balloon $34.00
0-55-123456-9 Main Street $22.95
0-123-45678-0 Ulysses $34.00
1-22-233700-0 Visual
Basic
$25.00
ISBN Title Price Table Scheme: {ISBN, Title, Price}
Functional Dependencies: {ISBN} 
{Title}
{ISBN} 
{Price}
Example 2
Functional Dependencies
1 Big House 999-999-9999
2 Small House 123-456-7890
3 Alpha Press 111-111-1111
PubID PubName PubPhone Table Scheme: {PubID, PubName, PubPhone}
Functional Dependencies: {PubId}  {PubPhone}
{PubId}  {PubName}
{PubName, PubPhone}  {PubID}
AuID AuName AuPhone
6 Joyce 666-666-6666
7 Roman 444-444-4444
5 Smith 654-223-3455
4 Jones 123-333-3333
3 Grumpy 665-235-6532
2 Snoopy 232-234-1234
1 Sleepy 321-321-1111
Example 3
Table Scheme: {AuID, AuName,
AuPhone}
Functional Dependencies: {AuId} 
{AuPhone}
{AuId} 
{AuName}
{AuName, AuPhone}  {AuID}
FD – Example
 Database to track reviews of papers submitted to an academic
conference. Prospective authors submit papers for review and
possible acceptance in the published conference proceedings.
Details of the entities
 Author information includes a unique author number, a
name, a mailing address, and a unique (optional) email
address.
 Paper information includes the primary author, the paper
number, the title, the abstract, and review status (pending,
accepted, rejected)
 Reviewer information includes the reviewer number, the
name, the mailing address, and a unique (optional) email
address
FD – Example
 Functional Dependencies
 AuthNo  AuthName, AuthEmail, AuthAddress
 AuthEmail  AuthNo
 PaperNo  Primary-AuthNo, Title, Abstract,
Status
 RevNo  RevName, RevEmail, RevAddress
 RevEmail  RevNo
 RevNo, PaperNo  AuthComm, Prog-Comm,
Date, Rating1, Rating2, Rating3, Rating4,
Rating5
 For a table to be in 2NF, there are two requirements
 The database is in first normal form
 All nonkey attributes in the table must be functionally
dependent on the entire primary key
 Example 1 (Not 2NF)
 Scheme  {Title, PubId, AuId, Price, AuAddress}
 Key  {Title, PubId, AuId}
 {Title, PubId, AuID}  {Price}
 {AuID}  {AuAddress}
 AuAddress does not belong to a key
 AuAddress functionally depends on AuId which is a
subset of a key
Second Normal Form (2NF)
Example 2 (Not 2NF)
Scheme  {City, Street, HouseNumber, HouseColor, CityPopulation}
1. key  {City, Street, HouseNumber}
2. {City, Street, HouseNumber}  {HouseColor}
3. {City}  {CityPopulation}
4. CityPopulation does not belong to any key.
5. CityPopulation is functionally dependent on the City which is
a proper subset of the key
Example 3 (Not 2NF)
Scheme  {studio, movie, budget, studio_city}
1. Key  {studio, movie}
2. {studio, movie}  {budget}
3. {studio}  {studio_city}
4. studio_city is not a part of a key
5. studio_city functionally depends on studio which is a proper
subset of the key
Second Normal Form (2NF)
 If a data item is fully functionally dependent on only a part
of the primary key, move that data item and that part of the
primary key to a new table.
 If other data items are functionally dependent on the same
part of the key, place them in the new table also
 Make the partial primary key copied from the original table
the primary key for the new table. Place all items that appear
in the repeating group in a new table
 Example 1 (Convert to 2NF)
 Old Scheme  {Title, PubId, AuId, Price,
AuAddress}
 New Scheme  {Title, PubId, AuId, Price}
 New Scheme  {AuId, AuAddress}
2NF - Decomposition
 This form dictates that all non-key attributes of a table must be
functionally dependent on a candidate key i.e. there can be no
interdependencies among non-key attributes.
 For a table to be in 3NF, there are two requirements
 The table should be second normal form
 No attribute is transitively dependent on the primary key
 Example (Not in 3NF)
 Scheme  {Title, PubID, PageCount, Price }
 Key  {Title, PubId}
 {Title, PubId}  {PageCount}
 {PageCount}  {Price}
 Both Price and PageCount depend on a key hence 2NF
 Transitively {Title, PubID}  {Price} hence not in 3NF
Third Normal Form (3NF)
Example 2 (Convert to 2NF)
Old Scheme  {Studio, Movie, Budget, StudioCity}
New Scheme  {Movie, Studio, Budget}
New Scheme  {Studio, City}
Example 3 (Convert to 2NF)
Old Scheme  {City, Street, HouseNumber, HouseColor,
CityPopulation}
New Scheme  {City, Street, HouseNumber, HouseColor}
New Scheme  {City, CityPopulation}
2NF - Decomposition
Example 2 (Not in 3NF)
Scheme  {Studio, StudioCity, CityTemp}
1. Primary Key  {Studio}
2. {Studio}  {StudioCity}
3. {StudioCity}  {CityTemp}
4. {Studio}  {CityTemp}
5. Both StudioCity and CityTemp depend on the entire key hence 2NF
6. CityTemp transitively depends on Studio hence violates 3NF
Example 3 (Not in 3NF)
Scheme  {BuildingID, Contractor, Fee}
1. Primary Key  {BuildingID}
2. {BuildingID}  {Contractor}
3. {Contractor}  {Fee}
4. {BuildingID}  {Fee}
5. Fee transitively depends on the BuildingID
6. Both Contractor and Fee depend on the entire key hence 2NF
Third Normal Form (3NF)
Building
ID
Contractor Fee
100 Randolp
h
120
0
150 Ingersoll 110
0200 Randolp
h
120
0
250 Pitkin 110
0
300 Randolp
h
120
0
 Move all items involved in transitive dependencies to a new
entity.
 Identify a primary key for the new entity.
 Place the primary key for the new entity as a foreign key on
the original entity.
 Example 1 (Convert to 3NF)
 Old Scheme  {Title, PubID, PageCount, Price }
 New Scheme  {PubID, PageCount, Price}
 New Scheme  {Title, PubID, PageCount}
3NF - Decomposition
Example 2 (Convert to 3NF)
Old Scheme  {Studio, StudioCity, CityTemp}
New Scheme  {Studio, StudioCity}
New Scheme  {StudioCity, CityTemp}
Example 3 (Convert to 3NF)
Old Scheme  {BuildingID, Contractor, Fee}
New Scheme  {BuildingID, Contractor}
New Scheme  {Contractor, Fee}
3NF - Decomposition
Building
ID
Contractor
100 Randolp
h
150 Ingersoll
200 Randolp
h
250 Pitkin
300 Randolp
h
Contractor Fee
Randolp
h
120
0
Ingersoll 110
0
Pitkin 110
0
 BCNF does not allow dependencies between attributes that belong to candidate keys.
 BCNF is a refinement of the third normal form in which it drops the restriction of a
non-key attribute from the 3rd normal form.
 Third normal form and BCNF are not same if the following conditions are true:
 The table has two or more candidate keys
 At least two of the candidate keys are composed of more than one attribute
 The keys are not disjoint i.e. The composite candidate keys share some
attributes
Example 1 - Address (Not in BCNF)
Scheme  {City, Street, ZipCode }
1. Key1  {City, Street }
2. Key2  {ZipCode, Street}
3. No non-key attribute hence 3NF
4. {City, Street}  {ZipCode}
5. {ZipCode}  {City}
6. Dependency between attributes belonging to a key
Boyce-Codd Normal Form
(BCNF)
Example 2 - Movie (Not in BCNF)
Scheme  {MovieTitle, MovieID, PersonName, Role, Payment }
1. Key1  {MovieTitle, PersonName}
2. Key2  {MovieID, PersonName}
3. Both role and payment functionally depend on both candidate keys thus 3NF
4. {MovieID}  {MovieTitle}
5. Dependency between MovieID & MovieTitle Violates BCNF
Example 3 - Consulting (Not in BCNF)
Scheme  {Client, Problem, Consultant}
1. Key1  {Client, Problem}
2. Key2  {Client, Consultant}
3. No non-key attribute hence 3NF
4. {Client, Problem}  {Consultant}
5. {Client, Consultant}  {Problem}
6. Dependency between attributess belonging to keys violates BCNF
Boyce Codd Normal Form
(BCNF)
 Place the two candidate primary keys in separate entities
 Place each of the remaining data items in one of the resulting
entities according to its dependency on the primary key.
 Example 1 (Convert to BCNF)
 Old Scheme  {City, Street, ZipCode }
 New Scheme1  {ZipCode, Street}
 New Scheme2  {City, Street}
 Loss of relation {ZipCode}  {City}
 Alternate New Scheme1  {ZipCode, Street }
 Alternate New Scheme2  {ZipCode, City}
BCNF - Decomposition
 If decomposition does not cause any loss of information it is
called a lossless decomposition.
 If a decomposition does not cause any dependencies to be
lost it is called a dependency-preserving decomposition.
 Any table scheme can be decomposed in a lossless way into
a collection of smaller schemas that are in BCNF form.
However the dependency preservation is not guaranteed.
 Any table can be decomposed in a lossless way into 3rd
normal form that also preserves the dependencies.
 3NF may be better than BCNF in some cases
Decomposition – Loss of
Information
 Use your own judgment when decomposing schemas
Example 2 (Convert to BCNF)
Old Scheme  {MovieTitle, MovieID, PersonName, Role, Payment }
New Scheme  {MovieID, PersonName, Role, Payment}
New Scheme  {MovieTitle, PersonName}
• Loss of relation {MovieID}  {MovieTitle}
New Scheme  {MovieID, PersonName, Role, Payment}
New Scheme  {MovieID, MovieTitle}
• We got the {MovieID}  {MovieTitle} relationship back
Example 3 (Convert to BCNF)
Old Scheme  {Client, Problem, Consultant}
New Scheme  {Client, Consultant}
New Scheme  {Client, Problem}
BCNF - Decomposition
 Fourth normal form eliminates independent many-to-one relationships
between columns.
 To be in Fourth Normal Form,
 a relation must first be in Boyce-Codd Normal Form.
 a given relation may not contain more than one multi-valued attribute.
 Example (Not in 4NF)
 Scheme  {MovieName, ScreeningCity, Genre)
 Primary Key: {MovieName, ScreeningCity, Genre)
 All columns are a part of the only candidate key, hence BCNF
 Many Movies can have the same Genre
 Many Cities can have the same movie
 Violates 4NF
Fourth Normal Form (4NF)
 
Movie ScreeningC
ity
Genre
Hard Code Los Angles Comedy
Hard Code New York Comedy
Bill Durham Santa Cruz Drama
Bill Durham Durham Drama
The Code Warrier New York Horror
 Example 2 (Not in 4NF)
 Scheme  {Manager, Child, Employee}
 Primary Key  {Manager, Child, Employee}
 Each manager can have more than one child
 Each manager can supervise more than one employee
 4NF Violated
 Example 3 (Not in 4NF)
 Scheme  {Employee, Skill, ForeignLanguage}
 Primary Key  {Employee, Skill, Language }
 Each employee can speak multiple languages
 Each employee can have multiple skills
 Thus violates 4NF
Fourth Normal Form (4NF)
Manage
r
Child
    
Employe
e
Jim Beth Alice
Mary Bob Jane
Mary NULL Adam
Employ
ee
Skill Langua
ge
1234 Cooking French
1234 Cooking German
1453 Carpentry Spanish
1453 Cooking Spanish
2345 Cooking Spanish
 Move the two multi-valued relations to separate tables
 Identify a primary key for each of the new entity.
 Example 1 (Convert to 3NF)
 Old Scheme  {MovieName, ScreeningCity, Genre}
 New Scheme  {MovieName, ScreeningCity}
 New Scheme  {MovieName, Genre}
4NF - Decomposition
Movie Genre
Hard Code Comedy
Bill Durham Drama
The Code Warrier Horror
Movie ScreeningC
ity
Hard Code Los Angles
Hard Code New York
Bill Durham Santa Cruz
Bill Durham Durham
The Code Warrier New York
Example 2 (Convert to 4NF)
Old Scheme  {Manager, Child, Employee}
New Scheme  {Manager, Child}
New Scheme  {Manager, Employee}
Example 3 (Convert to 4NF)
Old Scheme  {Employee, Skill, ForeignLanguage}
New Scheme  {Employee, Skill}
New Scheme  {Employee, ForeignLanguage}
4NF - Decomposition
Manage
r
Child
    
Jim Beth
Mary Bob
Manage
r
Employe
e
Jim Alice
Mary Jane
Mary Adam
Employ
ee
Langua
ge
1234 French
1234 German
1453 Spanish
2345 Spanish
Employ
ee
Skill
1234 Cooking
1453 Carpentry
1453 Cooking
2345 Cooking
 Fifth normal form is satisfied when all tables are broken
into as many tables as possible in order to avoid
redundancy. Once it is in fifth normal form it cannot be
broken into smaller relations without changing the facts
or the meaning.
Fifth Normal Form (5NF)
 
 The relation is in DKNF when there can be no insertion
or deletion anomalies in the database.
Domain Key Normal Form
(DKNF) 
SQL
 SQL, pronounced ‘Sequel’ or simply S-Q-L, is a
computer programming language that was
developed especially for querying relational
databases using a non-procedural approach.
 The term non-procedural means that you can
extract information by simply telling the system
what information is needed without telling how to
perform the data retrieval. The RDBMS parses
(converts) the SQL commands and completes the
task.
SQL
 Extracting information from the database by
using SQL is termed querying the database.
 SQL is a language that is fairly simple to learn,
in terms of writing queries but it has
considerable complexity because it is a very
powerful language.
DATA AND INFORMATION
 Information is derived from raw facts known as
data.
 Data has little meaning or usefulness to managers
unless it is organized in some logical manner.
 One of the most efficient ways to organize and
manage data is through the use of database
management system (DBMS).
DATA
 Two types of data are stored within a database
 User data : Data that must de stored by an
organization.
 System data: Data the database needs to
manage user data to manage itself. This is also
termed metadata, or the data about data.
SQL
 Data is manipulated by RDBMS users through
the use of special data manipulation language.
 Database structures can also be defined by the
use of data definition language.
 SQL is the most popular database language
and has commands that enable it to be used for
both manipulation and definition of databases.
SQL
 SQL is used by Oracle for all interaction with
the database. SQL statements fall into the two
major categories
 Data Definition Language(DDL) : Set of SQL
commands that create and define objects in a
database
 Data Manipulation Language(DML) : Set of
SQL commands that allow users to manipulate
the data in a database.
SQL
 SQL is basically a free format language. This
means that there are no particular spacing rules
that must be followed when typing SQL
commands.
 In Oracle, you must end each individual SQL
statement (irrespective of whether it is
composed as a single or multiple lines of code)
with a semi-colon (;). It is the “;” which ends
an SQL statement and tells Oracle to Execute it.
RELATIONAL
OPERATIONS
 SQL operations for creating new tables,
inserting table rows , updating table rows,
deleting table rows, and querying databases are
the primary means of interfacing with relational
databases.
 The SELECT statement is used primarily to
write queries that extract information from the
database which is a collection of related tables.
Starting Oracle SQL*PLUS
 The most common types used are either the
standard Oracle SQL*PLUS available for a
Windows-type interface or by connecting to an
Oracle database via a telnet session.
 The following Log On session is a connection to
an Oracle database stored on a Sun Microsystems
server running the Unix O/S.
 A SQL*PLUS session is begun by typing the
command sqlplus at the command prompt($) and
entering the username and password information .
Log On Screen
Exiting SQL*PLUS
 The SQL*PLUS session can be ended by
typing a command at the SQL prompt to
terminate the session.
 Two commands are available: exit or quit.
Either one of these can be used to terminate a
SQL*PLUS session.
Running (Executing) a Command
File
 The command to run (execute) a command file
is:
 SQL> START filename.sql
 A form of shorthand for the word “start” can be
used when executing a command file by
replacing “start” with the @ (“at” symbol).
Syntax Conventions
 Each select statement must follow precise
syntactical and structural rules.
 The following is the minimum structure and
syntax required for an SQL SELECT statement.
 SELECT [DISTINCT | ALL] {* | select_list}
FROM {table_name [alias] | view_name}
SQL Keywords
 Keywords are words that have a predefined
meaning in SQL.
 In practice, keywords may be entered in upper
or lower case letters.
 SELECT * FROM employee;
 select * from employee;
SQL Keywords
 In some cases keywords can be abbreviated.
 The allowed abbreviation is shown in upper case
letters with the remainder shown in lower case,
which means either the full word or only the
upper case part can be used.
 DESCribe: can be entered as either DESC or
DESCRIBE.
SQL Naming Conventions
 Identifiers are the names given by information
system developers or system users to database
objects such as tables , columns, indexes, and
other objects as well as the database itself.
 There are several rules for naming database
objects that must be followed.
 Identifiers should contain between 1 and 30
characters.
 The first character must be either alphabetic (a-z,
A-Z) or the @ symbol or _ (underscore).
SQL Naming Conventions
 After the first character, digits, letters, or the symbols
$,#, or _(underscore) must be used.
 No embedded spaces are allowed in identifiers.
 SQL keywords cannot be used as an identifier.
Using SQL Queries to Insert,
Update, Delete, and View Data:
Joining Multiple Tables
Lesson C Objectives
 After completing this lesson, you should be able to:
 Create SQL queries that join multiple tables
 Create nested SQL queries
 Combine query results using SET operators
 Create and use database views
48
Joining Multiple Tables
 a Join
 Combines data from multiple tables using foreign key
references
 Syntax
 SELECT column1, column2, …
FROM table1, table2
WHERE table1.joincolumn = table2.joincolumn
AND search_condition(s);
49
SELECT s_id, s_last, f_last
FROM student, faculty
WHERE student.f_id = faculty.f_id
AND f_last IN (‘Marx’, ‘Zhulin’);
Joining Multiple Tables
 Must qualify column name in SELECT clause
 Specify name of table that contains column followed by
period then column name
 Example: SELECT s_id, s_last, student.f_id
 Join condition
 Specifies table names to be joined and column names on
which to join tables
 Example: WHERE student.f_id = faculty.f_id
50
Inner Joins
 Simplest type of join
 Also called: Equality join, Equijoin, Natural join
 VALUES in one table equal to values in other table
 Query design diagram helps get the query right
51
SELECT s_id, s_last, s_first, student.f_id, f_last
FROM student, faculty
WHERE student.f_id = faculty.f_id;
Could be replaced by:
FROM Student NATURAL JOIN faculty;
52
Display column, search column, join
column
 Display columns: appear in SELECT clause
 Search columns: appear in search condition
 Join columns: primary key and foreign key column on which
you join the tables.
 Linkage table: contains join column to link other tables
through foreign key values.
SELECT f_last
FROM faculty, course_section, term
WHERE faculty.f_id = course_section.f_id
AND course_section.term_id = term.term_id
AND term_desc = 'Summer 2007';
Deriving a SQL Query From a Query
Design Diagram
53
 4 tables, 3 links
 All 4 tables must be named in the
FROM clause
 Query must have 3 join conditions
because there are 3 links
 Always 1 fewer join condition than
number of tables that query joins.
 If you omit one join condition, the
query creates a Cartesian product
(every row in one table is joined with
every row in other table) with more
row than expected.
SELECT course_name, grade
FROM student, enrollment, course_section, course
WHERE student.s_id = enrollment.s_id
AND enrollment.c_sec_id = course_section.c_sec_id
AND course_section.course_no = course.course_no
AND s_last = 'Jones'
AND s_first = 'Tammy';
Search conditions
Outer Joins
 Inner joins return row only if values exist in all joined tables
 Outer joins return
 all rows from one table (called inner table) and
 only matching rows from second table (outer table)
 Syntax: inner_table.join_col = outer_table.join_col(+)
54
(+) operator signals Oracle to insert NULL for columns from the outer table with no matching rows in the
inner table.
Self-join
 Query that joins table to itself
 Must create table alias
 Alternate name assigned to table in query’s FROM clause
 Syntax: FROM table1 alias1, table1 alias2 …
55
Creating Nested Queries
 Nested query
 Consists of a main query and one or more subqueries
 Main query
 First query that appears in SELECT command
 Sub query
 Retrieves values that main query’s search condition
must match
 Sub query is evaluated first. Then, DBMS substitute
subquery’s output into main query.
56
Creating Nested Queries
57
Q: What would happen if a sub query generated
more values than the main query is expecting?
58
Creating sub queries that return
multiple values
Using Multiple Sub queriesWithin
a Nested Query
 Use AND and OR operators
 To join search conditions associated with subqueries
59
Using SET operators to combine Query Results
 UNION
 Queries must have
same number of
display column in
their SELECT clause
 Corresponding display
columns must have
same data type
60
Note: S_LAST, S_FIRST, S_PHONE used as
display title even though there are faculty
members names displayed along with
61
Using SET operators to combine Query Results
 INTERSECT
– Queries must have
same number of
display column in their
SELECT clause
– Corresponding display
columns must have
same data type
– Suppresses duplicates
62
Using SET operators to combine Query Results
 MINUS
 Queries must have
same number of
display column in
their SELECT clause
 Corresponding display
columns must have
same data type
 Suppresses duplicates
 Finds difference
between two query
results
Creating and Using Database Views
 Source query
 Used to create view
 Specify subset of single table’s columns or rows or join multiple
tables
 Updatable views
 Can be used to update database
 Syntax
 CREATE VIEW view_name
 AS source_query;
 Or
 CREATE OR REPLACE VIEW view_name
 AS source_query;
63
Removing Views
 DROP VIEW command
 Remove view from user schema
 Syntax
 DROP VIEW view name;
64
References
1. http://www.tutorialspoint.com/sql/sql-rdbms-concepts.htm
2. http://ithopes.com/myblog/blog/simple-definition-normalization-
relational-database-management-system-rdbms-sql-server-oracle-
main-difference-terms-called-normalization-denormalization/
3. http://www.atlasindia.com/sql.htm
4. http://holowczak.com/database-normalization/
5. Database System Concepts: Abraham Silberschatz, Henry F. Korth
& S., Sudarshan, TATA Mcgraw Hill.
6. Database Systems Concepts, design and Applications 2/e, Singh S.
K, PearsonEducation
7. SQL- PL/SQL, Ivan bayross, BPB Publications.
 

More Related Content

What's hot (20)

Normalization
NormalizationNormalization
Normalization
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Normalization
NormalizationNormalization
Normalization
 
Normlaization
NormlaizationNormlaization
Normlaization
 
Oracle E-Business Suite on Kubernetes Cluster
Oracle E-Business Suite on Kubernetes ClusterOracle E-Business Suite on Kubernetes Cluster
Oracle E-Business Suite on Kubernetes Cluster
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Enhanced ER(database)
Enhanced ER(database)Enhanced ER(database)
Enhanced ER(database)
 
ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Skillwise-IMS DB
Skillwise-IMS DBSkillwise-IMS DB
Skillwise-IMS DB
 
Dbms 4NF & 5NF
Dbms 4NF & 5NFDbms 4NF & 5NF
Dbms 4NF & 5NF
 
SKILLWISE-DB2 DBA
SKILLWISE-DB2 DBASKILLWISE-DB2 DBA
SKILLWISE-DB2 DBA
 
ER to Relational Mapping
ER to Relational MappingER to Relational Mapping
ER to Relational Mapping
 
joins in database
 joins in database joins in database
joins in database
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modeling
 
Partitioning
PartitioningPartitioning
Partitioning
 

Viewers also liked

Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Jargalsaikhan Alyeksandr
 
Normalization i i
Normalization   i iNormalization   i i
Normalization i iGagan Deep
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) modelKumar
 
Databaseconcepts
DatabaseconceptsDatabaseconcepts
Databaseconceptskissumadanu
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational databaseJyoti Ranjan Pattnaik
 
Relational Database Fundamentals
Relational Database FundamentalsRelational Database Fundamentals
Relational Database FundamentalsKHALID C
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I Mukalele Rogers
 
การ Normalization
การ Normalizationการ Normalization
การ Normalizationskiats
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesJafar Nesargi
 

Viewers also liked (14)

Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Normalization i i
Normalization   i iNormalization   i i
Normalization i i
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
 
6 normalization
6 normalization6 normalization
6 normalization
 
L8 design1
L8 design1L8 design1
L8 design1
 
Databaseconcepts
DatabaseconceptsDatabaseconcepts
Databaseconcepts
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational database
 
Relational Database Fundamentals
Relational Database FundamentalsRelational Database Fundamentals
Relational Database Fundamentals
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I
 
การ Normalization
การ Normalizationการ Normalization
การ Normalization
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 

Similar to Bsc cs ii-dbms-u-iv-normalization

Similar to Bsc cs ii-dbms-u-iv-normalization (20)

Mca ii-dbms-u-iv-structured query language
Mca ii-dbms-u-iv-structured query languageMca ii-dbms-u-iv-structured query language
Mca ii-dbms-u-iv-structured query language
 
Database Normalization.ppt
Database Normalization.pptDatabase Normalization.ppt
Database Normalization.ppt
 
normalization.ppt
normalization.pptnormalization.ppt
normalization.ppt
 
normalization-Normalization -Process of Divide Tables
normalization-Normalization -Process of Divide Tablesnormalization-Normalization -Process of Divide Tables
normalization-Normalization -Process of Divide Tables
 
normalization in Database Management Systems.ppt
normalization in Database Management Systems.pptnormalization in Database Management Systems.ppt
normalization in Database Management Systems.ppt
 
normalization.ppt
normalization.pptnormalization.ppt
normalization.ppt
 
normalization.ppt
normalization.pptnormalization.ppt
normalization.ppt
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization.ppt
Normalization.pptNormalization.ppt
Normalization.ppt
 
Chuẩn hóa CSDL
Chuẩn hóa CSDLChuẩn hóa CSDL
Chuẩn hóa CSDL
 
Lecture8 Normalization Aggarwal
Lecture8 Normalization AggarwalLecture8 Normalization Aggarwal
Lecture8 Normalization Aggarwal
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Normal forms
Normal formsNormal forms
Normal forms
 
Normalization case
Normalization caseNormalization case
Normalization case
 
Revision1510(1)
Revision1510(1)Revision1510(1)
Revision1510(1)
 
Sql 
statements , functions & joins
Sql 
statements , functions  &  joinsSql 
statements , functions  &  joins
Sql 
statements , functions & joins
 
Normalisation
NormalisationNormalisation
Normalisation
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
 

More from Rai University

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University Rai University
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,Rai University
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02Rai University
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditureRai University
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public financeRai University
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introductionRai University
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflationRai University
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economicsRai University
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructureRai University
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competitionRai University
 

More from Rai University (20)

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University
 
Mm unit 4point2
Mm unit 4point2Mm unit 4point2
Mm unit 4point2
 
Mm unit 4point1
Mm unit 4point1Mm unit 4point1
Mm unit 4point1
 
Mm unit 4point3
Mm unit 4point3Mm unit 4point3
Mm unit 4point3
 
Mm unit 3point2
Mm unit 3point2Mm unit 3point2
Mm unit 3point2
 
Mm unit 3point1
Mm unit 3point1Mm unit 3point1
Mm unit 3point1
 
Mm unit 2point2
Mm unit 2point2Mm unit 2point2
Mm unit 2point2
 
Mm unit 2 point 1
Mm unit 2 point 1Mm unit 2 point 1
Mm unit 2 point 1
 
Mm unit 1point3
Mm unit 1point3Mm unit 1point3
Mm unit 1point3
 
Mm unit 1point2
Mm unit 1point2Mm unit 1point2
Mm unit 1point2
 
Mm unit 1point1
Mm unit 1point1Mm unit 1point1
Mm unit 1point1
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditure
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public finance
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introduction
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflation
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economics
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructure
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competition
 

Recently uploaded

fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Recently uploaded (20)

fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Bsc cs ii-dbms-u-iv-normalization

  • 1. Normalization & SQL using Oracle Course:-BSC CS-II Subject:-Database Management System Unit:-4
  • 2.  This is the process which allows you to winnow out redundant data within your database.  This involves restructuring the tables to successively meeting higher forms of Normalization.  A properly normalized database should have the following characteristics  Scalar values in each fields  Absence of redundancy.  Minimal use of null values.  Minimal loss of information. Definition
  • 3.  Levels of normalization based on the amount of redundancy in the database.  Various levels of normalization are:  First Normal Form (1NF)  Second Normal Form (2NF)  Third Normal Form (3NF)  Boyce-Codd Normal Form (BCNF)  Fourth Normal Form (4NF)  Fifth Normal Form (5NF)  Domain Key Normal Form (DKNF) Levels of Normalization Redundancy NumberofTables  Most databases should be 3NF or BCNF in order to avoid the database anomalies.  Most databases should be 3NF or BCNF in order to avoid the database anomalies. Complexity
  • 4. Levels of Normalization Each higher level is a subset of the lower level DKNF 1NF 2NF 3NF 4NF 5NF
  • 5. A table is considered to be in 1NF if all the fields contain only scalar values (as opposed to list of values). Example (Not 1NF) First Normal Form (1NF) Author and AuPhone columns are not scalarAuthor and AuPhone columns are not scalar 0-321-32132-1 Balloon Sleepy, Snoopy, Grumpy 321-321-1111, 232-234-1234, 665-235-6532 Small House 714-000-0000 $34.00 0-55-123456-9 Main Street Jones, Smith 123-333-3333, 654-223-3455 Small House 714-000-0000 $22.95 0-123-45678-0 Ulysses Joyce 666-666-6666 Alpha Press 999-999-9999 $34.00 1-22-233700-0 Visual Basic Roman 444-444-4444 Big House 123-456-7890 $25.00 ISBN Title AuName AuPhone PubName PubPhone Price
  • 6. 1. Place all items that appear in the repeating group in a new table 2. Designate a primary key for each new table produced. 3. Duplicate in the new table the primary key of the table from which the repeating group was extracted or vice versa. Example (1NF) 1NF - Decomposition 0-321-32132-1 Balloon Small House 714-000-0000 $34.00 0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-123-45678-0 Ulysses Alpha Press 999-999-9999 $34.00 1-22-233700-0 Visual Basic Big House 123-456-7890 $25.00 ISBN Title PubName PubPhone Price ISBN AuName AuPhone 0-123-45678-0 Joyce 666-666-6666 1-22-233700-0 Roman 444-444-4444 0-55-123456-9 Smith 654-223-3455 0-55-123456-9 Jones 123-333-3333 0-321-32132-1 Grumpy 665-235-6532 0-321-32132-1 Snoopy 232-234-1234 0-321-32132-1 Sleepy 321-321-1111
  • 7. 1. If one set of attributes in a table determines another set of attributes in the table, then the second set of attributes is said to be functionally dependent on the first set of attributes. Example 1 Functional Dependencies 0-321-32132-1 Balloon $34.00 0-55-123456-9 Main Street $22.95 0-123-45678-0 Ulysses $34.00 1-22-233700-0 Visual Basic $25.00 ISBN Title Price Table Scheme: {ISBN, Title, Price} Functional Dependencies: {ISBN}  {Title} {ISBN}  {Price}
  • 8. Example 2 Functional Dependencies 1 Big House 999-999-9999 2 Small House 123-456-7890 3 Alpha Press 111-111-1111 PubID PubName PubPhone Table Scheme: {PubID, PubName, PubPhone} Functional Dependencies: {PubId}  {PubPhone} {PubId}  {PubName} {PubName, PubPhone}  {PubID} AuID AuName AuPhone 6 Joyce 666-666-6666 7 Roman 444-444-4444 5 Smith 654-223-3455 4 Jones 123-333-3333 3 Grumpy 665-235-6532 2 Snoopy 232-234-1234 1 Sleepy 321-321-1111 Example 3 Table Scheme: {AuID, AuName, AuPhone} Functional Dependencies: {AuId}  {AuPhone} {AuId}  {AuName} {AuName, AuPhone}  {AuID}
  • 9. FD – Example  Database to track reviews of papers submitted to an academic conference. Prospective authors submit papers for review and possible acceptance in the published conference proceedings. Details of the entities  Author information includes a unique author number, a name, a mailing address, and a unique (optional) email address.  Paper information includes the primary author, the paper number, the title, the abstract, and review status (pending, accepted, rejected)  Reviewer information includes the reviewer number, the name, the mailing address, and a unique (optional) email address
  • 10. FD – Example  Functional Dependencies  AuthNo  AuthName, AuthEmail, AuthAddress  AuthEmail  AuthNo  PaperNo  Primary-AuthNo, Title, Abstract, Status  RevNo  RevName, RevEmail, RevAddress  RevEmail  RevNo  RevNo, PaperNo  AuthComm, Prog-Comm, Date, Rating1, Rating2, Rating3, Rating4, Rating5
  • 11.  For a table to be in 2NF, there are two requirements  The database is in first normal form  All nonkey attributes in the table must be functionally dependent on the entire primary key  Example 1 (Not 2NF)  Scheme  {Title, PubId, AuId, Price, AuAddress}  Key  {Title, PubId, AuId}  {Title, PubId, AuID}  {Price}  {AuID}  {AuAddress}  AuAddress does not belong to a key  AuAddress functionally depends on AuId which is a subset of a key Second Normal Form (2NF)
  • 12. Example 2 (Not 2NF) Scheme  {City, Street, HouseNumber, HouseColor, CityPopulation} 1. key  {City, Street, HouseNumber} 2. {City, Street, HouseNumber}  {HouseColor} 3. {City}  {CityPopulation} 4. CityPopulation does not belong to any key. 5. CityPopulation is functionally dependent on the City which is a proper subset of the key Example 3 (Not 2NF) Scheme  {studio, movie, budget, studio_city} 1. Key  {studio, movie} 2. {studio, movie}  {budget} 3. {studio}  {studio_city} 4. studio_city is not a part of a key 5. studio_city functionally depends on studio which is a proper subset of the key Second Normal Form (2NF)
  • 13.  If a data item is fully functionally dependent on only a part of the primary key, move that data item and that part of the primary key to a new table.  If other data items are functionally dependent on the same part of the key, place them in the new table also  Make the partial primary key copied from the original table the primary key for the new table. Place all items that appear in the repeating group in a new table  Example 1 (Convert to 2NF)  Old Scheme  {Title, PubId, AuId, Price, AuAddress}  New Scheme  {Title, PubId, AuId, Price}  New Scheme  {AuId, AuAddress} 2NF - Decomposition
  • 14.  This form dictates that all non-key attributes of a table must be functionally dependent on a candidate key i.e. there can be no interdependencies among non-key attributes.  For a table to be in 3NF, there are two requirements  The table should be second normal form  No attribute is transitively dependent on the primary key  Example (Not in 3NF)  Scheme  {Title, PubID, PageCount, Price }  Key  {Title, PubId}  {Title, PubId}  {PageCount}  {PageCount}  {Price}  Both Price and PageCount depend on a key hence 2NF  Transitively {Title, PubID}  {Price} hence not in 3NF Third Normal Form (3NF)
  • 15. Example 2 (Convert to 2NF) Old Scheme  {Studio, Movie, Budget, StudioCity} New Scheme  {Movie, Studio, Budget} New Scheme  {Studio, City} Example 3 (Convert to 2NF) Old Scheme  {City, Street, HouseNumber, HouseColor, CityPopulation} New Scheme  {City, Street, HouseNumber, HouseColor} New Scheme  {City, CityPopulation} 2NF - Decomposition
  • 16. Example 2 (Not in 3NF) Scheme  {Studio, StudioCity, CityTemp} 1. Primary Key  {Studio} 2. {Studio}  {StudioCity} 3. {StudioCity}  {CityTemp} 4. {Studio}  {CityTemp} 5. Both StudioCity and CityTemp depend on the entire key hence 2NF 6. CityTemp transitively depends on Studio hence violates 3NF Example 3 (Not in 3NF) Scheme  {BuildingID, Contractor, Fee} 1. Primary Key  {BuildingID} 2. {BuildingID}  {Contractor} 3. {Contractor}  {Fee} 4. {BuildingID}  {Fee} 5. Fee transitively depends on the BuildingID 6. Both Contractor and Fee depend on the entire key hence 2NF Third Normal Form (3NF) Building ID Contractor Fee 100 Randolp h 120 0 150 Ingersoll 110 0200 Randolp h 120 0 250 Pitkin 110 0 300 Randolp h 120 0
  • 17.  Move all items involved in transitive dependencies to a new entity.  Identify a primary key for the new entity.  Place the primary key for the new entity as a foreign key on the original entity.  Example 1 (Convert to 3NF)  Old Scheme  {Title, PubID, PageCount, Price }  New Scheme  {PubID, PageCount, Price}  New Scheme  {Title, PubID, PageCount} 3NF - Decomposition
  • 18. Example 2 (Convert to 3NF) Old Scheme  {Studio, StudioCity, CityTemp} New Scheme  {Studio, StudioCity} New Scheme  {StudioCity, CityTemp} Example 3 (Convert to 3NF) Old Scheme  {BuildingID, Contractor, Fee} New Scheme  {BuildingID, Contractor} New Scheme  {Contractor, Fee} 3NF - Decomposition Building ID Contractor 100 Randolp h 150 Ingersoll 200 Randolp h 250 Pitkin 300 Randolp h Contractor Fee Randolp h 120 0 Ingersoll 110 0 Pitkin 110 0
  • 19.  BCNF does not allow dependencies between attributes that belong to candidate keys.  BCNF is a refinement of the third normal form in which it drops the restriction of a non-key attribute from the 3rd normal form.  Third normal form and BCNF are not same if the following conditions are true:  The table has two or more candidate keys  At least two of the candidate keys are composed of more than one attribute  The keys are not disjoint i.e. The composite candidate keys share some attributes Example 1 - Address (Not in BCNF) Scheme  {City, Street, ZipCode } 1. Key1  {City, Street } 2. Key2  {ZipCode, Street} 3. No non-key attribute hence 3NF 4. {City, Street}  {ZipCode} 5. {ZipCode}  {City} 6. Dependency between attributes belonging to a key Boyce-Codd Normal Form (BCNF)
  • 20. Example 2 - Movie (Not in BCNF) Scheme  {MovieTitle, MovieID, PersonName, Role, Payment } 1. Key1  {MovieTitle, PersonName} 2. Key2  {MovieID, PersonName} 3. Both role and payment functionally depend on both candidate keys thus 3NF 4. {MovieID}  {MovieTitle} 5. Dependency between MovieID & MovieTitle Violates BCNF Example 3 - Consulting (Not in BCNF) Scheme  {Client, Problem, Consultant} 1. Key1  {Client, Problem} 2. Key2  {Client, Consultant} 3. No non-key attribute hence 3NF 4. {Client, Problem}  {Consultant} 5. {Client, Consultant}  {Problem} 6. Dependency between attributess belonging to keys violates BCNF Boyce Codd Normal Form (BCNF)
  • 21.  Place the two candidate primary keys in separate entities  Place each of the remaining data items in one of the resulting entities according to its dependency on the primary key.  Example 1 (Convert to BCNF)  Old Scheme  {City, Street, ZipCode }  New Scheme1  {ZipCode, Street}  New Scheme2  {City, Street}  Loss of relation {ZipCode}  {City}  Alternate New Scheme1  {ZipCode, Street }  Alternate New Scheme2  {ZipCode, City} BCNF - Decomposition
  • 22.  If decomposition does not cause any loss of information it is called a lossless decomposition.  If a decomposition does not cause any dependencies to be lost it is called a dependency-preserving decomposition.  Any table scheme can be decomposed in a lossless way into a collection of smaller schemas that are in BCNF form. However the dependency preservation is not guaranteed.  Any table can be decomposed in a lossless way into 3rd normal form that also preserves the dependencies.  3NF may be better than BCNF in some cases Decomposition – Loss of Information  Use your own judgment when decomposing schemas
  • 23. Example 2 (Convert to BCNF) Old Scheme  {MovieTitle, MovieID, PersonName, Role, Payment } New Scheme  {MovieID, PersonName, Role, Payment} New Scheme  {MovieTitle, PersonName} • Loss of relation {MovieID}  {MovieTitle} New Scheme  {MovieID, PersonName, Role, Payment} New Scheme  {MovieID, MovieTitle} • We got the {MovieID}  {MovieTitle} relationship back Example 3 (Convert to BCNF) Old Scheme  {Client, Problem, Consultant} New Scheme  {Client, Consultant} New Scheme  {Client, Problem} BCNF - Decomposition
  • 24.  Fourth normal form eliminates independent many-to-one relationships between columns.  To be in Fourth Normal Form,  a relation must first be in Boyce-Codd Normal Form.  a given relation may not contain more than one multi-valued attribute.  Example (Not in 4NF)  Scheme  {MovieName, ScreeningCity, Genre)  Primary Key: {MovieName, ScreeningCity, Genre)  All columns are a part of the only candidate key, hence BCNF  Many Movies can have the same Genre  Many Cities can have the same movie  Violates 4NF Fourth Normal Form (4NF)   Movie ScreeningC ity Genre Hard Code Los Angles Comedy Hard Code New York Comedy Bill Durham Santa Cruz Drama Bill Durham Durham Drama The Code Warrier New York Horror
  • 25.  Example 2 (Not in 4NF)  Scheme  {Manager, Child, Employee}  Primary Key  {Manager, Child, Employee}  Each manager can have more than one child  Each manager can supervise more than one employee  4NF Violated  Example 3 (Not in 4NF)  Scheme  {Employee, Skill, ForeignLanguage}  Primary Key  {Employee, Skill, Language }  Each employee can speak multiple languages  Each employee can have multiple skills  Thus violates 4NF Fourth Normal Form (4NF) Manage r Child      Employe e Jim Beth Alice Mary Bob Jane Mary NULL Adam Employ ee Skill Langua ge 1234 Cooking French 1234 Cooking German 1453 Carpentry Spanish 1453 Cooking Spanish 2345 Cooking Spanish
  • 26.  Move the two multi-valued relations to separate tables  Identify a primary key for each of the new entity.  Example 1 (Convert to 3NF)  Old Scheme  {MovieName, ScreeningCity, Genre}  New Scheme  {MovieName, ScreeningCity}  New Scheme  {MovieName, Genre} 4NF - Decomposition Movie Genre Hard Code Comedy Bill Durham Drama The Code Warrier Horror Movie ScreeningC ity Hard Code Los Angles Hard Code New York Bill Durham Santa Cruz Bill Durham Durham The Code Warrier New York
  • 27. Example 2 (Convert to 4NF) Old Scheme  {Manager, Child, Employee} New Scheme  {Manager, Child} New Scheme  {Manager, Employee} Example 3 (Convert to 4NF) Old Scheme  {Employee, Skill, ForeignLanguage} New Scheme  {Employee, Skill} New Scheme  {Employee, ForeignLanguage} 4NF - Decomposition Manage r Child      Jim Beth Mary Bob Manage r Employe e Jim Alice Mary Jane Mary Adam Employ ee Langua ge 1234 French 1234 German 1453 Spanish 2345 Spanish Employ ee Skill 1234 Cooking 1453 Carpentry 1453 Cooking 2345 Cooking
  • 28.  Fifth normal form is satisfied when all tables are broken into as many tables as possible in order to avoid redundancy. Once it is in fifth normal form it cannot be broken into smaller relations without changing the facts or the meaning. Fifth Normal Form (5NF)  
  • 29.  The relation is in DKNF when there can be no insertion or deletion anomalies in the database. Domain Key Normal Form (DKNF) 
  • 30. SQL  SQL, pronounced ‘Sequel’ or simply S-Q-L, is a computer programming language that was developed especially for querying relational databases using a non-procedural approach.  The term non-procedural means that you can extract information by simply telling the system what information is needed without telling how to perform the data retrieval. The RDBMS parses (converts) the SQL commands and completes the task.
  • 31. SQL  Extracting information from the database by using SQL is termed querying the database.  SQL is a language that is fairly simple to learn, in terms of writing queries but it has considerable complexity because it is a very powerful language.
  • 32. DATA AND INFORMATION  Information is derived from raw facts known as data.  Data has little meaning or usefulness to managers unless it is organized in some logical manner.  One of the most efficient ways to organize and manage data is through the use of database management system (DBMS).
  • 33. DATA  Two types of data are stored within a database  User data : Data that must de stored by an organization.  System data: Data the database needs to manage user data to manage itself. This is also termed metadata, or the data about data.
  • 34. SQL  Data is manipulated by RDBMS users through the use of special data manipulation language.  Database structures can also be defined by the use of data definition language.  SQL is the most popular database language and has commands that enable it to be used for both manipulation and definition of databases.
  • 35. SQL  SQL is used by Oracle for all interaction with the database. SQL statements fall into the two major categories  Data Definition Language(DDL) : Set of SQL commands that create and define objects in a database  Data Manipulation Language(DML) : Set of SQL commands that allow users to manipulate the data in a database.
  • 36. SQL  SQL is basically a free format language. This means that there are no particular spacing rules that must be followed when typing SQL commands.  In Oracle, you must end each individual SQL statement (irrespective of whether it is composed as a single or multiple lines of code) with a semi-colon (;). It is the “;” which ends an SQL statement and tells Oracle to Execute it.
  • 37. RELATIONAL OPERATIONS  SQL operations for creating new tables, inserting table rows , updating table rows, deleting table rows, and querying databases are the primary means of interfacing with relational databases.  The SELECT statement is used primarily to write queries that extract information from the database which is a collection of related tables.
  • 38. Starting Oracle SQL*PLUS  The most common types used are either the standard Oracle SQL*PLUS available for a Windows-type interface or by connecting to an Oracle database via a telnet session.  The following Log On session is a connection to an Oracle database stored on a Sun Microsystems server running the Unix O/S.  A SQL*PLUS session is begun by typing the command sqlplus at the command prompt($) and entering the username and password information .
  • 40. Exiting SQL*PLUS  The SQL*PLUS session can be ended by typing a command at the SQL prompt to terminate the session.  Two commands are available: exit or quit. Either one of these can be used to terminate a SQL*PLUS session.
  • 41. Running (Executing) a Command File  The command to run (execute) a command file is:  SQL> START filename.sql  A form of shorthand for the word “start” can be used when executing a command file by replacing “start” with the @ (“at” symbol).
  • 42. Syntax Conventions  Each select statement must follow precise syntactical and structural rules.  The following is the minimum structure and syntax required for an SQL SELECT statement.  SELECT [DISTINCT | ALL] {* | select_list} FROM {table_name [alias] | view_name}
  • 43. SQL Keywords  Keywords are words that have a predefined meaning in SQL.  In practice, keywords may be entered in upper or lower case letters.  SELECT * FROM employee;  select * from employee;
  • 44. SQL Keywords  In some cases keywords can be abbreviated.  The allowed abbreviation is shown in upper case letters with the remainder shown in lower case, which means either the full word or only the upper case part can be used.  DESCribe: can be entered as either DESC or DESCRIBE.
  • 45. SQL Naming Conventions  Identifiers are the names given by information system developers or system users to database objects such as tables , columns, indexes, and other objects as well as the database itself.  There are several rules for naming database objects that must be followed.  Identifiers should contain between 1 and 30 characters.  The first character must be either alphabetic (a-z, A-Z) or the @ symbol or _ (underscore).
  • 46. SQL Naming Conventions  After the first character, digits, letters, or the symbols $,#, or _(underscore) must be used.  No embedded spaces are allowed in identifiers.  SQL keywords cannot be used as an identifier.
  • 47. Using SQL Queries to Insert, Update, Delete, and View Data: Joining Multiple Tables
  • 48. Lesson C Objectives  After completing this lesson, you should be able to:  Create SQL queries that join multiple tables  Create nested SQL queries  Combine query results using SET operators  Create and use database views 48
  • 49. Joining Multiple Tables  a Join  Combines data from multiple tables using foreign key references  Syntax  SELECT column1, column2, … FROM table1, table2 WHERE table1.joincolumn = table2.joincolumn AND search_condition(s); 49 SELECT s_id, s_last, f_last FROM student, faculty WHERE student.f_id = faculty.f_id AND f_last IN (‘Marx’, ‘Zhulin’);
  • 50. Joining Multiple Tables  Must qualify column name in SELECT clause  Specify name of table that contains column followed by period then column name  Example: SELECT s_id, s_last, student.f_id  Join condition  Specifies table names to be joined and column names on which to join tables  Example: WHERE student.f_id = faculty.f_id 50
  • 51. Inner Joins  Simplest type of join  Also called: Equality join, Equijoin, Natural join  VALUES in one table equal to values in other table  Query design diagram helps get the query right 51 SELECT s_id, s_last, s_first, student.f_id, f_last FROM student, faculty WHERE student.f_id = faculty.f_id; Could be replaced by: FROM Student NATURAL JOIN faculty;
  • 52. 52 Display column, search column, join column  Display columns: appear in SELECT clause  Search columns: appear in search condition  Join columns: primary key and foreign key column on which you join the tables.  Linkage table: contains join column to link other tables through foreign key values. SELECT f_last FROM faculty, course_section, term WHERE faculty.f_id = course_section.f_id AND course_section.term_id = term.term_id AND term_desc = 'Summer 2007';
  • 53. Deriving a SQL Query From a Query Design Diagram 53  4 tables, 3 links  All 4 tables must be named in the FROM clause  Query must have 3 join conditions because there are 3 links  Always 1 fewer join condition than number of tables that query joins.  If you omit one join condition, the query creates a Cartesian product (every row in one table is joined with every row in other table) with more row than expected. SELECT course_name, grade FROM student, enrollment, course_section, course WHERE student.s_id = enrollment.s_id AND enrollment.c_sec_id = course_section.c_sec_id AND course_section.course_no = course.course_no AND s_last = 'Jones' AND s_first = 'Tammy'; Search conditions
  • 54. Outer Joins  Inner joins return row only if values exist in all joined tables  Outer joins return  all rows from one table (called inner table) and  only matching rows from second table (outer table)  Syntax: inner_table.join_col = outer_table.join_col(+) 54 (+) operator signals Oracle to insert NULL for columns from the outer table with no matching rows in the inner table.
  • 55. Self-join  Query that joins table to itself  Must create table alias  Alternate name assigned to table in query’s FROM clause  Syntax: FROM table1 alias1, table1 alias2 … 55
  • 56. Creating Nested Queries  Nested query  Consists of a main query and one or more subqueries  Main query  First query that appears in SELECT command  Sub query  Retrieves values that main query’s search condition must match  Sub query is evaluated first. Then, DBMS substitute subquery’s output into main query. 56
  • 57. Creating Nested Queries 57 Q: What would happen if a sub query generated more values than the main query is expecting?
  • 58. 58 Creating sub queries that return multiple values
  • 59. Using Multiple Sub queriesWithin a Nested Query  Use AND and OR operators  To join search conditions associated with subqueries 59
  • 60. Using SET operators to combine Query Results  UNION  Queries must have same number of display column in their SELECT clause  Corresponding display columns must have same data type 60 Note: S_LAST, S_FIRST, S_PHONE used as display title even though there are faculty members names displayed along with
  • 61. 61 Using SET operators to combine Query Results  INTERSECT – Queries must have same number of display column in their SELECT clause – Corresponding display columns must have same data type – Suppresses duplicates
  • 62. 62 Using SET operators to combine Query Results  MINUS  Queries must have same number of display column in their SELECT clause  Corresponding display columns must have same data type  Suppresses duplicates  Finds difference between two query results
  • 63. Creating and Using Database Views  Source query  Used to create view  Specify subset of single table’s columns or rows or join multiple tables  Updatable views  Can be used to update database  Syntax  CREATE VIEW view_name  AS source_query;  Or  CREATE OR REPLACE VIEW view_name  AS source_query; 63
  • 64. Removing Views  DROP VIEW command  Remove view from user schema  Syntax  DROP VIEW view name; 64
  • 65. References 1. http://www.tutorialspoint.com/sql/sql-rdbms-concepts.htm 2. http://ithopes.com/myblog/blog/simple-definition-normalization- relational-database-management-system-rdbms-sql-server-oracle- main-difference-terms-called-normalization-denormalization/ 3. http://www.atlasindia.com/sql.htm 4. http://holowczak.com/database-normalization/ 5. Database System Concepts: Abraham Silberschatz, Henry F. Korth & S., Sudarshan, TATA Mcgraw Hill. 6. Database Systems Concepts, design and Applications 2/e, Singh S. K, PearsonEducation 7. SQL- PL/SQL, Ivan bayross, BPB Publications.  

Editor's Notes

  1. Having scalar values also means that all instances of a record type must contain the same number of fields. A table not in first normal form is called un normalized
  2. 1. The designated key will be the primary key of the original table concatenated with one or more data items from the new table. For the first table the primary key is ISBN For the second table the primary key is ISBN + Author Name
  3. Notes to Instructor: Need more rigor in the functional dependencies. With a few examples. May be create a class assignment for functional dependencies.
  4. Let us consider the problems with the movie studio database: Redundancy – City Population is repeated many times Insertion anomaly – Whenever we add a new record we have to add unnecessary information. We can not add record until we know information about the city population Deletion anomaly – Whenever we delete a record, useful information is deleted. Update anomaly – The City Population needs to be updated in more than one location if it changes.
  5. If there is a table with columns A,B,C,D with Primary Key (A,B) & D is dependant on A (alone) then to be 2NF, you should reduce (split) tables as: Table with columns A,D with Primary Key (A) Table with columns A,B,C with Primary Key (A,B)
  6. In the Book Schema Third Normal Form is violated since a non-key field is dependent on another non-key field and is transitively dependent on the primary key.
  7. Let us consider the problems with the movie studio database: Redundancy – City Population is repeated many times Insertion anomaly – Whenever we add a new record we have to add unnecessary information. We can not add record until we know information about the city population Deletion anomaly – Whenever we delete a record, useful information is deleted. Update anomaly – The City Population needs to be updated in more than one location if it changes.
  8. If there is a table with columns A,B,C with Primary Key (A) and C is dependant on B (B  C) then to be 3NF, the tables become Table with columns B,C with Primary Key (B) Table with fields A,B with Primary Key ( A), and Foreign Key (B)
  9. The second and third normal forms assume that all attributes not part of the candidate keys depend on the candidate keys but does not deal with dependencies within the keys. BCNF deals with such dependencies. Under third normal form all non-key columns must be functionally dependent on a candidate key. Under BCNF, even columns that are part of a candidate key must be dependent on another candidate key, if they have a dependency at all. For most tables third normal form and BCNF are the same. Third normal form does not cover some specific cases for which BCNF was created. Third normal form and BCNF are not same if the following conditions are true: The table has two or more candidate keys At least two of the candidate keys are composed of more than one attribute The keys are not disjoint i.e. The composite candidate keys share some attributes
  10. A management consulting firm has several clients and consultants. A client can have several problems and the same problem can be an issue for several clients. Each consultant specializes in only one problem type (e. g marketing, production) but several consultants could advise on one problem. For each problem, the client is advised by only one consultant.
  11. If there is a table with columns A,B,C with Primary Key (A) and C is dependant on B (B  C) then to be 3NF, the tables become Table with columns B,C with Primary Key (B) Table with fields A,B with Primary Key ( A), and Foreign Key (B)
  12. These cause update, addition and deletion anomalies. Insertion anomaly is that entity integrity would be violated if you tried to add a new employee who did not speak a foreign language. Update anomalies would occur if you tried to change Cooking to Chef.