CS220-Database Systems!: Dr. Seema Jehan
CS220-Database Systems!: Dr. Seema Jehan
CS220-Database Systems!: Dr. Seema Jehan
Systems!
Introduction
Dr. Seema Jehan
Course Details!
• Book: Fundamentals of Database Systems, 7th Edition,
Ramez Elmasri, Shamkant B. Navathe
• Course : 75%
• Assignments 20%
• Midterm 30%
• Final 50%
• Lab : 25%
• Lab work 70%
• Term Project: 30%
2
Topics to be covered!
• Introduction to Databases
• Database Systems Architecture
• ER Modelling
• Relational Model
• Relational Database Constraints
• Introduction to SQL
• Relational Algebra
• Normalization
• NoSql Databases
3
Outline!
• Flaws in file system management system
• Why Databases
• What is a database
• Different types of Databases
• Importance of Database design
• Main components of the Database systems
• Main functions of the Database Management Systems (DBMS)
4
Flaws in the File System!
5
Flaws in the File System!
6
Flaws in the File System!
• Lengthy development times
• Difficulty of getting quick answers
• Lack of security
• Limited data sharing
• Data Redundancy
• Data Integrity problems
7
Database Systems vs. File
System!
8
Why databases!
• Data is ubiquitous (abundant, global,
everywhere) and pervasive(prevalent,
persistent)
9
Why Databases!
• Knowledge
• The body of facts and
information about a specific
object.
• It implies familiarity,
awareness and understanding
of information as it applies to
an environment.
10
What is a database!
• A database presents a
perception of a reality.
12
A Simplified Database System
Environment!
13
An Example !
• University database:
• Information about students, courses, and their grades in a
university environment
• Data Records
• STUDENT
• COURSE
• SECTION
• GRADE_REPORT
• PRE_REQUISITE
14
An Example!
Student
Course
Course_Name! Course_Number! Credit Hours! Department!
OOP! CS101! 3! SE!
Data Structures! CS250! 4! CS!
Course_Number! Prerequisite_Number!
CS220! MATH240!
CS220! CS101!
Section
16
An Example!
Grade Report
23244! 65! B!
23244! 76! A!
!
17
An Example contd.!
• Specify structure of records of each file by specifying data
type for each data element
18
An Example contd.!
• Construct UNIVERSITY database
• Store data to represent each student, course,
section, grade report, and prerequisite as a record
in appropriate file
19
An Example contd.!
• Construct Examples of queries:
• Retrieve the transcript
• List the names of students who took the section of
the ‘Database’ course offered in fall 2020 and their
grades in that section
20
An Example contd.!
• Examples of updates:
• Change the class of ‘Ahsan’ to sophomore
• Create a new section for the ‘Database’
course for this semester
21
Database Design!
Phases for designing a database:
22
Characteristics of the Database Approach!
25
Insulation between Programs and Data!
• Program Data Independence
• Structure of data files is stored in DBMS catalog
separately from access programs
• Program-operation Independence
• Operations specified in two parts:
• Interface includes operation name and data types
of its arguments
• Implementation can be changed without affecting
the interface
26
Data Abstraction!
• Data Abstraction
• Allows program-data independence and
program-operation independence
• Conceptual Representation of Data
• Does not include details of how data is stored
or how operations are implemented
• Data Model
• Type of data abstraction used to provide
conceptual representation
27
Support of Multiple Views of the DATA!
• Views
• Subset of the database
• Contains virtual data derived from the
database files but is not explicitly stored.
• Multi-user DBMS
• Users have a variety of distinct applications
• Must provide facilities for defining multiple
users
28
Support of Multiple Views of the DATA!
29
Sharing of Data and Multiuser
Transaction Processing!
• Allows multiple users to access the database at
the same time
31
Types of Databases!
• Classification by users:
• Single-user database
• Desktop database
• Multiuser database
• Workgroup database
• Enterprise database
32
Types of Databases!
• Classification by location:
• Centralized database
• A database located at a single site
• Distributed database
• Data distributed across several sites
• Cloud databases
33
Types of Databases!
• Classification by usage:
• Operational Database
• Online Transaction Processing (OLTP)
• Analytical Database
• Data warehouse
• Online Analytical Processing (OLAP)
34
Types of Databases!
• Classification based on the degree that:
• Unstructured data
• Structured data
• Semistructured data
• XML databases
• No SQL Databases
35
Types of Databases!
36
Database Actors!
• Database Administrators (DBA) are responsible for:
• Authorizing access to the database
• Coordinating and monitoring its use
• Acquiring hardware and software resources
• Database designers are responsible for:
• Identifying the data to be stored
• Choosing appropriate structures to represent and
store data
37
Database Actors!
• System Analysts
• Determine requirements of end users
• Application programmers
• Implement these specifications as programs
• End Users
• People who require access to the database
38
What is DBMS!
• Database Management
System (DBMS) is a
collection of programs
that manages the
database structure and
controls access to the
data stored in the
database.
39
What is DBMS!
• Defining a database involves specifying the data types,
structures and constraints of the data to be stored in the
database.
• Meta-data:
• Database definition or descriptive language
• Stored by the database in the form of a database dictionary
• Manipulating a database:
• Query and updating a database
• Generate reports
40
What is DBMS!
• Sharing a database:
• Query:
42
Advantages of DBMS!
• Controlling redundancy
• Data Normalization
• Denormalization
• Sometimes necessary to use controlled
redundancy to improve the performance of
queries
44
Advantages of DBMS!
• Restricting unauthorised access
• Security and authorization subsystems
• Privileged security
45
Advantages of DBMS!
• Providing storage structures and search
techniques for efficient query processing
• Indexes
• Buffering and caching
• Query processing and optimization
• Providing multiple user interfaces
46
Advantages of DBMS!
• Enforcing Integrity constraints
• Referential integrity constraint
• Every section record must correspond to
a course record
47
When not to use DBMS!
• Simple, well-defined database applications not
expected to change at all
48
Summary!
• Data consists of raw facts, Information is the result of processing data to
reveal its meaning.
• The DBMS serves as the intermediary between the user and the database.
• Database design defines the database structure. A well-defined database
facilitates data management and generates accurate information.
49
References!
• Chapter 1, Fundamentals of Database systems, Ramez
Elmasri and Shamkant Navathe, 7th Edition, 2016
50