STADVDB Slides 01a - Relational Database (Review)
STADVDB Slides 01a - Relational Database (Review)
A Review
Advanced Database Systems
1
Relational Database Model
Tuples
(Rows)
Constraints
Tables
Not Null,
Check,
Attributes References ..
(Columns) .
Relational
Database Keys
Data Primary,
Types Foreign
Operations 2
3
Relation Instance: Examples
• Example
Branch(branchNo, street, city, postcode)
• Branch is the name of the relation 5
6
Relation (Formal Definition)
• Domain – can be defined
• Logically
• postcode contains the set of 4-digit postal code valid in
the Philippines
• Based on data type and/or format
• phoneno has the format (aaa) ddd-dddd where aaa is the
area code, ddd-dddd is the 7-digit number
• birthdate has the data type “DATE”
10
• Candidate Key
• A set of at least 1 attribute that uniquely identifies a tuple in
a relation
• All relations have a default SuperKey which is the set of all
attributes
• Primary Key
• The candidate key that has been selected to uniquely
identify tuples within a relation
13
Relational Integrity
Constraints
• NULL values
• Represents a value for an attribute that is currently
unknown or is not applicable for a tuple
• Not the same as zero or spaces
15
Relational Integrity
Constraints
• Referential Integrity
• Foreign Key
• A set of at least 1 attribute within one relation that matches
the candidate key of another (possibly the same) relation
17
Requirements of the DB Approach
Central Controlled
Order Filing Shared Managed
System
Central database
Invoicing
DBMS
System Contains employee,
order, inventory,
Payroll pricing, and
System customer data
19
DBMS manages data resources like an
Operating system manages hardware resources
Elmasri & Navathe (2016)
Database Environment
Controlled Access:
- Security
- Data integrity
- Concurrency
- Recovery
- Catalog
20
Connolly & Begg (2015)
Components of a DBMS
23
Connolly & Begg (2015)
Database Manager
24
Connolly & Begg (2015)
System Catalog
• Repository of information (MetaData) describing the data in
the database
• Typically stores
• names, types, and sizes of data items;
• constraints on the data;
• names of authorized users;
• data items accessible by a user and the type of access;
• usage statistics
25
Relational Language
- SQL
A Review
Advanced Database Systems
26
References
Chapter 2: Database Environment
Chapter 3: Database Architectures
Chapter 4: The Relational Model
T. Connolly and C. Begg. (2015). Database Systems: A Practical Approach to
Design, Implementation, and Management, 6th Edition. Harlow, Essex:
Addison-Wesley