Database CH 1
Database CH 1
Unit 1
Introduction to DBMS
Application program examples
• Add new students, instructors, and courses
• Register students for courses, and generate class rosters
• Assign grades to students, compute grade point averages (GPA) and generate
transcripts
Schema and Instance
The customer Relation
The account relation
The depositor Relation
The branch relation
The loan relation
The borrower relation
Structure of Relational Databases
• A relational database consists of a collection of
tables, each of which is assigned a unique name .
• A row in a table represents a relationship among a
set of values.
• a table is a collection of such relationships
• each attribute, there is a set of permitted values,
called the domain of that attribute.
• the attribute branch-name, the domain is the set
of all branch names
• tuple variable t refer to the first tuple of the
relation.
• use the notation t[account-number] to denote the
value of t on the account-number attribute.
• t[account-number] = “A-101,” and t[branch-name] =
“Downtown”.
• the mathematical notation of t ∈ r to denote that
tuple t is in relation r.
• A1, A2, …, An are attributes
attributes
(or columns)
customer_name
customer_street
customer_city
2. The
domains of the ith attribute of r and the ith attribute of s
must be the same for all .
• Query:
find the names of all customers who have a
loan at the Perryridge branch.
Answer:
σ (borrower x loan)
branch-name =“Perryridge”
Query:
• selection forcing equality on those attributes
that appear in both relation schemas, and
finally removes duplicate attributes