SlideShare a Scribd company logo
1 of 42
1
 A person, place, event or item is called an entity
 The facts describing an entity are known as data
 Each entity can be described by its characteristics
known as attributes
 All the related entities are collected together to
form an entity set
 A database is a collection of entity sets
 The interaction between the entity sets are called
relationships.
2
 A data base is an electronic store of data.
 It stores information about different “things”& also
contains relationships.
 The collection of data may be organized in the
form of files or tables.
Examples:-
1. Oracle 9i, 10G, 10Gi, 11G, 11Gi
2. SQL-server-2005, 2010
3. DB2,Sybase,foxpro, Ms-access2003,2007, 2010,
3
 A DBMS is a software package designed to define,
manipulate, retrieve and manage data in a database.
 It also defines rules to validate and manipulate the
data.
 It relieves users of framing programs for data
maintenance.
 Fourth-generation query languages, such as SQL, are
used along with the DBMS package to interact with a
database.
4
1. Banking Sector
2. Universities
3. Railway Reservation
4. Finance
5. Sales
5
1. One-to-one (1:1) :
Each entity has only one matching entity in another
entity set
Eg: Student (1) – RollNo. (1)
2. One-to-many (1:M):
Each entity of X has many matching entities in
another entity set Y.
Eg: Department (1) – Employees (M)
3. Many-to-many (M:M):
Each entity of X has many matching entities in
another entity set Y and vice versa.
Eg: Students (M) – Courses (M)
6
 DBMS S/W Packages – MS Access, Oracle
 User developed & implemented DB
 Custom Applications such as forms,Reports,query
blocks
 Computer hardware – PCs, minicomputers
 Software – OS and Network OS
 Personnel- DB administrator, designer
7
User
Applications DBMS Database
OS Software
Hardware
8
 RDBMS is a DBMS i.e. based on Relational model as
introduce by Dr. E.F. Codd…..
 Codd’s rule for RDBMS:-
 Dr. Codd is an IBM researcher who developed
relational data base in 1970…..
In 1905 Codd published 12 rules……
1)The Information rule.
2)Granted access rule.
3)Systemic treatment of NULL values.
4)Dynamic online Catalog based on relational model.
9
5)Comprehensive data sub-language rule.
6)View updating rule.
7)High level Insert , Update, Delete rule.
8)Physical data Independence.
9)Logical data Independence.
10)Integrity data Independence.
11)Distribution data Independence.
12)Non-subversions rule.
10
1. It manages the data and relationships stored
in the database.
2. It creates a Data Dictionary (DD) as a user
creates a DB. DD stores Metadata (data
about data)
3. Manages all day-to-day transactions
4. Data search can be done through DD
5. User can validate data
11
6. Secures access through passwords, encryption
etc..
7. Backup & Recovery procedures
8. Data Sharing with data-locking capabilities
9. Import and Export Utilities from other databases
10. Users can view information stored in different
tables within the database.
12
13
 E.F.Codd developed the relational model in 1970.
 The relation is represented by a table structure
 Each row represents an entity
 Each column represents an attribute
 DATA STRUCTURES - domain, attribute, relation,
tuple, primary key, degree, cardinality.
 INTEGRITY CONSTRAINTS - entity integrity and
referential integrity.
 DATA MANIPULATION OPERATIONS - defined
through relational algebra and equivalent relational
calculus.
14
 A database consists of one or more relations.
 A relation is described by a name, names for one
or more attributes and consists of zero or more
tuples.
 A tuple consists of values for each attribute of the
relation.
 An attribute takes values from a domain and
there exists one value for each attribute in a tuple.
 A domain consists of all allowed atomic values for
one or more attributes.
 Degree of a relation is the number of attributes of
the relation.
 Cardinality of a relation is the number of tuples of
the relation.
15
16
17
18
 Keys are very important part of Relational
database.
 They are used to establish and identify relation
between tables.
 They also ensure that each record within a table
can be uniquely identified by combination of one
or more fields within a table.
19
Super Key:
 Super Key is defined as a set of attributes within
a table that uniquely identifies each record within a
table.
 Super Key is a superset of Candidate key.
Candidate Key:
 Candidate keys are defined as the set of fields
from which primary key can be selected.
 It is an attribute or set of attributes that can act as
a primary key for a table to uniquely identify each
record in that table.
20
21
 The minimal set of attribute which can uniquely identify a tuple is
known as candidate key.
 For Example, STUD_NO in STUDENT relation.
 The value of Candidate Key is unique and non-null for every tuple.
 There can be more than one candidate key in a relation.
 For Example, STUD_NO as well as STUD_PHONE both are
candidate keys for relation STUDENT.
 The candidate key can be simple (having only one attribute) or
composite as well.
 For Example, {STUD_NO, COURSE_NO} is a composite candidate
key for relation STUDENT_COURSE.
22
 The set of attributes which can uniquely identify a
tuple is known as Super Key.
 For Example, STUD_NO, (STUD_NO,
STUD_NAME) etc.
 Adding zero or more attributes to candidate key
generates super key.
 A candidate key is a super key but vice versa is
not true
23
 There can be more than one candidate key in a
relation out of which one can be chosen as
primary key( that is most appropriate to become
main key of the table)
 For Example, STUD_NO as well as
STUD_PHONE both are candidate keys for
relation STUDENT but STUD_NO can be chosen
as primary key (only one out of many candidate
keys).
24
 The candidate key other than primary key is called
as alternate key.
 For Example, STUD_NO as well as
STUD_PHONE both are candidate keys for
relation STUDENT but STUD_PHONE will be
alternate key (only one out of many candidate
keys).
25
 If we use multiple attributes to create a Primary
Key then that Primary Key is called Composite
Key (also called a Compound Key or
Concatenated Key).
26
 A foreign key is an attribute or combination of attributes
in one base table that points to the candidate key
(generally it is the primary key) of another table.
 The purpose of the foreign key is to ensure referential
integrity of the data
 For Example, STUD_NO in STUDENT_COURSE is a
foreign key to STUD_NO in STUDENT relation.
27
It is very important that data in the underlying tables be
consistent
Two integrity rules:
1. Entity Integrity (feature of primary key)
◦ No column in primary key may be null
◦ Primary key provides the means of uniquely identifying a row or
an entity.
◦ A null value means a value that is not known, not entered, not
defined or not applicable.
28
◦ A zero or space is not considered to be a null
value
◦ RDBMS does not allow users to enter a row
without a unique value in the primary key column
2. Referential Integrity(feature of foreign key)
◦ Foreign key value may be null or it must exist as a value
of a primary key in the referenced table.
◦ Oracle does not allow to declare a foreign key if it does
not exist as a primary key in another table
29
 Relational algebra , a procedural language
 Relational calculus, a non-procedural language
30
31
 Relational algebra is a collection of operations to
manipulate or access tables
 It is a procedural language with operations
performed on one or more existing relations to
derive resulting operations without changing the
original relations.
 The operations can be divided into two groups
 SET-ORIENTED OPERATIONS
 NATIVE(SPECIAL)RELATIONAL
OPERATIONS.
Basics of Relational
Algebra
32
BASIC SET ORIENTED OPERATIONS
NAME SYMBOL
UNION U
INTERSECTION ∩
DIFFERENCE -
PRODUCT ×
NATIVE RELATIONAL OPERATIONS
NAME SYMBOL
SELECTION σ
PROJECTION Π
JOIN
DIVISION ÷
ASSIGNMENT 
33
UNION
ROLL.NO NAME
12505 SHARAN
12506 SANGEETA
12507 SHYNA
A
B
ROLL.NO NAME
12502 PRABJOT
125O7 SHYNA
12520 POOJA
12521 RINKI
ROLL.NO NAME
12502 PRABJOT
12505 SHARAN
12506 SANGEETA
12507 SHYNA
12520 POOJA
12521 RINKI
R=AUB
34
INTERSECTION
ROLL.NO NAME
12502 PRABJOT
12505 SHARAN
12507 SHYNA
12521 RINKI
ROLL.NO NAME
12507 SHYNA
12519 POOJA
12521 RINKI
A
B
R=A∩B
ROLL.NO NAME
12507 SHYNA
12521 RINKI
35
DIFFERENCE
B
A
ROLL.NO NAME
12502 PRABJOT
12505 SHARAN
12507 SHYNA
12521 RINKI
ROLL.NO NAME
12507 SHYNA
12519 POOJA
12514 NEETU
12521 RINKI
R=A-B
ROLL.NO NAME
12502 PRABJOT
12505 SHARAN
R=B-A
ROLL.NO NAME
12519 POOJA
12514 NEETU
36
CARTESIAN PRODUCT
ROLL.NO NAME
12502 PRABJOT
12505 SHARAN
12507 SHYNA
12521 RINKI
A
ROLL.NO NAME
12507 SHYNA
12519 POOJA
B
R=A×B
ROLL.NO NAME ROLL.NO NAME
12502 PRABJOT 12507 SHYNA
12502 PRABJOT 12519 POOJA
12505 SHARAN 12507 SHYNA
12505 SHARAN 12519 POOJA
12507 SHYNA 12507 SHYNA
12507 SHYNA 12519 POOJA
12521 RINKI 12507 SHYNA
12521 RINKI 12521 POOJA
37
ID NAME SALARY AGE
101 AMIT 4500 30
102 AJAY 5000 35
105 JOHN 5000 36
106 ABHI 4000 28
107 ALI 4800 31
108 SUNIL 3500 33
EMPLOYEE
SELECTION
RESULTING TABLE
σAGE >32 (EMPLOYEE)
ID NAME SALARY AGE
102 AJAY 5000 35
105 JOHN 5000 36
108 SUNIL 3500 33
38
PROJECTION
EMPLOYEE
ID NAME SALARY AGE
101 AMIT 4500 30
102 AJAY 5000 35
105 JOHN 5000 36
106 ABHI 4000 28
107 ALI 4800 31
108 SUNIL 3500 33
109 JOHN 4600 29
RESULTING TABLES
A. π ID (EMPLOYEE)
B. π NAME,AGE (EMPLOYEE)
NAME AGE
AMIT 30
AJAY 35
JOHN 36
ABHI 28
ALI 31
SUNIL 33
JOHN 29
ID
101
102
105
106
107
108
109
B
A
39
COURSE(C)
ROLL.NO NAME COURSE
101 PIYUSH M-01
102 SUMIT M-02
103 SHEENA M-04
104 RITU M-03
S
JOIN
C_ID C_NAME C_DUR
M-01 MBA(HR) 2
M-02 MSC(PHY) 2
M-03 MSC(IT) 2
M-04 MCA 3
ROLL.NO NAME COURSE
101 PIYUSH M-01
102 SUMIT M-02
103 SHEENA M-04
104 RITU M-03
C_ID C_NAME C_DUR
M-01 MBA(HR) 2
M-02 MSC(PHY) 2
M-04 MCA 3
M-03 MSC(IT) 2
RESULTING TABLE(EQUI-JOIN)
COURSE=C_ID (C)
STU(S)
40
ROLL.NO NAME COURSE
101 PIYUSH M-01
102 SUMIT M-02
103 SHEENA M-04
104 RITU M-03
C_NAME C_DUR
MBA(HR) 2
MSC(PHY) 2
MCA 3
MSC(IT) 2
COURSE(C)
ROLL.NO NAME COURSE
101 PIYUSH M-01
102 SUMIT M-02
103 SHEENA M-04
104 RITU M-03
C_ID C_NAME C_DUR
M-01 MBA(HR) 2
M-02 MSC(PHY) 2
M-03 MSC(IT) 2
M-04 MCA 3
NATURAL JOIN ON S AND C
NATURAL JOIN(INNER JOIN)
STU(S)
41
DIVISION
NAME COUR
SE
A1 B1
A3 B2
A2 B3
A2 B1
A1 B3
A3 B3
A3 B1
COURSE
B1
B3
COURS
E
B2
COURSE
B2
B3
MAIN
R1
SUB2 SUB3
RESULTING TABLES
R3
R3MAIN÷SUB3
R2
NAME
A1
A2
A3
NAME
A3
NAME
A3
R1MAIN ÷ SUB1
R2MAIN÷SUB2
SUB1
ASSIGNMENT
Eg: Student enrolled in
ALL the courses
 Non Procedural
 Programmer specifies data requirement
 General Syntax:
result=(column list):expression
 Example:
r.Name:r in Employee and r.age<30
 Result:
42
Name
ABHI
JOHN

More Related Content

Similar to NMEC RD_UNIT 1.ppt

Dbms interview questions
Dbms interview questionsDbms interview questions
Dbms interview questionsambika93
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems incMuthu Natarajan
 
Dbms interview ques
Dbms interview quesDbms interview ques
Dbms interview quesSwatiJain303
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsKuntal Bhowmick
 
Dbms 9: Relational Model
Dbms 9: Relational ModelDbms 9: Relational Model
Dbms 9: Relational ModelAmiya9439793168
 
2. Relational_Data_Model_Keys_10b.pptx
2. Relational_Data_Model_Keys_10b.pptx2. Relational_Data_Model_Keys_10b.pptx
2. Relational_Data_Model_Keys_10b.pptxvidyahulkman
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answerssheibansari
 
Eer >r.model
Eer >r.modelEer >r.model
Eer >r.modellavya3
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answersLakshmiSarvani6
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Prosanta Ghosh
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to databasePradnya Saval
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And AnswerJagan Mohan Bishoyi
 

Similar to NMEC RD_UNIT 1.ppt (20)

Codds rules & keys
Codds rules & keysCodds rules & keys
Codds rules & keys
 
Unit 2 DBMS.pptx
Unit 2 DBMS.pptxUnit 2 DBMS.pptx
Unit 2 DBMS.pptx
 
RDBMS
RDBMSRDBMS
RDBMS
 
Dbms interview questions
Dbms interview questionsDbms interview questions
Dbms interview questions
 
Relational model
Relational modelRelational model
Relational model
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
 
Dbms interview ques
Dbms interview quesDbms interview ques
Dbms interview ques
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
Dbms 9: Relational Model
Dbms 9: Relational ModelDbms 9: Relational Model
Dbms 9: Relational Model
 
Unit_2.pdf
Unit_2.pdfUnit_2.pdf
Unit_2.pdf
 
RDBMS_Concept.ppt
RDBMS_Concept.pptRDBMS_Concept.ppt
RDBMS_Concept.ppt
 
2. Relational_Data_Model_Keys_10b.pptx
2. Relational_Data_Model_Keys_10b.pptx2. Relational_Data_Model_Keys_10b.pptx
2. Relational_Data_Model_Keys_10b.pptx
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answers
 
Eer >r.model
Eer >r.modelEer >r.model
Eer >r.model
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answers
 
Bc0041
Bc0041Bc0041
Bc0041
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And Answer
 

Recently uploaded

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 

Recently uploaded (20)

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 

NMEC RD_UNIT 1.ppt

  • 1. 1
  • 2.  A person, place, event or item is called an entity  The facts describing an entity are known as data  Each entity can be described by its characteristics known as attributes  All the related entities are collected together to form an entity set  A database is a collection of entity sets  The interaction between the entity sets are called relationships. 2
  • 3.  A data base is an electronic store of data.  It stores information about different “things”& also contains relationships.  The collection of data may be organized in the form of files or tables. Examples:- 1. Oracle 9i, 10G, 10Gi, 11G, 11Gi 2. SQL-server-2005, 2010 3. DB2,Sybase,foxpro, Ms-access2003,2007, 2010, 3
  • 4.  A DBMS is a software package designed to define, manipulate, retrieve and manage data in a database.  It also defines rules to validate and manipulate the data.  It relieves users of framing programs for data maintenance.  Fourth-generation query languages, such as SQL, are used along with the DBMS package to interact with a database. 4
  • 5. 1. Banking Sector 2. Universities 3. Railway Reservation 4. Finance 5. Sales 5
  • 6. 1. One-to-one (1:1) : Each entity has only one matching entity in another entity set Eg: Student (1) – RollNo. (1) 2. One-to-many (1:M): Each entity of X has many matching entities in another entity set Y. Eg: Department (1) – Employees (M) 3. Many-to-many (M:M): Each entity of X has many matching entities in another entity set Y and vice versa. Eg: Students (M) – Courses (M) 6
  • 7.  DBMS S/W Packages – MS Access, Oracle  User developed & implemented DB  Custom Applications such as forms,Reports,query blocks  Computer hardware – PCs, minicomputers  Software – OS and Network OS  Personnel- DB administrator, designer 7
  • 9.  RDBMS is a DBMS i.e. based on Relational model as introduce by Dr. E.F. Codd…..  Codd’s rule for RDBMS:-  Dr. Codd is an IBM researcher who developed relational data base in 1970….. In 1905 Codd published 12 rules…… 1)The Information rule. 2)Granted access rule. 3)Systemic treatment of NULL values. 4)Dynamic online Catalog based on relational model. 9
  • 10. 5)Comprehensive data sub-language rule. 6)View updating rule. 7)High level Insert , Update, Delete rule. 8)Physical data Independence. 9)Logical data Independence. 10)Integrity data Independence. 11)Distribution data Independence. 12)Non-subversions rule. 10
  • 11. 1. It manages the data and relationships stored in the database. 2. It creates a Data Dictionary (DD) as a user creates a DB. DD stores Metadata (data about data) 3. Manages all day-to-day transactions 4. Data search can be done through DD 5. User can validate data 11
  • 12. 6. Secures access through passwords, encryption etc.. 7. Backup & Recovery procedures 8. Data Sharing with data-locking capabilities 9. Import and Export Utilities from other databases 10. Users can view information stored in different tables within the database. 12
  • 13. 13
  • 14.  E.F.Codd developed the relational model in 1970.  The relation is represented by a table structure  Each row represents an entity  Each column represents an attribute  DATA STRUCTURES - domain, attribute, relation, tuple, primary key, degree, cardinality.  INTEGRITY CONSTRAINTS - entity integrity and referential integrity.  DATA MANIPULATION OPERATIONS - defined through relational algebra and equivalent relational calculus. 14
  • 15.  A database consists of one or more relations.  A relation is described by a name, names for one or more attributes and consists of zero or more tuples.  A tuple consists of values for each attribute of the relation.  An attribute takes values from a domain and there exists one value for each attribute in a tuple.  A domain consists of all allowed atomic values for one or more attributes.  Degree of a relation is the number of attributes of the relation.  Cardinality of a relation is the number of tuples of the relation. 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19.  Keys are very important part of Relational database.  They are used to establish and identify relation between tables.  They also ensure that each record within a table can be uniquely identified by combination of one or more fields within a table. 19
  • 20. Super Key:  Super Key is defined as a set of attributes within a table that uniquely identifies each record within a table.  Super Key is a superset of Candidate key. Candidate Key:  Candidate keys are defined as the set of fields from which primary key can be selected.  It is an attribute or set of attributes that can act as a primary key for a table to uniquely identify each record in that table. 20
  • 21. 21
  • 22.  The minimal set of attribute which can uniquely identify a tuple is known as candidate key.  For Example, STUD_NO in STUDENT relation.  The value of Candidate Key is unique and non-null for every tuple.  There can be more than one candidate key in a relation.  For Example, STUD_NO as well as STUD_PHONE both are candidate keys for relation STUDENT.  The candidate key can be simple (having only one attribute) or composite as well.  For Example, {STUD_NO, COURSE_NO} is a composite candidate key for relation STUDENT_COURSE. 22
  • 23.  The set of attributes which can uniquely identify a tuple is known as Super Key.  For Example, STUD_NO, (STUD_NO, STUD_NAME) etc.  Adding zero or more attributes to candidate key generates super key.  A candidate key is a super key but vice versa is not true 23
  • 24.  There can be more than one candidate key in a relation out of which one can be chosen as primary key( that is most appropriate to become main key of the table)  For Example, STUD_NO as well as STUD_PHONE both are candidate keys for relation STUDENT but STUD_NO can be chosen as primary key (only one out of many candidate keys). 24
  • 25.  The candidate key other than primary key is called as alternate key.  For Example, STUD_NO as well as STUD_PHONE both are candidate keys for relation STUDENT but STUD_PHONE will be alternate key (only one out of many candidate keys). 25
  • 26.  If we use multiple attributes to create a Primary Key then that Primary Key is called Composite Key (also called a Compound Key or Concatenated Key). 26
  • 27.  A foreign key is an attribute or combination of attributes in one base table that points to the candidate key (generally it is the primary key) of another table.  The purpose of the foreign key is to ensure referential integrity of the data  For Example, STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in STUDENT relation. 27
  • 28. It is very important that data in the underlying tables be consistent Two integrity rules: 1. Entity Integrity (feature of primary key) ◦ No column in primary key may be null ◦ Primary key provides the means of uniquely identifying a row or an entity. ◦ A null value means a value that is not known, not entered, not defined or not applicable. 28
  • 29. ◦ A zero or space is not considered to be a null value ◦ RDBMS does not allow users to enter a row without a unique value in the primary key column 2. Referential Integrity(feature of foreign key) ◦ Foreign key value may be null or it must exist as a value of a primary key in the referenced table. ◦ Oracle does not allow to declare a foreign key if it does not exist as a primary key in another table 29
  • 30.  Relational algebra , a procedural language  Relational calculus, a non-procedural language 30
  • 31. 31  Relational algebra is a collection of operations to manipulate or access tables  It is a procedural language with operations performed on one or more existing relations to derive resulting operations without changing the original relations.  The operations can be divided into two groups  SET-ORIENTED OPERATIONS  NATIVE(SPECIAL)RELATIONAL OPERATIONS. Basics of Relational Algebra
  • 32. 32 BASIC SET ORIENTED OPERATIONS NAME SYMBOL UNION U INTERSECTION ∩ DIFFERENCE - PRODUCT × NATIVE RELATIONAL OPERATIONS NAME SYMBOL SELECTION σ PROJECTION Π JOIN DIVISION ÷ ASSIGNMENT 
  • 33. 33 UNION ROLL.NO NAME 12505 SHARAN 12506 SANGEETA 12507 SHYNA A B ROLL.NO NAME 12502 PRABJOT 125O7 SHYNA 12520 POOJA 12521 RINKI ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12506 SANGEETA 12507 SHYNA 12520 POOJA 12521 RINKI R=AUB
  • 34. 34 INTERSECTION ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA 12521 RINKI A B R=A∩B ROLL.NO NAME 12507 SHYNA 12521 RINKI
  • 35. 35 DIFFERENCE B A ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA 12514 NEETU 12521 RINKI R=A-B ROLL.NO NAME 12502 PRABJOT 12505 SHARAN R=B-A ROLL.NO NAME 12519 POOJA 12514 NEETU
  • 36. 36 CARTESIAN PRODUCT ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI A ROLL.NO NAME 12507 SHYNA 12519 POOJA B R=A×B ROLL.NO NAME ROLL.NO NAME 12502 PRABJOT 12507 SHYNA 12502 PRABJOT 12519 POOJA 12505 SHARAN 12507 SHYNA 12505 SHARAN 12519 POOJA 12507 SHYNA 12507 SHYNA 12507 SHYNA 12519 POOJA 12521 RINKI 12507 SHYNA 12521 RINKI 12521 POOJA
  • 37. 37 ID NAME SALARY AGE 101 AMIT 4500 30 102 AJAY 5000 35 105 JOHN 5000 36 106 ABHI 4000 28 107 ALI 4800 31 108 SUNIL 3500 33 EMPLOYEE SELECTION RESULTING TABLE σAGE >32 (EMPLOYEE) ID NAME SALARY AGE 102 AJAY 5000 35 105 JOHN 5000 36 108 SUNIL 3500 33
  • 38. 38 PROJECTION EMPLOYEE ID NAME SALARY AGE 101 AMIT 4500 30 102 AJAY 5000 35 105 JOHN 5000 36 106 ABHI 4000 28 107 ALI 4800 31 108 SUNIL 3500 33 109 JOHN 4600 29 RESULTING TABLES A. π ID (EMPLOYEE) B. π NAME,AGE (EMPLOYEE) NAME AGE AMIT 30 AJAY 35 JOHN 36 ABHI 28 ALI 31 SUNIL 33 JOHN 29 ID 101 102 105 106 107 108 109 B A
  • 39. 39 COURSE(C) ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 S JOIN C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-03 MSC(IT) 2 M-04 MCA 3 ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-04 MCA 3 M-03 MSC(IT) 2 RESULTING TABLE(EQUI-JOIN) COURSE=C_ID (C) STU(S)
  • 40. 40 ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_NAME C_DUR MBA(HR) 2 MSC(PHY) 2 MCA 3 MSC(IT) 2 COURSE(C) ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-03 MSC(IT) 2 M-04 MCA 3 NATURAL JOIN ON S AND C NATURAL JOIN(INNER JOIN) STU(S)
  • 41. 41 DIVISION NAME COUR SE A1 B1 A3 B2 A2 B3 A2 B1 A1 B3 A3 B3 A3 B1 COURSE B1 B3 COURS E B2 COURSE B2 B3 MAIN R1 SUB2 SUB3 RESULTING TABLES R3 R3MAIN÷SUB3 R2 NAME A1 A2 A3 NAME A3 NAME A3 R1MAIN ÷ SUB1 R2MAIN÷SUB2 SUB1 ASSIGNMENT Eg: Student enrolled in ALL the courses
  • 42.  Non Procedural  Programmer specifies data requirement  General Syntax: result=(column list):expression  Example: r.Name:r in Employee and r.age<30  Result: 42 Name ABHI JOHN