SlideShare a Scribd company logo
1 of 22
RELATIONAL DATABASE
DESIGN
By: Surbhi Saroha
SYLLABUS
• Functional dependencies
• First to BCNF normal form
• Integrity and recovery
• Security of database
FUNCTIONAL DEPENDENCIES
• What is Functional Dependency
• Functional dependency in DBMS, as the name suggests is a relationship between
attributes of a table dependent on each other. Introduced by E. F. Codd, it helps in
preventing data redundancy and gets to know about bad designs.
• To understand the concept thoroughly, let us consider P is a relation with attributes
A and B. Functional Dependency is represented by -> (arrow sign)
• Then the following will represent the functional dependency between attributes with
an arrow sign −
• A->B
CONT…
EXAMPLE
• The following is an example that would make it easier to understand functional
dependency −
• We have a <Department> table with two attributes − DeptId and DeptName.
• DeptId = Department ID
DeptName = Department Name
• The DeptId is our primary key. Here, DeptId uniquely identifies
the DeptName attribute. This is because if you want to know the department
name, then at first you need to have the DeptId.
CONT…
DeptId DeptName
001 Finance
002 Marketing
003 HR
CONT….
• Therefore, the above functional dependency between DeptId and DeptName can
be determined as DeptId is functionally dependent on DeptName.
• DeptId -> DeptName
FIRST TO BCNF NORMAL FORM
• If a relation contain composite or multi-valued attribute, it violates first normal form
or a relation is in first normal form if it does not contain any composite or multi-
valued attribute.
• A relation is in first normal form if every attribute in that relation is singled valued
attribute.
• Example 1 – Relation STUDENT in table 1 is not in 1NF because of multi-valued
attribute STUD_PHONE. Its decomposition into 1NF has been shown in table 2.
CONT……
SECOND NORMAL FORM –
• To be in second normal form, a relation must be in first normal form and relation
must not contain any partial dependency. A relation is in 2NF if it has No Partial
Dependency, i.e., no non-prime attribute (attributes which are not part of any
candidate key) is dependent on any proper subset of any candidate key of the
table.
• Partial Dependency – If the proper subset of candidate key determines non-prime
attribute, it is called partial dependency.
• Example 1 – Consider table-3 as following below.
CONT….
• STUD_NO COURSE_NO COURSE_FEE
• 1 C1 1000
• 2 C2 1500
• 1 C4 2000
• 4 C3 1000
• 4 C1 1000
• 2 C5 2000
CONT….
• Example 2 – Consider following functional dependencies in relation R (A, B , C, D )
• AB -> C [A and B together determine C]
• BC -> D [B and C together determine D]
• In the above relation, AB is the only candidate key and there is no partial
dependency, i.e., any proper subset of AB doesn’t determine any non-prime
attribute.
THIRD NORMAL FORM –
• A relation is in third normal form, if there is no transitive dependency for non-prime
attributes as well as it is in second normal form.
A relation is in 3NF if at least one of the following condition holds in every non-trivial
function dependency X –> Y
• X is a super key.
• Y is a prime attribute (each element of Y is part of some candidate key).
• Example 2 – Consider relation R(A, B, C, D, E)
A -> BC,
CD -> E,
B -> D,
E -> A
All possible candidate keys in above relation are {A, E, CD, BC} All attribute are on right
sides of all functional dependencies are prime.
BOYCE-CODD NORMAL FORM
(BCNF) –
• A relation R is in BCNF if R is in Third Normal Form and for every FD, LHS is super
key.
• A relation is in BCNF iff in every non-trivial functional dependency X –> Y, X is a
super key.
• Example 2 –For example consider relation R(A, B, C)
A -> BC,
B ->
A and B both are super keys so above relation is in BCNF.
• Key Points –
• BCNF is free from redundancy.
• If a relation is in BCNF, then 3NF is also also satisfied.
CONT….
• If all attributes of relation are prime attribute, then the relation is always in 3NF.
• A relation in a Relational Database is always and at least in 1NF form.
• Every Binary Relation ( a Relation with only 2 attributes ) is always in BCNF.
• If a Relation has only singleton candidate keys( i.e. every candidate key consists of only 1
attribute), then the Relation is always in 2NF( because no Partial functional dependency
possible).
• Sometimes going for BCNF form may not preserve functional dependency. In that case go
for BCNF only if the lost FD(s) is not required, else normalize till 3NF only.
• There are many more Normal forms that exist after BCNF, like 4NF and more. But in real
world database systems it’s generally not required to go beyond BCNF.
INTEGRITY AND RECOVERY
• INTEGRITY:
• It refers to accuracy or validation of the data.
• Integrity contributes to maintaining a secure database by preventing the data from
becoming invalid and giving misleading results.
• It consists of following aspects : System and object privileges control access to applications
tables and system commands so that only authorized users can change the data.
• Integrity constraints are applied to maintain the correctness and validity of the data in the
database.
• Database must be protected from viruses so firewalls and anti-viruses should be used.
• Ensures that access to the network is controlled and data is not vulnerable to attacks during
transmission across network.
THREE MAIN INTEGRITY PROBLEMS
ARE
• Lost updates
• Uncommitted data
• Inconsistent retrieval
DATABASE RECOVERY
• The process of restoring database to a correct state in the case of failure. E.g.
• system crashes
• Media failures
• Application software errors
• Natural physical disasters
• carelessness
BASIC RECOVERY CONCEPTS
•Backup mechanism – it makes periodic backup copies of the database.
• Logging concept – that keeps the track of current state of transaction and the
changes made in the database.
• Check pointing mechanism – that enables update to be made permanent.
CONT…
• The choice of the best possible strategy depends upon the
• Extent of damage that had occurred to the database.
• If there has been a physical damage like disk crash then the last backup copy of the
data is restored.
• However if database has become inconsistent but not physically damaged then
changes caused inconsistency must be undone.
It may also be required to redo some transactions so as to ensure that the updates
are reflected in the database
SECURITY OF DATABASE
• Database security refers to the collective measures used to protect and secure a database or database
management software from illegitimate use and malicious cyber threats and attacks.
• Database security procedures are aimed at protecting not just the data inside the database, but the database
management system and all the applications that access it from intrusion, misuse of data, and damage.
• It is a broad term that includes a multitude of processes, tools and methodologies that ensure security within
a database environment.
• Database security covers and enforces security on all aspects and components of databases. This includes:
• Data stored in database.
• Database server.
• Database management system (DBMS).
• Other database workflow applications.
• Database security is generally planned, implemented and maintained by a database administrator and or
other information security professional.
THANK YOU

More Related Content

What's hot

Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and propertiesChetan Mahawar
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
 
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
 
Database Management Systems
Database Management SystemsDatabase Management Systems
Database Management SystemsSURBHI SAROHA
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Typesaakanksha s
 

What's hot (20)

The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
20.SCHEDULES.ppt
20.SCHEDULES.ppt20.SCHEDULES.ppt
20.SCHEDULES.ppt
 
DBMS Unit - 3 - Relational query languages
DBMS Unit - 3 - Relational query languagesDBMS Unit - 3 - Relational query languages
DBMS Unit - 3 - Relational query languages
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
 
CS8391 Data Structures 2 mark Questions - Anna University Questions
CS8391 Data Structures 2 mark Questions - Anna University QuestionsCS8391 Data Structures 2 mark Questions - Anna University Questions
CS8391 Data Structures 2 mark Questions - Anna University Questions
 
Index in sql server
Index in sql serverIndex in sql server
Index in sql server
 
Join
JoinJoin
Join
 
DBMS Unit - 6 - Transaction Management
DBMS Unit - 6 - Transaction ManagementDBMS Unit - 6 - Transaction Management
DBMS Unit - 6 - Transaction Management
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Normalization
NormalizationNormalization
Normalization
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Database Management Systems
Database Management SystemsDatabase Management Systems
Database Management Systems
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Normalization
NormalizationNormalization
Normalization
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
DBMS
DBMSDBMS
DBMS
 
Transaction states PPT
Transaction states PPTTransaction states PPT
Transaction states PPT
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Types
 

Similar to Relational database design

Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.pptDeependra35
 
20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx
20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx
20190326165315_ISYS6508-PPT4-W4-S5-R0.pptxFayChan8
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Dbms interview ques
Dbms interview quesDbms interview ques
Dbms interview quesSwatiJain303
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfMisganawAbeje1
 
DBMS VIVA QUESTIONS_CODERS LODGE.pdf
DBMS VIVA QUESTIONS_CODERS LODGE.pdfDBMS VIVA QUESTIONS_CODERS LODGE.pdf
DBMS VIVA QUESTIONS_CODERS LODGE.pdfnofakeNews
 
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptxMIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptxKrishnaRoy45
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.pptxkshipra sony
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxMaryJoseph79
 
Normalization
NormalizationNormalization
NormalizationSanSan149
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxNurulIzrin
 

Similar to Relational database design (20)

Normalisation
NormalisationNormalisation
Normalisation
 
DBMS ppts unit1.pptx
DBMS ppts  unit1.pptxDBMS ppts  unit1.pptx
DBMS ppts unit1.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
chapter_8.pptx
chapter_8.pptxchapter_8.pptx
chapter_8.pptx
 
20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx
20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx
20190326165315_ISYS6508-PPT4-W4-S5-R0.pptx
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
RDBMS Model
RDBMS ModelRDBMS Model
RDBMS Model
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Dbms interview ques
Dbms interview quesDbms interview ques
Dbms interview ques
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdf
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
DBMS VIVA QUESTIONS_CODERS LODGE.pdf
DBMS VIVA QUESTIONS_CODERS LODGE.pdfDBMS VIVA QUESTIONS_CODERS LODGE.pdf
DBMS VIVA QUESTIONS_CODERS LODGE.pdf
 
Database Presentation
Database PresentationDatabase Presentation
Database Presentation
 
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptxMIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 2&3.pptx
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.pptx
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
 
Normalization
NormalizationNormalization
Normalization
 

More from SURBHI SAROHA

Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2SURBHI SAROHA
 
Management Information System(Unit 2).pptx
Management Information System(Unit 2).pptxManagement Information System(Unit 2).pptx
Management Information System(Unit 2).pptxSURBHI SAROHA
 
Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)SURBHI SAROHA
 
Management Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptxManagement Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptxSURBHI SAROHA
 
Introduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptxIntroduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptxSURBHI SAROHA
 
Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)SURBHI SAROHA
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)SURBHI SAROHA
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1SURBHI SAROHA
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)SURBHI SAROHA
 

More from SURBHI SAROHA (20)

Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2
 
Management Information System(Unit 2).pptx
Management Information System(Unit 2).pptxManagement Information System(Unit 2).pptx
Management Information System(Unit 2).pptx
 
Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)
 
Management Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptxManagement Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptx
 
Introduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptxIntroduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptx
 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)
 
DBMS (UNIT 5)
DBMS (UNIT 5)DBMS (UNIT 5)
DBMS (UNIT 5)
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 
JAVA(UNIT 4)
JAVA(UNIT 4)JAVA(UNIT 4)
JAVA(UNIT 4)
 
OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)
 
OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)
 
DBMS UNIT 3
DBMS UNIT 3DBMS UNIT 3
DBMS UNIT 3
 
JAVA (UNIT 3)
JAVA (UNIT 3)JAVA (UNIT 3)
JAVA (UNIT 3)
 
Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)
 
DBMS (UNIT 2)
DBMS (UNIT 2)DBMS (UNIT 2)
DBMS (UNIT 2)
 
JAVA UNIT 2
JAVA UNIT 2JAVA UNIT 2
JAVA UNIT 2
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

Relational database design

  • 2. SYLLABUS • Functional dependencies • First to BCNF normal form • Integrity and recovery • Security of database
  • 3. FUNCTIONAL DEPENDENCIES • What is Functional Dependency • Functional dependency in DBMS, as the name suggests is a relationship between attributes of a table dependent on each other. Introduced by E. F. Codd, it helps in preventing data redundancy and gets to know about bad designs. • To understand the concept thoroughly, let us consider P is a relation with attributes A and B. Functional Dependency is represented by -> (arrow sign) • Then the following will represent the functional dependency between attributes with an arrow sign − • A->B
  • 5. EXAMPLE • The following is an example that would make it easier to understand functional dependency − • We have a <Department> table with two attributes − DeptId and DeptName. • DeptId = Department ID DeptName = Department Name • The DeptId is our primary key. Here, DeptId uniquely identifies the DeptName attribute. This is because if you want to know the department name, then at first you need to have the DeptId.
  • 7. CONT…. • Therefore, the above functional dependency between DeptId and DeptName can be determined as DeptId is functionally dependent on DeptName. • DeptId -> DeptName
  • 8. FIRST TO BCNF NORMAL FORM • If a relation contain composite or multi-valued attribute, it violates first normal form or a relation is in first normal form if it does not contain any composite or multi- valued attribute. • A relation is in first normal form if every attribute in that relation is singled valued attribute. • Example 1 – Relation STUDENT in table 1 is not in 1NF because of multi-valued attribute STUD_PHONE. Its decomposition into 1NF has been shown in table 2.
  • 10. SECOND NORMAL FORM – • To be in second normal form, a relation must be in first normal form and relation must not contain any partial dependency. A relation is in 2NF if it has No Partial Dependency, i.e., no non-prime attribute (attributes which are not part of any candidate key) is dependent on any proper subset of any candidate key of the table. • Partial Dependency – If the proper subset of candidate key determines non-prime attribute, it is called partial dependency. • Example 1 – Consider table-3 as following below.
  • 11. CONT…. • STUD_NO COURSE_NO COURSE_FEE • 1 C1 1000 • 2 C2 1500 • 1 C4 2000 • 4 C3 1000 • 4 C1 1000 • 2 C5 2000
  • 12. CONT…. • Example 2 – Consider following functional dependencies in relation R (A, B , C, D ) • AB -> C [A and B together determine C] • BC -> D [B and C together determine D] • In the above relation, AB is the only candidate key and there is no partial dependency, i.e., any proper subset of AB doesn’t determine any non-prime attribute.
  • 13. THIRD NORMAL FORM – • A relation is in third normal form, if there is no transitive dependency for non-prime attributes as well as it is in second normal form. A relation is in 3NF if at least one of the following condition holds in every non-trivial function dependency X –> Y • X is a super key. • Y is a prime attribute (each element of Y is part of some candidate key). • Example 2 – Consider relation R(A, B, C, D, E) A -> BC, CD -> E, B -> D, E -> A All possible candidate keys in above relation are {A, E, CD, BC} All attribute are on right sides of all functional dependencies are prime.
  • 14. BOYCE-CODD NORMAL FORM (BCNF) – • A relation R is in BCNF if R is in Third Normal Form and for every FD, LHS is super key. • A relation is in BCNF iff in every non-trivial functional dependency X –> Y, X is a super key. • Example 2 –For example consider relation R(A, B, C) A -> BC, B -> A and B both are super keys so above relation is in BCNF. • Key Points – • BCNF is free from redundancy. • If a relation is in BCNF, then 3NF is also also satisfied.
  • 15. CONT…. • If all attributes of relation are prime attribute, then the relation is always in 3NF. • A relation in a Relational Database is always and at least in 1NF form. • Every Binary Relation ( a Relation with only 2 attributes ) is always in BCNF. • If a Relation has only singleton candidate keys( i.e. every candidate key consists of only 1 attribute), then the Relation is always in 2NF( because no Partial functional dependency possible). • Sometimes going for BCNF form may not preserve functional dependency. In that case go for BCNF only if the lost FD(s) is not required, else normalize till 3NF only. • There are many more Normal forms that exist after BCNF, like 4NF and more. But in real world database systems it’s generally not required to go beyond BCNF.
  • 16. INTEGRITY AND RECOVERY • INTEGRITY: • It refers to accuracy or validation of the data. • Integrity contributes to maintaining a secure database by preventing the data from becoming invalid and giving misleading results. • It consists of following aspects : System and object privileges control access to applications tables and system commands so that only authorized users can change the data. • Integrity constraints are applied to maintain the correctness and validity of the data in the database. • Database must be protected from viruses so firewalls and anti-viruses should be used. • Ensures that access to the network is controlled and data is not vulnerable to attacks during transmission across network.
  • 17. THREE MAIN INTEGRITY PROBLEMS ARE • Lost updates • Uncommitted data • Inconsistent retrieval
  • 18. DATABASE RECOVERY • The process of restoring database to a correct state in the case of failure. E.g. • system crashes • Media failures • Application software errors • Natural physical disasters • carelessness
  • 19. BASIC RECOVERY CONCEPTS •Backup mechanism – it makes periodic backup copies of the database. • Logging concept – that keeps the track of current state of transaction and the changes made in the database. • Check pointing mechanism – that enables update to be made permanent.
  • 20. CONT… • The choice of the best possible strategy depends upon the • Extent of damage that had occurred to the database. • If there has been a physical damage like disk crash then the last backup copy of the data is restored. • However if database has become inconsistent but not physically damaged then changes caused inconsistency must be undone. It may also be required to redo some transactions so as to ensure that the updates are reflected in the database
  • 21. SECURITY OF DATABASE • Database security refers to the collective measures used to protect and secure a database or database management software from illegitimate use and malicious cyber threats and attacks. • Database security procedures are aimed at protecting not just the data inside the database, but the database management system and all the applications that access it from intrusion, misuse of data, and damage. • It is a broad term that includes a multitude of processes, tools and methodologies that ensure security within a database environment. • Database security covers and enforces security on all aspects and components of databases. This includes: • Data stored in database. • Database server. • Database management system (DBMS). • Other database workflow applications. • Database security is generally planned, implemented and maintained by a database administrator and or other information security professional.