0% found this document useful (0 votes)
10 views33 pages

Lecture 1-Introduction and Relational Model

The document outlines the course 'Introduction to Database Systems' (IS211) presented by Dr. Dina Ezzat, focusing on the relational model, SQL, relational algebra, and normalization. It discusses the importance of databases, their components, and the differences between database systems and file systems, highlighting the benefits of using a Database Management System (DBMS). Additionally, it covers data models, the relational database model, and the architecture of database systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views33 pages

Lecture 1-Introduction and Relational Model

The document outlines the course 'Introduction to Database Systems' (IS211) presented by Dr. Dina Ezzat, focusing on the relational model, SQL, relational algebra, and normalization. It discusses the importance of databases, their components, and the differences between database systems and file systems, highlighting the benefits of using a Database Management System (DBMS). Additionally, it covers data models, the relational database model, and the architecture of database systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Course: Introduction to Database Systems

Course Code: IS211

Introduction to
Database Systems and
Relational Model
Presented by:
Dr. Dina Ezzat
1
What do you
expect to study in
the course?

2
Course Overview

• Introduction to Database Systems


• Theory and the use of relational database
• Focus on:
• Relational Model
• SQL (Structured Query Language)
• Relational Algebra
• ER (Entity Relationship) Model
• Normalization

33
Textbook

• Fundamentals of Database Systems, Ramez ElMasri and


Shamkant Navathe, 7th edition.

4
4
Data vs Information

20120023 Student
16 ID: 20120023
IS Age: 16
Department: IS

• Data • Information
• Raw facts, unorganized, • Processed data
unrelated • Data with context
• No context

• Which is more useful?


• Accurate, relevant and timely information is important for decision
making 5
Definitions
• Database:
➢ A collection of related data.
➢ A database contains a model of something.

• Database Management System (DBMS):


➢ Is a software system designed to store, manage and facilitate access
to the database.

• Database/Application Program:
➢ A computer program that interacts with the database through the
DBMS.
6
Database System Environment
Users/Programmers

Database
Application Programs/Queries
System

DBMS
Software Software: Query Processing
& Programs

Software: Data Access

Database
Dictionary Database
(Metadata)

7
Components of a Database System

8
Why we need a Database?
• What kind of data we need to store?

• Examples of DB applications
• Hospital system
• Airline reservation
• Supermarket
• Hotel reservation

• What else?
Decision
Making

Daily operations

• Benefits of a Database?
Database

9
File System: Problem Case
CUSTOMER file MARKETING file SALES file

C_Name (15 char) A_Name (20 char) AGENT (20 char)


Carol Johnson Carol T. Johnson Carol J. Smith

- Inconsistent field name and field size


- Inconsistent data values
- Data duplication
10
Database System vs File System

11
File Systems
• Problems
• Duplication
• Same data may be stored in multiple files.
• Inconsistency
• Same data may be stored by different names in different
formats.
• Rigidity
• Requires customized programming to implement any changes.
• Cannot do ad-hoc queries.

• Implications
• Waste of space.
• Data inaccuracies.
• High overhead of data manipulation and maintenance.
12
File System vs Databases
• Small Systems • Large systems
• Often single user • Multiple users
• Simple structure • Complex structure
• Isolated data • Shared data
• Redundant data • Reduced redundancy
• Relatively cheap • Relatively expensive
• Less secure • More secure

13
What to do with Data?

Data

Storage Querying Securing

What else?

14
DBMS Examples
• Oracle

• MySQL

• MS SQL Server

15
DBMS Interfaces
• Menu-based interface

• Forms-based interface

• Graphical user interface

• Query language

16
Classification of DBMS
Based on:
• Data model
➢ Relational, network, hierarchical, object-oriented … etc.

• Number of users
➢ Single user or multi-user.

• Database distribution
➢ Centralized vs. distributed.

17
DBMS Functions
• Data Storage Management
• Data Dictionary
• Data Transformation and Presentation
• Security
• Multi-user Access Control
• Backup and Recovery
• Data Integrity
• Database Access Language
• Database Communication Interface

18
Database Players
• DB Administrator (DBA)
• Access authorization, coordination & monitoring
database usage, problem determination, performance
tuning, etc.
• Designers
• Choose the appropriate structures to represent & store the
data.
• Users
• System analysts & application programmers

19
Database States
• Empty State:
• DB is empty when we first define the DB schema.

• Initial State:
• DB is first populated or loaded with data.

• Current State:
• Snapshot in time.

20
Relational Model

21
Schema vs Instance
• A schema is the way the database designer describes the
structure of the database. It contains the definition of the
data itself with the identification of the relationships
between such data definition.

• The current values contained in the relation represent an


instance.

22
Three-Schema Architecture
• Defines DBMS schema at three levels:
• Internal schema is used to describe physical storage
structures and access paths (e.g indexes).
• Typically uses a physical data model.

• Conceptual schema is used to describe the structure


and constraints for the whole database for a
community of users.

• External schema is used to describe the various user


views.
23
Three-Schema Architecture
Example?

24
Data Models
• A database model is a type of model that determines the logical
structure of a database.

• A collection of tools for describing:


• Data
• Data relationships
• Data semantics
• Data constraints

• Models:
• Relational Model
• Object-oriented model
• Older models: network model and hierarchical model
25
History of Relational Database Model
• Introduced by Ted Codd in 1970 in a classic paper.
• Ted Codd was an IBM Research Fellow.
• Laid the foundation for database theory.
• Many database concepts and products are based on this
model.
• Most common used database model.

26
Relational Model
• Based on “2-dimensional table” with rows and columns called a relation.
• A relational database is a set of relations.
• Each relation has a unique name in the database.
• Relations are basically tables of data.
• Each row is called a tuple.
• Each row represents a record in the relation.
• Each row (tuple), is a collection of related facts.
• Each column represents an attribute.
• Each attribute/column has a unique name across the relation.
• The degree of the relation is the number of attributes in a relation.
The relation schema of account is:
Account_schema = (acct_id, branch_name, balance)

• Example :
The account ID “A-307”, branch name “Seattle” and balance “275” are all related to each
other.
27
Domain
• A domain D is a set of values, from which one or more attributes take their
values.
• Example
CITY = {London, Paris, Doha, Cairo, Athens, Rome, Dubai, Madrid}
CITY is a set of cities from which the attribute City takes its values.

DATE = (DAY, MONTH, YEAR)


Where:
DAY = {1..31}, MONTH = {1..12}, YEAR = {1990..2024}

CITY is a simple domain, but DATE is a composite domain.


28
Examples of Relations in a Relational Database (RDB)

STUDENT (Name, Ssn, Home_phone, Address, Office_phone, Age, Gpa)

29
Characteristics of Relations

• Tuples have no particular order.

• Ordering of attributes is not important.

• All values belonging to a particular attribute are from the


same domain.

• Attributes may have a null value: null is not a zero.

• Null?
30
Database Schema and Instance
• The Schema (or description) of a Relation:
• Denoted by R(A1, A2, .....An)
• R is the name of the relation
• The attributes of the relation are A1, A2, ..., An
• Example:
CUSTOMER (Cust-id, Cust-name, Address, Phone#)
• Each attribute has a domain or a set of valid values.
• For example, the domain of Cust-id is 6 digit numbers.
• Instance of R is a set of tuples satisfy the schema of R.
• Notes
• Database schema is stable over long period of time.
• Database instance changes constantly as data is inserted or deleted.
31
Company Database Schema

32
Any Questions?

33

You might also like