SlideShare a Scribd company logo
1 of 18
1
Introduction to Relational
Databases
Hugh Darwen
hugh@dcs.warwick.ac.uk
www.dcs.warwick.ac.uk/~hugh
CS252.HACD: Fundamentals of Relational Databases
Section 1: Introduction
2
Some Preliminaries
The theory taught in this part of the course was originally
devised by Edgar F. Codd in 1969. His seminal paper (1970)
was entitled A Relational Model of Data for Large Shared
Data Banks.
We will use a language called Tutorial D for examples and
exercises.
We will use Rel, an implementation of Tutorial D, for our on-
line work.
3
What Is a Database?
An organised, machine-readable collection
of symbols, to be interpreted as a true
account of some enterprise.
Machine-updatable, too …
… so a database is also a collection of variables.
A database is typically available to a community
of users, with possibly varying requirements.
4
“Organised Collection of
Symbols”
StudentId Name CourseId
S1 Anne C1
S1 Anne C2
S2 Boris C1
S3 Cindy C3
For example:
The symbols are organised into rows and columns, thus
forming a table. One of the rows is different in kind from the
others.
5
“To Be Interpreted as a True
Account”
StudentId Name CourseId
S1 Anne C1
For example (from the table just shown):
“Student S1, named Anne, is enrolled on course C1.”
Perhaps those green symbols, organised as they are with
respect to the blue ones, are to be understood to mean:
6
“Collection of Variables”
StudentId Name CourseId
S1 Anne C1
S1 Anne C2
S2 Boris C1
S3 Cindy C3
S4 Devinder C1
ENROLMENT is a variable. Perhaps the table we saw earlier
was once its value. If so, it (the variable) has been updated
since then (the row for S4 has been added).
ENROLMENT
7
What Is a Relational Database?
A database whose symbols are organised into a
collection of relations. Here is a relation, shown in
tabular form:
Might be the value currently assigned to ENROLMENT, a
relation variable (“relvar”).
StudentId Name CourseId
S1 Anne C1
S1 Anne C2
S2 Boris C1
S3 Cindy C3
S4 Devinder C1
8
“Relation” not equal to “Table”
This table is different from the one we have just seen,
but it represents the same relation:
Name StudentId CourseId
Devinder S4 C1
Cindy S3 C3
Anne S1 C1
Boris S2 C1
Anne S1 C2
In other words, the relation represented does not
depend on the order in which we place the rows or the
columns in the table.
9
Anatomy of a Relation
StudentId Name CourseId
S1 Anne C1
attribute name attribute values n-tuple, or tuple.
This is a 3-tuple.
The tuples
constitute the body
of the relation.
The number of
tuples in the body
is the cardinality of
the relation.
Heading (a set of attributes)
The degree of this heading is 3,
which is also the degree of the relation.
10
What Is a DBMS?
A piece of software for managing databases
and providing access to them.
A DBMS responds to imperatives (“statements”)
given by application programs, custom-written
or general-purpose, executing on behalf of users.
Imperatives are written in the database language
of the DBMS (e.g., SQL).
Responses include completion codes, messages and
results of queries.
11
What Does a DBMS Do?
Now, how does a relational DBMS do these things? …
• creates and destroys variables
• updates variables (honouring constraints and
authorisations)
• takes note of integrity rules (constraints)
• provides results of queries
• takes note of authorisations (who is allowed to do
what, to what)
• and more
In response to requests given by application programs:
12
Create and Destroy Variables
VAR ENROLMENT BASE RELATION
{ StudentId SID ,
Name CHAR,
CourseId CID }
KEY { StudentId, CourseId } ;
Creation (in Tutorial D):
Destruction:
DROP VAR ENROLMENT ;
13
Take Note of Integrity Rules
CONSTRAINT MAX_ENROLMENTS
COUNT ( ENROLMENT ) <= 20000 ;
E.g., can’t have more than 20,000 enrolments altogether. In
Tutorial D:
And if a constraint ceases to be applicable:
DROP CONSTRAINT MAX_ENROLMENTS ;
14
Take Note of Authorisations
PERMISSION U9_ENROLMENT FOR User9
TO READ ENROLMENT ;
E.g. (perhaps – but not in Tutorial D):
Permissions sometimes need to be withdrawn:
DROP PERMISSION U9_ENROLMENT ;
PERMISSION U8_ENROLMENT FOR User8
TO UPDATE ENROLMENT ;
15
Updates Variables
DELETE ENROLMENT WHERE StudentId =
SID ( ‘S4’ ) ;
E.g.:
UPDATE ENROLMENT WHERE StudentId =
SID ( ‘S1’ ) Name := ‘Ann’ ;
INSERT ENROLMENT
RELATION {
TUPLE { StudentId SID ( ‘S4’ ) ,
Name ‘Devinder’ ,
CourseId CID ( ‘C1’ ) } } ;
16
Provides Results of Queries
(ENROLMENT WHERE CourseId = CID(‘C1’))
{ StudentId, Name }
E.g.: Who is enrolled on course C1?
The result is another relation! In tabular form:
StudentId Name
S1 Anne
S2 Boris
S4 Devinder
17
EXERCISE
Consider this table:
A B A
1 2 3
4 5
6 7 8
9 9 ?
1 2 3
Give three reasons why it cannot be representing a relation.
18
IMPORTANT BIT OF ADMIN
Are you:
(a) an overseas student visiting for just one year, or
(b) doing a degree that is completely outside the CS
department? (In which case you should complete an
Unusual Option Form, obtainable from your dept secretary)
If so, on exit from this lecture:
Write your name, ITS userid, and course code on the sheet of
paper provided.
Otherwise you won’t get access to the software needed
for the Worksheets!

More Related Content

Similar to RDB-fundamentals-1-intro.ppt

Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbmsAnjaan Gajendra
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramSiti Ismail
 
Chapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxChapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxBlenKassahun1
 
The Database Environment Chapter 15
The Database Environment Chapter 15The Database Environment Chapter 15
The Database Environment Chapter 15Jeanie Arnoco
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusemailharmeet
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsKuntal Bhowmick
 
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docxL1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docxDIPESH30
 
DATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTESDATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTESsuthi
 
Relational Database & Database Management System
Relational Database & Database Management SystemRelational Database & Database Management System
Relational Database & Database Management SystemNimrakhan89
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-NormalisationAjit Nayak
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...Dipen Parmar
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introductionSmriti Jain
 
2005 fall cs523_lecture_4
2005 fall cs523_lecture_42005 fall cs523_lecture_4
2005 fall cs523_lecture_4abhineetverma
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQLDHAAROUN
 

Similar to RDB-fundamentals-1-intro.ppt (20)

Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Chapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptxChapter Seven- JDBC.pptx
Chapter Seven- JDBC.pptx
 
The Database Environment Chapter 15
The Database Environment Chapter 15The Database Environment Chapter 15
The Database Environment Chapter 15
 
Lecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculusLecture 06 relational algebra and calculus
Lecture 06 relational algebra and calculus
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
Sq lite module3
Sq lite module3Sq lite module3
Sq lite module3
 
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docxL1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
L1 Intro to Relational DBMS LP.pdfIntro to Relational .docx
 
DATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTESDATA BASE MANAGEMENT SYSTEM - SHORT NOTES
DATA BASE MANAGEMENT SYSTEM - SHORT NOTES
 
Relational Database & Database Management System
Relational Database & Database Management SystemRelational Database & Database Management System
Relational Database & Database Management System
 
ERmodel (2).pdf
ERmodel (2).pdfERmodel (2).pdf
ERmodel (2).pdf
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
2005 fall cs523_lecture_4
2005 fall cs523_lecture_42005 fall cs523_lecture_4
2005 fall cs523_lecture_4
 
Unit04 dbms
Unit04 dbmsUnit04 dbms
Unit04 dbms
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 

More from THEFPS

Classification of Lipids By Danish Shafi MIr.pptx
Classification of Lipids By Danish Shafi MIr.pptxClassification of Lipids By Danish Shafi MIr.pptx
Classification of Lipids By Danish Shafi MIr.pptxTHEFPS
 
Types of Operating System
Types of Operating SystemTypes of Operating System
Types of Operating SystemTHEFPS
 
1.3.6 Autoimmune disease.pptx
1.3.6 Autoimmune disease.pptx1.3.6 Autoimmune disease.pptx
1.3.6 Autoimmune disease.pptxTHEFPS
 
OS powerpoint
OS powerpointOS powerpoint
OS powerpointTHEFPS
 
Super Computers
Super ComputersSuper Computers
Super ComputersTHEFPS
 
Lecture 1.1.2-DNA(1).pptx
Lecture 1.1.2-DNA(1).pptxLecture 1.1.2-DNA(1).pptx
Lecture 1.1.2-DNA(1).pptxTHEFPS
 
Updated_rdbms-161216100344 (1).pptx
Updated_rdbms-161216100344 (1).pptxUpdated_rdbms-161216100344 (1).pptx
Updated_rdbms-161216100344 (1).pptxTHEFPS
 
RDBMS BY DANISH SHAFI MIR.pptx
RDBMS BY DANISH SHAFI MIR.pptxRDBMS BY DANISH SHAFI MIR.pptx
RDBMS BY DANISH SHAFI MIR.pptxTHEFPS
 
MICROBIOLOGY 22MBI20019_2.pptx
MICROBIOLOGY 22MBI20019_2.pptxMICROBIOLOGY 22MBI20019_2.pptx
MICROBIOLOGY 22MBI20019_2.pptxTHEFPS
 
lipidsu-160413072006.pptx
lipidsu-160413072006.pptxlipidsu-160413072006.pptx
lipidsu-160413072006.pptxTHEFPS
 
Presentation.HTML.pptx
Presentation.HTML.pptxPresentation.HTML.pptx
Presentation.HTML.pptxTHEFPS
 
Concept of Genes by Danish Shafi Mir 22MBI20005.pptx
Concept of Genes by Danish Shafi Mir 22MBI20005.pptxConcept of Genes by Danish Shafi Mir 22MBI20005.pptx
Concept of Genes by Danish Shafi Mir 22MBI20005.pptxTHEFPS
 

More from THEFPS (12)

Classification of Lipids By Danish Shafi MIr.pptx
Classification of Lipids By Danish Shafi MIr.pptxClassification of Lipids By Danish Shafi MIr.pptx
Classification of Lipids By Danish Shafi MIr.pptx
 
Types of Operating System
Types of Operating SystemTypes of Operating System
Types of Operating System
 
1.3.6 Autoimmune disease.pptx
1.3.6 Autoimmune disease.pptx1.3.6 Autoimmune disease.pptx
1.3.6 Autoimmune disease.pptx
 
OS powerpoint
OS powerpointOS powerpoint
OS powerpoint
 
Super Computers
Super ComputersSuper Computers
Super Computers
 
Lecture 1.1.2-DNA(1).pptx
Lecture 1.1.2-DNA(1).pptxLecture 1.1.2-DNA(1).pptx
Lecture 1.1.2-DNA(1).pptx
 
Updated_rdbms-161216100344 (1).pptx
Updated_rdbms-161216100344 (1).pptxUpdated_rdbms-161216100344 (1).pptx
Updated_rdbms-161216100344 (1).pptx
 
RDBMS BY DANISH SHAFI MIR.pptx
RDBMS BY DANISH SHAFI MIR.pptxRDBMS BY DANISH SHAFI MIR.pptx
RDBMS BY DANISH SHAFI MIR.pptx
 
MICROBIOLOGY 22MBI20019_2.pptx
MICROBIOLOGY 22MBI20019_2.pptxMICROBIOLOGY 22MBI20019_2.pptx
MICROBIOLOGY 22MBI20019_2.pptx
 
lipidsu-160413072006.pptx
lipidsu-160413072006.pptxlipidsu-160413072006.pptx
lipidsu-160413072006.pptx
 
Presentation.HTML.pptx
Presentation.HTML.pptxPresentation.HTML.pptx
Presentation.HTML.pptx
 
Concept of Genes by Danish Shafi Mir 22MBI20005.pptx
Concept of Genes by Danish Shafi Mir 22MBI20005.pptxConcept of Genes by Danish Shafi Mir 22MBI20005.pptx
Concept of Genes by Danish Shafi Mir 22MBI20005.pptx
 

Recently uploaded

PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...Sérgio Sacani
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.Nitya salvi
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksSérgio Sacani
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxRizalinePalanog2
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxFarihaAbdulRasheed
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)Areesha Ahmad
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)Areesha Ahmad
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLkantirani197
 
Creating and Analyzing Definitive Screening Designs
Creating and Analyzing Definitive Screening DesignsCreating and Analyzing Definitive Screening Designs
Creating and Analyzing Definitive Screening DesignsNurulAfiqah307317
 
Botany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfBotany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfSumit Kumar yadav
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfrohankumarsinghrore1
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticssakshisoni2385
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and ClassificationsAreesha Ahmad
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsSérgio Sacani
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfSumit Kumar yadav
 

Recently uploaded (20)

PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
All-domain Anomaly Resolution Office U.S. Department of Defense (U) Case: “Eg...
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Creating and Analyzing Definitive Screening Designs
Creating and Analyzing Definitive Screening DesignsCreating and Analyzing Definitive Screening Designs
Creating and Analyzing Definitive Screening Designs
 
Botany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfBotany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdf
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 

RDB-fundamentals-1-intro.ppt

  • 1. 1 Introduction to Relational Databases Hugh Darwen hugh@dcs.warwick.ac.uk www.dcs.warwick.ac.uk/~hugh CS252.HACD: Fundamentals of Relational Databases Section 1: Introduction
  • 2. 2 Some Preliminaries The theory taught in this part of the course was originally devised by Edgar F. Codd in 1969. His seminal paper (1970) was entitled A Relational Model of Data for Large Shared Data Banks. We will use a language called Tutorial D for examples and exercises. We will use Rel, an implementation of Tutorial D, for our on- line work.
  • 3. 3 What Is a Database? An organised, machine-readable collection of symbols, to be interpreted as a true account of some enterprise. Machine-updatable, too … … so a database is also a collection of variables. A database is typically available to a community of users, with possibly varying requirements.
  • 4. 4 “Organised Collection of Symbols” StudentId Name CourseId S1 Anne C1 S1 Anne C2 S2 Boris C1 S3 Cindy C3 For example: The symbols are organised into rows and columns, thus forming a table. One of the rows is different in kind from the others.
  • 5. 5 “To Be Interpreted as a True Account” StudentId Name CourseId S1 Anne C1 For example (from the table just shown): “Student S1, named Anne, is enrolled on course C1.” Perhaps those green symbols, organised as they are with respect to the blue ones, are to be understood to mean:
  • 6. 6 “Collection of Variables” StudentId Name CourseId S1 Anne C1 S1 Anne C2 S2 Boris C1 S3 Cindy C3 S4 Devinder C1 ENROLMENT is a variable. Perhaps the table we saw earlier was once its value. If so, it (the variable) has been updated since then (the row for S4 has been added). ENROLMENT
  • 7. 7 What Is a Relational Database? A database whose symbols are organised into a collection of relations. Here is a relation, shown in tabular form: Might be the value currently assigned to ENROLMENT, a relation variable (“relvar”). StudentId Name CourseId S1 Anne C1 S1 Anne C2 S2 Boris C1 S3 Cindy C3 S4 Devinder C1
  • 8. 8 “Relation” not equal to “Table” This table is different from the one we have just seen, but it represents the same relation: Name StudentId CourseId Devinder S4 C1 Cindy S3 C3 Anne S1 C1 Boris S2 C1 Anne S1 C2 In other words, the relation represented does not depend on the order in which we place the rows or the columns in the table.
  • 9. 9 Anatomy of a Relation StudentId Name CourseId S1 Anne C1 attribute name attribute values n-tuple, or tuple. This is a 3-tuple. The tuples constitute the body of the relation. The number of tuples in the body is the cardinality of the relation. Heading (a set of attributes) The degree of this heading is 3, which is also the degree of the relation.
  • 10. 10 What Is a DBMS? A piece of software for managing databases and providing access to them. A DBMS responds to imperatives (“statements”) given by application programs, custom-written or general-purpose, executing on behalf of users. Imperatives are written in the database language of the DBMS (e.g., SQL). Responses include completion codes, messages and results of queries.
  • 11. 11 What Does a DBMS Do? Now, how does a relational DBMS do these things? … • creates and destroys variables • updates variables (honouring constraints and authorisations) • takes note of integrity rules (constraints) • provides results of queries • takes note of authorisations (who is allowed to do what, to what) • and more In response to requests given by application programs:
  • 12. 12 Create and Destroy Variables VAR ENROLMENT BASE RELATION { StudentId SID , Name CHAR, CourseId CID } KEY { StudentId, CourseId } ; Creation (in Tutorial D): Destruction: DROP VAR ENROLMENT ;
  • 13. 13 Take Note of Integrity Rules CONSTRAINT MAX_ENROLMENTS COUNT ( ENROLMENT ) <= 20000 ; E.g., can’t have more than 20,000 enrolments altogether. In Tutorial D: And if a constraint ceases to be applicable: DROP CONSTRAINT MAX_ENROLMENTS ;
  • 14. 14 Take Note of Authorisations PERMISSION U9_ENROLMENT FOR User9 TO READ ENROLMENT ; E.g. (perhaps – but not in Tutorial D): Permissions sometimes need to be withdrawn: DROP PERMISSION U9_ENROLMENT ; PERMISSION U8_ENROLMENT FOR User8 TO UPDATE ENROLMENT ;
  • 15. 15 Updates Variables DELETE ENROLMENT WHERE StudentId = SID ( ‘S4’ ) ; E.g.: UPDATE ENROLMENT WHERE StudentId = SID ( ‘S1’ ) Name := ‘Ann’ ; INSERT ENROLMENT RELATION { TUPLE { StudentId SID ( ‘S4’ ) , Name ‘Devinder’ , CourseId CID ( ‘C1’ ) } } ;
  • 16. 16 Provides Results of Queries (ENROLMENT WHERE CourseId = CID(‘C1’)) { StudentId, Name } E.g.: Who is enrolled on course C1? The result is another relation! In tabular form: StudentId Name S1 Anne S2 Boris S4 Devinder
  • 17. 17 EXERCISE Consider this table: A B A 1 2 3 4 5 6 7 8 9 9 ? 1 2 3 Give three reasons why it cannot be representing a relation.
  • 18. 18 IMPORTANT BIT OF ADMIN Are you: (a) an overseas student visiting for just one year, or (b) doing a degree that is completely outside the CS department? (In which case you should complete an Unusual Option Form, obtainable from your dept secretary) If so, on exit from this lecture: Write your name, ITS userid, and course code on the sheet of paper provided. Otherwise you won’t get access to the software needed for the Worksheets!

Editor's Notes

  1. 05/01/2023
  2. 05/01/2023
  3. 05/01/2023
  4. 05/01/2023
  5. 05/01/2023
  6. 05/01/2023
  7. 05/01/2023
  8. 05/01/2023
  9. 05/01/2023
  10. 05/01/2023
  11. 05/01/2023
  12. 05/01/2023
  13. 05/01/2023
  14. 05/01/2023
  15. 05/01/2023
  16. 05/01/2023
  17. 05/01/2023
  18. 05/01/2023