A relational database is a type of database that
organizes data into tables called relations.
•Each table consists of rows (records) and columns
(fields).
•This model was introduced by Edgar F. Codd in
1970.
•Relational databases are widely used for
structured data storage and management.
1.Tables: Store data in rows and columns.
2.Primary Key: A unique identifier for each row
in a table.
3.Foreign Key: A field in one table that links to
the primary key in another table.
4.Indexes: Improve query performance.
5.Schemas: Define the structure of tables and
relationships.
Components of a Relational Database
Relational Data Model
Relations are stored in tables
e.g. Sponsor(Name,Bill)
Sponsor
Name Bill
Bahbit Tax
Sulgun Defense
Serdar Defense
Palwan Commerc
e
Atrributes
Tuples
Schemas
A relation schema is a relation name
and a list of attributes
Sponsor(Name,Bill)
A database is a collection of relations
A database schema is the set of all the
relation schemas in the database
Converting from Entity-
Relationship Model
ER: Entity set -> relation
ER Attributes become Relational attributes
ER: Relationship -> relation
Keys of connected ER entity sets become
Relational attributes
Senator(Name,Party,State,Years)
Bill(Name,Text)
Lobbyist(Name,Organization)
Senator
Name
State
Party
Years
Name Text
Bill
Name
Organization
Lobbyist
ER Relationships
Senator
Name
State
Party
Years
Name Text
Bill
Sponsored
Name
Organization
Lobbyist
Wrote
Contributed
Relations
Sponsored(Senator,Bill)
Wrote(Bill,Lobbyist)
Contributed(Senator,Lobbyist)
Remember, each of these is expressed as a
table (with the columns given by the
“parameters”)
Notice that columns can refer to “bigger”
items, with even more attributes