SlideShare a Scribd company logo
1 of 32
Unit II
• Introduction to Relational
Database – Relational
Database terms: Records –
Fields Tables – Advantage and
disadvantage of Relational
Database.
Relational Database
Presented by
V.Santhi,
Department of Computer Application,
Bon Secours College for women,
Thanjavur
Relational Database
• The 'Relational Database Model is the most
common model in industry today.
• A relational database is based on the relational
model developed by E.F. Codd.
• A relational database allows the definition of data
structures, storage and retrieval operations and
integrity constraints.
• In relational database the data and relations
between them are organized into tables. A table
is a collection of records and each record in a
table contains the same fields.
Database terms
 A database is a collection of data
 Data is organised into one or more tables
 Each row is a record
 Each column is a field
Name Role Town
record 1 Peter farmer Oxford
record 2 Mary weaver Winch
record 3 Seth drover Bristol
Relational model
 Data are organized in two-dimensional tables called
relations.
 The tables are related to each other.
 The most popular model.
Relation
 Name – each relation in a relational database should have a name that is
unique among other relations.
 Attribute – each column in a relation.
 The degree of the relation – the total number of attributes for a relation.
 Tuple – each row in a relation.
 The cardinality of the relation – the total number of rows in a relation.
Tables  Relation
Rows Tuples
Columns Attributes
To Design Relational Database
• Decide on the fields
• Think of all the facts that will be collected
• plenty of fields
• consult widely
• small facts, “atomic”
Designing the tables
 Plan it on paper first
 Choose the fields, then group them in tables
Designing the tables
People
Surname Wilson Temple Sterling Elliott
First name Adam Thos Oliver Justin
Middle initial(s) T G J K W
Date of birth 3/8/1697 6/10/1705 23/5/1720 24/2/1718
…
Place Born France London landowner
Types of data
Set a data type
for each field:
Text, Number,
Date/time,
Currency, Yes/No
People
Surname text
First name text
Middle initial(s) text
Date of birth date
…
Mobile No Number
Books
Title text
Author text
DatePub date
…
Place text
ISBN text
…
…
An example scenario
 And what information might we want to know about
each of these things?
 Names
 Dates
 Places
 Where we got the information from
Person
Surname
First name
Middle initial(s)
Date of birth
Notes
Publication
Title
Author(s)
Publisher
Date of publication
Place of publication
Edition
Format
Type of publication
Price
Sales
Notes
Publisher
Name
Staff
Founded
Ceased
Address
Notes
Reference
Author(s)
Title
Date of publication
Edition
Volume
Page(s)
URL
Notes
Primary key
 Each table needs a primary key
 Choose (at least) one field that only contains
unique values
 Commonly an auto-incrementing whole (integer) number
Person
PersonID
Surname
First name
Middle initial(s)
Date of birth
Notes
Publication
PubnID
Title
Author(s)
Publisher
Date of publication
Place of publication
Edition
Format
Type of publication
Price
Sales
Notes
Publisher
PublisherID
Name
Staff
Founded
Ceased
Address
Notes
Reference
ReferenceID
Author(s)
Title
Date of publication
Edition
Volume
Page(s)
URL
Notes
Relating two tables - joins
 Mark the field that links this table to that table
 Draw join lines
 Convenient to have same or similar field names
Publication
PubnID
Title
Author
Publisher
Date of publication
Place of publication
Edition
Format
Type of publication
Price
Reference
PageInReference
Publisher
PublisherID
Name
Staff
Founded
Ceased
Address
Reference
PageInReference
Reference
ReferenceID
Author(s)
Title
Date of publication
Edition
Volume
Page(s)
URL
Notes
Person
PersonID
Surname
First name
Middle initial(s)
Date of birth
Notes
Reference
∞
PageInReference
1
∞
1
∞
∞
8 July,
2016
Page 16
Digital Humanities Summer School-
An Introduction to RelationalDatabases
Publication
PubnID
Title
Author(s)
Publisher
Date of publication
Place of publication
Edition
Format
Type of publication
Price
Reference
PageInReference
∞
1
1
Person
PersonID
Surname
First name
Middle initial(s)
Date of birth
Notes
Reference
PageInReference
Publisher
PublisherID
Name
Staff
Founded
Ceased
Address
Reference
PageInReference
Reference
ReferenceID
Author(s)
Title
Date of publication
Edition
Volume
Page(s)
URL
Notes
1
∞
1
∞
∞
∞
Authorship
ID
Author
Publication
∞
8 July,
2016
Page 17
Digital Humanities Summer School-
An Introduction to RelationalDatabases
Publication
Int
Title Text
Publisher INT
Date of
publication
Int?
Place of
publication
Text
Edition Int
Format Text
Type
publi
of Text
Price
cation
Dec?
Int?
Reference Int
Page Text
Notes Text
8 July, 2016
Page 36
on
Publisher
Int
Name Text
Founded Int?
Ceased Int?
Address Text
Reference Int
ageP
Notes Text
Reference
ID Int
Title Text
Date of
publication
Int?
Edition Int?
Volume Int?
URL Text
Notes Text
1 ID
∞
1
∞
Text∞
∞
Publisher_Staff
ID Int
Publisher
Sales
Int
Int
Reference_Author
ID Int
Reference Int
Int
∞
?
∞
Authorship
ID Int
Author Int
Publication Int
Per s
1
AuthorID Int
Surname Text
First name Text
Middle
initial(s)
Text
Date of birth Date
Reference Int
Page Text
Notes Text
1 ID
∞Staff_Member
∞
∞
∞Reference_Author
Properties of the Relational database
model
Properties of Relational Tables:
• 1. Data is presented as a collection of
relations.
• 2. Each relation is depicted as a table.
• 3. Columns are attributes that belong to the
entity modeled by the table (ex. In a student
table, you could have name, address, student
ID, major, etc.).
Properties of the Relational database
model
• 4. Each row ("tuple") represents a single entity
(ex. In a student table, John Smith, 14 Oak
St,9002342, Accounting, would represent one
student entity).
• 5. Every table has a set of attributes that taken
together as a "key" (technically, a "superkey")
uniquely identifies each entity (Ex. In the student
table, “student ID” would uniquely identify each
student – no two students would have the same
student ID).
Database design: A workflow
Operations on relations
• In a relational database, we can define several operations to
create new relations out of the existing ones.
• Basic operations:
– Insert
– Delete
– Update
– Select
– Project
– Join
– Union
– Intersection
– Difference
Insert operation
 An unary operation.
 Insert a new tuple into the relation.
Delete operation
 An unary operation.
 Delete a tuple defined by a criterion from the relation.
Update operation
 An unary operation.
 Changes the value of some attributes of a tuple.
Select operation
 An unary operation.
 It is applied to one single relation and creates another relation.
 The tuples in the resulting relation are a subset of the tuples in
the original relation.
 Use some criteria to select
Project operation
 An unary operation.
 It is applied to one single relation and creates another relation.
 The attributes in the resulting relation are a subset of the
attributes in the original relation.
Join operation
 A binary operation.
 Combines two relations based on common attributes.
Union operation
 A binary operation.
 Creates a new relation in which each tuple is either in the first
relation, in the second, or in both.
 The two relations must have the same attributes.
Intersection operation
 A binary operation.
 Creates a new relation in which each tuple is a member in both
relations.
 The two relations must have the same attributes.
Difference operation
 A binary operation.
 Creates a new relation in which each tuple is in the first relation
but not the second.
 The two relations must have the same attributes.
https://tinyurl.com/oracle-attendance

More Related Content

What's hot

Type of database models
Type of database modelsType of database models
Type of database modelsSanthiNivas
 
Types of databases
Types of databasesTypes of databases
Types of databasesPAQUIAAIZEL
 
Relational database
Relational database Relational database
Relational database Megha Sharma
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Userssontumax
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional ModelingSunita Sahu
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database systemphilipsinter
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentationsameerraaj
 
Data indexing presentation
Data indexing presentationData indexing presentation
Data indexing presentationgmbmanikandan
 
Database systems
Database systemsDatabase systems
Database systemsDhani Ahmad
 
Relational Databases
Relational DatabasesRelational Databases
Relational DatabasesJason Hando
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to databaseArpee Callejo
 

What's hot (20)

Data mining notes
Data mining notesData mining notes
Data mining notes
 
Type of database models
Type of database modelsType of database models
Type of database models
 
Types of databases
Types of databasesTypes of databases
Types of databases
 
Relational database
Relational database Relational database
Relational database
 
Database schema
Database schemaDatabase schema
Database schema
 
DBMS Bascis
DBMS BascisDBMS Bascis
DBMS Bascis
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
File organisation
File organisationFile organisation
File organisation
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Users
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database system
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
 
Data indexing presentation
Data indexing presentationData indexing presentation
Data indexing presentation
 
Database systems
Database systemsDatabase systems
Database systems
 
Relational Databases
Relational DatabasesRelational Databases
Relational Databases
 
Relational databases
Relational databasesRelational databases
Relational databases
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Data models
Data modelsData models
Data models
 
Data Base Management System
Data Base Management SystemData Base Management System
Data Base Management System
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
 

Similar to Relational database

Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
Literature review and refering system
Literature review and refering systemLiterature review and refering system
Literature review and refering systemchristenashantaram
 
chapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfchapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfMisganawAbeje1
 
Overview for referencing in written reports, essays and as.docx
Overview for referencing in written reports, essays and as.docxOverview for referencing in written reports, essays and as.docx
Overview for referencing in written reports, essays and as.docxjacksnathalie
 
IEEE Citation Style Guide Any citation style is set up to.docx
IEEE Citation Style Guide  Any citation style is set up to.docxIEEE Citation Style Guide  Any citation style is set up to.docx
IEEE Citation Style Guide Any citation style is set up to.docxwilcockiris
 
Introduction to Referencing using UCT Author-Date Style
Introduction to Referencing using UCT Author-Date StyleIntroduction to Referencing using UCT Author-Date Style
Introduction to Referencing using UCT Author-Date Stylemchiware
 
Database Management System
Database Management System Database Management System
Database Management System FellowBuddy.com
 
Last But Not Least - Managing The Indexing Process
Last But Not Least  - Managing The Indexing ProcessLast But Not Least  - Managing The Indexing Process
Last But Not Least - Managing The Indexing ProcessFred Leise
 
Relational Databases 2
Relational Databases 2Relational Databases 2
Relational Databases 2Jason Hando
 
Research workshop presentation unisa
Research workshop presentation unisaResearch workshop presentation unisa
Research workshop presentation unisaerasmus01
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxJasmineMichael1
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
EntityrelationshipmodelEnes Bolfidan
 
Avoiding Plagiariarism and using MLA Citation
Avoiding Plagiariarism and using MLA CitationAvoiding Plagiariarism and using MLA Citation
Avoiding Plagiariarism and using MLA Citationstj2009
 

Similar to Relational database (20)

DHOxSS 2014 - Introduction to Relational Databases
DHOxSS 2014 - Introduction to Relational DatabasesDHOxSS 2014 - Introduction to Relational Databases
DHOxSS 2014 - Introduction to Relational Databases
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
Referencing guideline 2
Referencing guideline 2Referencing guideline 2
Referencing guideline 2
 
Literature review and refering system
Literature review and refering systemLiterature review and refering system
Literature review and refering system
 
chapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfchapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdf
 
Data modeling
Data modelingData modeling
Data modeling
 
Overview for referencing in written reports, essays and as.docx
Overview for referencing in written reports, essays and as.docxOverview for referencing in written reports, essays and as.docx
Overview for referencing in written reports, essays and as.docx
 
IEEE Citation Style Guide Any citation style is set up to.docx
IEEE Citation Style Guide  Any citation style is set up to.docxIEEE Citation Style Guide  Any citation style is set up to.docx
IEEE Citation Style Guide Any citation style is set up to.docx
 
Introduction to Referencing using UCT Author-Date Style
Introduction to Referencing using UCT Author-Date StyleIntroduction to Referencing using UCT Author-Date Style
Introduction to Referencing using UCT Author-Date Style
 
Database part3-
Database part3-Database part3-
Database part3-
 
Database Management System
Database Management System Database Management System
Database Management System
 
Last But Not Least - Managing The Indexing Process
Last But Not Least  - Managing The Indexing ProcessLast But Not Least  - Managing The Indexing Process
Last But Not Least - Managing The Indexing Process
 
Relational Databases 2
Relational Databases 2Relational Databases 2
Relational Databases 2
 
Research workshop presentation unisa
Research workshop presentation unisaResearch workshop presentation unisa
Research workshop presentation unisa
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
Entityrelationshipmodel
 
Avoiding Plagiariarism and using MLA Citation
Avoiding Plagiariarism and using MLA CitationAvoiding Plagiariarism and using MLA Citation
Avoiding Plagiariarism and using MLA Citation
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
Database design
Database designDatabase design
Database design
 

More from SanthiNivas

exception-handling-in-java.ppt
exception-handling-in-java.pptexception-handling-in-java.ppt
exception-handling-in-java.pptSanthiNivas
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.pptSanthiNivas
 
static methods.pptx
static methods.pptxstatic methods.pptx
static methods.pptxSanthiNivas
 
transmission media.ppt
transmission media.ppttransmission media.ppt
transmission media.pptSanthiNivas
 
Internet Basics Presentation.pptx
Internet Basics Presentation.pptxInternet Basics Presentation.pptx
Internet Basics Presentation.pptxSanthiNivas
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptxSanthiNivas
 
Output Devices.pptx
Output Devices.pptxOutput Devices.pptx
Output Devices.pptxSanthiNivas
 
Input Devices.pptx
Input Devices.pptxInput Devices.pptx
Input Devices.pptxSanthiNivas
 
Operating System File Management Unit v.pptx
Operating System File Management Unit v.pptxOperating System File Management Unit v.pptx
Operating System File Management Unit v.pptxSanthiNivas
 
Input and Output Devices
Input and Output DevicesInput and Output Devices
Input and Output DevicesSanthiNivas
 
DDA ALGORITHM.pdf
DDA ALGORITHM.pdfDDA ALGORITHM.pdf
DDA ALGORITHM.pdfSanthiNivas
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2SanthiNivas
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsSanthiNivas
 
Page Layout and Background
Page Layout and BackgroundPage Layout and Background
Page Layout and BackgroundSanthiNivas
 
3-D Transformation in Computer Graphics
3-D Transformation in Computer Graphics3-D Transformation in Computer Graphics
3-D Transformation in Computer GraphicsSanthiNivas
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODSSanthiNivas
 

More from SanthiNivas (20)

packages.ppt
packages.pptpackages.ppt
packages.ppt
 
exception-handling-in-java.ppt
exception-handling-in-java.pptexception-handling-in-java.ppt
exception-handling-in-java.ppt
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
 
static methods.pptx
static methods.pptxstatic methods.pptx
static methods.pptx
 
Topologies.ppt
Topologies.pptTopologies.ppt
Topologies.ppt
 
transmission media.ppt
transmission media.ppttransmission media.ppt
transmission media.ppt
 
Internet Basics Presentation.pptx
Internet Basics Presentation.pptxInternet Basics Presentation.pptx
Internet Basics Presentation.pptx
 
Topologies.ppt
Topologies.pptTopologies.ppt
Topologies.ppt
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
 
Output Devices.pptx
Output Devices.pptxOutput Devices.pptx
Output Devices.pptx
 
Input Devices.pptx
Input Devices.pptxInput Devices.pptx
Input Devices.pptx
 
Operating System File Management Unit v.pptx
Operating System File Management Unit v.pptxOperating System File Management Unit v.pptx
Operating System File Management Unit v.pptx
 
Input and Output Devices
Input and Output DevicesInput and Output Devices
Input and Output Devices
 
HTML
HTMLHTML
HTML
 
DDA ALGORITHM.pdf
DDA ALGORITHM.pdfDDA ALGORITHM.pdf
DDA ALGORITHM.pdf
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Page Layout and Background
Page Layout and BackgroundPage Layout and Background
Page Layout and Background
 
3-D Transformation in Computer Graphics
3-D Transformation in Computer Graphics3-D Transformation in Computer Graphics
3-D Transformation in Computer Graphics
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODS
 

Recently uploaded

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 - 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
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
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
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
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
 

Recently uploaded (20)

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 - 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
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.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
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
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
 

Relational database

  • 1. Unit II • Introduction to Relational Database – Relational Database terms: Records – Fields Tables – Advantage and disadvantage of Relational Database.
  • 2. Relational Database Presented by V.Santhi, Department of Computer Application, Bon Secours College for women, Thanjavur
  • 3. Relational Database • The 'Relational Database Model is the most common model in industry today. • A relational database is based on the relational model developed by E.F. Codd. • A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. • In relational database the data and relations between them are organized into tables. A table is a collection of records and each record in a table contains the same fields.
  • 4. Database terms  A database is a collection of data  Data is organised into one or more tables  Each row is a record  Each column is a field Name Role Town record 1 Peter farmer Oxford record 2 Mary weaver Winch record 3 Seth drover Bristol
  • 5. Relational model  Data are organized in two-dimensional tables called relations.  The tables are related to each other.  The most popular model.
  • 6. Relation  Name – each relation in a relational database should have a name that is unique among other relations.  Attribute – each column in a relation.  The degree of the relation – the total number of attributes for a relation.  Tuple – each row in a relation.  The cardinality of the relation – the total number of rows in a relation. Tables  Relation Rows Tuples Columns Attributes
  • 7. To Design Relational Database • Decide on the fields • Think of all the facts that will be collected • plenty of fields • consult widely • small facts, “atomic”
  • 8. Designing the tables  Plan it on paper first  Choose the fields, then group them in tables
  • 9. Designing the tables People Surname Wilson Temple Sterling Elliott First name Adam Thos Oliver Justin Middle initial(s) T G J K W Date of birth 3/8/1697 6/10/1705 23/5/1720 24/2/1718 … Place Born France London landowner
  • 10. Types of data Set a data type for each field: Text, Number, Date/time, Currency, Yes/No People Surname text First name text Middle initial(s) text Date of birth date … Mobile No Number Books Title text Author text DatePub date … Place text ISBN text … …
  • 11. An example scenario  And what information might we want to know about each of these things?  Names  Dates  Places  Where we got the information from
  • 12. Person Surname First name Middle initial(s) Date of birth Notes Publication Title Author(s) Publisher Date of publication Place of publication Edition Format Type of publication Price Sales Notes Publisher Name Staff Founded Ceased Address Notes Reference Author(s) Title Date of publication Edition Volume Page(s) URL Notes
  • 13. Primary key  Each table needs a primary key  Choose (at least) one field that only contains unique values  Commonly an auto-incrementing whole (integer) number
  • 14. Person PersonID Surname First name Middle initial(s) Date of birth Notes Publication PubnID Title Author(s) Publisher Date of publication Place of publication Edition Format Type of publication Price Sales Notes Publisher PublisherID Name Staff Founded Ceased Address Notes Reference ReferenceID Author(s) Title Date of publication Edition Volume Page(s) URL Notes
  • 15. Relating two tables - joins  Mark the field that links this table to that table  Draw join lines  Convenient to have same or similar field names
  • 16. Publication PubnID Title Author Publisher Date of publication Place of publication Edition Format Type of publication Price Reference PageInReference Publisher PublisherID Name Staff Founded Ceased Address Reference PageInReference Reference ReferenceID Author(s) Title Date of publication Edition Volume Page(s) URL Notes Person PersonID Surname First name Middle initial(s) Date of birth Notes Reference ∞ PageInReference 1 ∞ 1 ∞ ∞ 8 July, 2016 Page 16 Digital Humanities Summer School- An Introduction to RelationalDatabases
  • 17. Publication PubnID Title Author(s) Publisher Date of publication Place of publication Edition Format Type of publication Price Reference PageInReference ∞ 1 1 Person PersonID Surname First name Middle initial(s) Date of birth Notes Reference PageInReference Publisher PublisherID Name Staff Founded Ceased Address Reference PageInReference Reference ReferenceID Author(s) Title Date of publication Edition Volume Page(s) URL Notes 1 ∞ 1 ∞ ∞ ∞ Authorship ID Author Publication ∞ 8 July, 2016 Page 17 Digital Humanities Summer School- An Introduction to RelationalDatabases
  • 18. Publication Int Title Text Publisher INT Date of publication Int? Place of publication Text Edition Int Format Text Type publi of Text Price cation Dec? Int? Reference Int Page Text Notes Text 8 July, 2016 Page 36 on Publisher Int Name Text Founded Int? Ceased Int? Address Text Reference Int ageP Notes Text Reference ID Int Title Text Date of publication Int? Edition Int? Volume Int? URL Text Notes Text 1 ID ∞ 1 ∞ Text∞ ∞ Publisher_Staff ID Int Publisher Sales Int Int Reference_Author ID Int Reference Int Int ∞ ? ∞ Authorship ID Int Author Int Publication Int Per s 1 AuthorID Int Surname Text First name Text Middle initial(s) Text Date of birth Date Reference Int Page Text Notes Text 1 ID ∞Staff_Member ∞ ∞ ∞Reference_Author
  • 19. Properties of the Relational database model Properties of Relational Tables: • 1. Data is presented as a collection of relations. • 2. Each relation is depicted as a table. • 3. Columns are attributes that belong to the entity modeled by the table (ex. In a student table, you could have name, address, student ID, major, etc.).
  • 20. Properties of the Relational database model • 4. Each row ("tuple") represents a single entity (ex. In a student table, John Smith, 14 Oak St,9002342, Accounting, would represent one student entity). • 5. Every table has a set of attributes that taken together as a "key" (technically, a "superkey") uniquely identifies each entity (Ex. In the student table, “student ID” would uniquely identify each student – no two students would have the same student ID).
  • 21. Database design: A workflow
  • 22. Operations on relations • In a relational database, we can define several operations to create new relations out of the existing ones. • Basic operations: – Insert – Delete – Update – Select – Project – Join – Union – Intersection – Difference
  • 23. Insert operation  An unary operation.  Insert a new tuple into the relation.
  • 24. Delete operation  An unary operation.  Delete a tuple defined by a criterion from the relation.
  • 25. Update operation  An unary operation.  Changes the value of some attributes of a tuple.
  • 26. Select operation  An unary operation.  It is applied to one single relation and creates another relation.  The tuples in the resulting relation are a subset of the tuples in the original relation.  Use some criteria to select
  • 27. Project operation  An unary operation.  It is applied to one single relation and creates another relation.  The attributes in the resulting relation are a subset of the attributes in the original relation.
  • 28. Join operation  A binary operation.  Combines two relations based on common attributes.
  • 29. Union operation  A binary operation.  Creates a new relation in which each tuple is either in the first relation, in the second, or in both.  The two relations must have the same attributes.
  • 30. Intersection operation  A binary operation.  Creates a new relation in which each tuple is a member in both relations.  The two relations must have the same attributes.
  • 31. Difference operation  A binary operation.  Creates a new relation in which each tuple is in the first relation but not the second.  The two relations must have the same attributes.