CS220-Database Systems!: Dr. Seema Jehan

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

CS220- Database

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!

•  Spreadsheets lack proper data modelling and database


design.

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)

•  Data is essential for organisations to


make decision making

•  Data vs. Information:


•  Data consists of raw facts that have
not yet been processed to reveal
their meaning to the end user.

•  Information is the result of


processing raw data to reveal its
meaning. It consists of transformed
data and facilitates decision making.

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.

•  New knowledge can be


derived from an old
knowledge

10
What is a database!
•  A database presents a
perception of a reality.

•  It is a collection of the related


data

•  Known facts that can be


recorded and that have
implicit meaning.

•  It represents some aspects of


a real-world

•  Built for a specific purpose


11
Examples!
•  Traditional Database applications
•  Store textual or numeric information
•  Multimedia databases
•  Store images, audio clips, and video streams digitally
•  Geographic information systems (GIS)
•  Store and analyse maps, weather data, and satellite images
•  Data warehouses and online analytical processing systems (OLAP)
•  Extract and analyse useful business information from very large databases
•  Supports decision making

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

Name! Student_Number! Batch! Year!


Sarah Ali! 32423! BSCS-9! 2019!
Ahsan Khan! 23244! BESE-10! 2019!

Course
Course_Name! Course_Number! Credit Hours! Department!
OOP! CS101! 3! SE!
Data Structures! CS250! 4! CS!

Database CS220! 4! CS!


Systems!
Discrete MATH240! 3! HU!
Mathematics!
15
An Example!
Pre-requisites

Course_Number! Prerequisite_Number!
CS220! MATH240!

CS220! CS101!

Section

Section_Identifier! Course_Number! Semester! Year! Instructor!


65! CS101! Spring! 2020! Pakeeza!

68! CS250! Fall! 2020! Shahzad!

76! CS220! Fall! 2020! Seema!

16
An Example!
Grade Report

Student_Number! Section_Identifier! Grade!


32423! 65! A!

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

•  String of alphabet characters


•  Integer
Name! Student_Number! Batch! Year!
Sarah Ali! 32423! BSCS-9! 2019!
Ahsan Khan! 23244! BESE-10! 2019!

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

•  Relationships among the records


•  Manipulation involves querying and updating

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

•  List the prerequisites of the ‘Database’ course

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

•  Enter a grade of ‘A’ for ‘Ahsan’ in the


‘Database’ section of last semester

21
Database Design!
Phases for designing a database:

•  Requirements specification and analysis


•  Conceptual design
•  Logical design
•  Physical design

22
Characteristics of the Database Approach!

•  Main characteristics of database approach


•  Self-describing nature of a database system
•  Insulation between programs and data, and
data abstraction

•  Support of multiple views of the data


•  Sharing of data and multiuser transaction
processing
23
Self Describing nature of a Database
System!

•  Database System contains complete definition of


structure and constraints
•  Meta-data
•  Describes structure of the database
•  Database catalog can be used:
•  DBMS software
•  Database users who need information about
database structure
24
Self Describing nature of a Database System!

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

•  Concurrency control software


•  Ensure that several users trying to update
the same data do so in a controlled manner

•  Results of the updates is correct


•  Online transaction processing (OLTP)
30
Sharing of Data and Multiuser
Transaction Processing (contd.)!
•  Transaction
•  Central to many database applications
•  Executing program or process that includes one or
more database
•  Isolation property
•  Each transaction appears to execute in isolation
from other transactions
•  Atomicity property
•  Either all the database operation in a transaction
are executed or none

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.

•  A DBMS facilitates the


process of defining,
constructing,
manipulating and
sharing databases.

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:

•  Allows multiple users and programs to access the database


simultaneously.

•  Query:

•  A query causes some data to be retrieved


•  Transaction:

•  May cause some data to be read or written into the database.


•  Maintain a database:

•  Allow the system to evolve as requirements change over time


41
the Database Systems!

42
Advantages of DBMS!
•  Controlling redundancy
•  Data Normalization
•  Denormalization
•  Sometimes necessary to use controlled
redundancy to improve the performance of
queries

•  Restricting unauthorised access


•  Security and authorization subsystems
•  Privileged security
43
Advantages of DBMS!
Denormalization

44
Advantages of DBMS!
•  Restricting unauthorised access
•  Security and authorization subsystems
•  Privileged security

•  Providing Backup and Recovery

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

•  Key or uniqueness constraint


•  Every course record must have a unique
value for course number

47
When not to use DBMS!
•  Simple, well-defined database applications not
expected to change at all

•  Stringent, real-time requirements that may not be


met because of DBMS overhead

•  Embedded systems with limited storage capacity


•  No multiple-user access to data

48
Summary!
•  Data consists of raw facts, Information is the result of processing data to
reveal its meaning.

•  Data is usually stored in a database. To implement a database and to


manage its contents , a database management system (DBMS) is required.

•  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.

•  Databases can be classified according to the number of users supported,


where the data is located, the type of data stored, data usage and the
degree to which the data is structured.

•  DBMSs were developed to overcome the file system’s inherent


weaknesses.

49
References!
•  Chapter 1, Fundamentals of Database systems, Ramez
Elmasri and Shamkant Navathe, 7th Edition, 2016

•  Chapter 1, Database Systems, Design, Implementation


and Management, 13th Edition, 2019

50

You might also like