0% found this document useful (0 votes)
84 views20 pages

DBMSPPT

This document provides an overview of advanced database management systems concepts including: 1) Database normalization concepts including 1NF, 2NF, 3NF and BCNF are explained to reduce data redundancy and improve data integrity. 2) Advanced SQL queries including joins, set operations, aggregate functions and nested subqueries are demonstrated to retrieve customer purchase histories and sales analytics. 3) Database triggers are introduced to automatically apply a 10% discount when purchases exceed 5000.

Uploaded by

ajinkya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views20 pages

DBMSPPT

This document provides an overview of advanced database management systems concepts including: 1) Database normalization concepts including 1NF, 2NF, 3NF and BCNF are explained to reduce data redundancy and improve data integrity. 2) Advanced SQL queries including joins, set operations, aggregate functions and nested subqueries are demonstrated to retrieve customer purchase histories and sales analytics. 3) Database triggers are introduced to automatically apply a 10% discount when purchases exceed 5000.

Uploaded by

ajinkya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

MSPM’s

Deogiri Institute of Engineering and Management Studies , Aurangabad​


Department of Computer Science and Engineering 

A Presentation on

Advance Database
Management System
3706 Aishwarya Patil
3707 Ajinkya Bhandare
3709 Akash Khandagale

Under the Guidance of ​


Prof.
Grocery Shop Management
System
CONTENTS

• Modified Er Diagram
• Database Normalization
1NF
2NF
3NF
BCNF
• Advance SQL Queries
1. join operations
2.Set operations
3. Aggregate Functions
4.Nested Subquery
5. Procedures
6. Triggers
Modified Er Diagram
Database Normalization

• Data in a database are organised through a process called normalization.

• Reduced redundancy from a relation or collection of relations is achieved through


normalization.

• Normalization splits the larger table into smaller ones and uses relationships to
connect them.

• The database table's redundancy is reduced by using the normal form.


1NF (First Normal Form)

•First normal form: An attribute (column) of a table cannot hold multiple values.
It should hold only atomic values

• First normal form (1NF) sets the very basic rules for an organized database
• There are no repeating or duplicate fields
• Each cell contains only a single value
• Each record is unique (identified by a primary key)
Unnormalized table :
1NF Normalized Table:
•Storage: More storage is required for data that
are not needed
•SELECT: It is easier to perform. Employees that
1st normal form – speak a specific language are easier
found.
to be

New problems •INSERT: Data insertion is problematic.


•UPDATE: Data update is easy to perform.
•DELETE: Data deletion is easy to perform
2NF (Second Normal Form)

• Second normal form: an entity type is in second normal form (2NF) when it is in
1NF and when every non-key attribute, any attribute that is not part of the
primary key, is fully dependent on the primary key

•A table is said to in second normal form (2NF) if both the following conditions hold:
• Table is in first normal form (1NF)
• No non-prime attribute is dependent on the proper subset of any candidate
key of the table
Unnormalized Table:

2NF Normalized Table:


• We split the initial table to
the following two:
3NF (Third Normal Form)
• Third normal form: an entity type is in third normal form (3NF) when it is in 2NF and all non-
primary fields are dependent on the primary key
• A table is said to in third normal form (3NF) if both the following conditions hold:
- A relation will be in 3NF if it is in 2NF and not contain any transitive partial dependency.
-3NF is used to reduce the data duplication. It is also used to achieve the data integrity.
-If there is no transitive dependency for non-prime attributes, then the relation must be in third
normal form.
BCNF (Boyce-Codd Normal Form)
• A relation is in BCNF if and only if every nontrivial FD X -> Y (X is a Super Key.).
• LHS of each FD should be a candidate key or super key.
• Table is in third normal form (3NF)
Advance SQL
Advance SQL
Queries
Queries
Advance SQL Queries
Task: The most Frequently Purchased items

Relations (Tables): Shopping_cart, products

Query:

Output:

Summary:
Advance SQL Queries
Task: obtaining the product names for all orders with the order number 01

Relations (Tables): Shopping_cart, products

Query:

Output:

Summary:
Advance SQL Queries
Task: customer purchase history

Relations (Tables): Shopping_cart, products

Query:

Output:

Summary:
Advance SQL Queries
Task: Total sales in different months

Relations (Tables): Shopping_cart, products

Query:

Output:

Summary:
Advance SQL Queries
Task: Trigger to add 10% discount on purchase above 5000

Relations (Tables): Payment

Query:

Output:

Summary:

You might also like