Database Systems (Introduction)
Database Systems (Introduction)
CS-202
Prerequisite: None
Course Objectives
• After the completion of this course:
– The students will be quite familiar with the
importance of databases, core concepts, database
design and its refinement and moderate level of
expertise in SQL.
– Students should be able to design the database
schema for at least a small sized real life
application.
Course Learning Outcomes (CLOs)
• Explain fundamental database concepts.
• Design conceptual, logical and physical database
schemas using different data models.
• Identify functional dependencies and resolve
database anomalies by normalizing database
tables.
• Use Structured Query Language (SQL) for
database definition and manipulation in any
DBMS
• Recommended Book
1. Database Systems: A Practical Approach to Design,
Implementation, and Management, 6th Edition by
Thomas Connolly and Carolyn Begg
• Reference Material
1. Database Systems: The Complete Book, 2nd Edition
by Hector Garcia-Molina, Jeffrey D. Ullman, Jennifer
Widom
2. Database System Concepts, 6th Edition by Avi
Silberschatz, Henry F. Korth and S. Sudarshan.
3. Database Management Systems, 3rd Edition by
Raghu Ramakrishnan, Johannes Gehrke
Chapter 1
Introduction to Databases
Why Study Databases?
• Databases in
areCSuseful
– Databases
Many computing
are a ‘core
applications
topic’ in computer
deal with
science
large
– amounts of information
Basic concepts and skills with database systems
– are
Database
part of
systems
the skill
give
seta you
set of
willtools
be assumed
for storing,
to
searching
have as a CS
andgraduate
managing this information
What is a Database?
• “A set of information held in a computer”
Oxford English Dictionary
• “One or more large structured sets of
persistent data, usually associated with
software to update and query the data”
Free On-Line Dictionary of Computing
• “A collection of data arranged for ease and
speed of search and retrieval”
Dictionary.com
Database
• Definition
– A collection of self-describing and integrated data
files
• System catalog
– Meta data
– Data dictionary
• Data abstraction
Databases
• Train indexes
Web timetables
• Library bookings
Airline catalogues
• Medical
Credit card
records
details
• Bank accounts
Student records
• Stock control
Customer histories
• Personnel
Stock market
systems
prices
• Product catalogues
Discussion boards
• Telephone
and so on…directories
File-Based Systems
• Early attempt to Computerize the manual
filing system
• Collection of application programs that
perform services for the end users (e.g.
reports).
• Each program defines and manages its own
data.
Manual Filing Systems
• Works well
– while number of items to be stored is small
– For only storage or retrieval functionality of large
number of items
File-Based Processing
Limitations of File-Based
Approach
Separation and isolation of data
Each program maintains its own set of data.
Users of one program may be unaware of
potentially useful data held by other programs.
For example, if we want to produce a list of all houses that
match the requirements of the clients.
Duplication of data
Decentralized approach taken by each department.
Same data is held by different programs.
Wasted space and potentially different values and/or different
formats for the same item.
Limitations of File-Based
Approach..
Data dependence
File structure is defined in the program code.
FixedQueries/Proliferation of application
programs
Programs are written to satisfy particular functions.
Any new requirement needs a new program.
Database Approach
Arose because:
Definition of data was embedded in application programs,
rather than being stored separately and independently.
No control over access and manipulation of data beyond
that imposed by application programs.
Result:
the database and Database Management System (DBMS).
History of Database Systems
Roots of the DBMS
Apollo moon-landing project, 1960s
NAA (North American Aviation), prime
contractor for the project
Developed a software GUAM (Generalized
Update Access Method), hierarchical
In mid – 1960s IBM joined NAA, result was
IMS(Information Management System)
History of Database Systems..
• Relational Model
– Relational Model introduced by E.F.Codd in 1969. The model stated that data will be
represented in tuples. A relational model groups data into one or more tables. These
tables are related to each other using common records.
• Dbase
– dBase was one of the first database management systems for microcomputers and the
most successful in its day. The dBase system includes the core database engine, a query
system, a forms engine, and a programming language that ties all of these components
together
• Hadoop
– Hadoop and MongoDB launched in 2009. Hadoop use distributed file system for storing
big data, and MapReduce to process it. Hadoop excels in storing and processing of huge
data of various formats such as arbitrary, semi-, unstructured, etc. MongoDB is a cross-
platform, document oriented database that provides, high performance, high availability,
and easy scalability. It works works on the concept of collection and document.
• Hbase
– It introduced in 2010 and is a database built on top of the HDFS (Hadoop Distributed File
System). HBase provides fast lookups for larger tables.
Database Systems
• Database
A databasesystems
systemallow
consists
users
of to
– Store
Data (the database)
– Update
Software
– Retrieve
Hardware
– Organise
Users
– Protect
• We focus mainly on the software
their data.
Database Users
• End users Data Administrator (DA)
Database planning
– Use the database system to
achieve some goal and
Development
• Application developers maintenance of standards,
policies and procedures
– Write software to allow end users Administrator
• Database to interface
with the database system (DBA)
– Designs & manages the
database system
• Database systems
programmer
– Writes the database
software itself
Database Management Systems
• Examples:
A database is a collection of information
• A– Oracle
database management system (DBMS) is the
– DB2 (IBM)
software that controls information
– MS SQL Server
• Used to create, maintain, and access
– MS Access
databases
– Ingres
– PostgreSQL
– MySQL
– OpenOffice Base
– Corel Paradox
What the DBMS does?
• DBMS
Provides users with
provides
–– Persistence
Data definition language (DDL) Permits
specification of data types, structures and any data
– Concurrency
constraints.
– Integrity
– Security
–– Data
Data independence
manipulation language (DML) General
– Backup
enquiry&facility (query
recovery language) of the data
system
– Data
• Data control language (DCL)
Dictionary
• Often thesethe
– Describes are all the itself
database same language
Views
Allows each user to have his or her
own
view of the database.
• Complexity
• Size
• Cost
– Software
– Hardware
– Conversion
• Performance
• Vulnerability
Data Dictionary - Metadata
• The dictionary
dictionaryholds
or catalog stores information
about the database
– Descriptions itself objects (tables, users,
of database
rules,
• This views,
is data indexes,…)
about data or ‘metadata’
– Information about who is using which data (locks)
• Almost every aspect of the DBMS uses the
– Schemas and mappings
dictionary
File Based Systems
• File based systems • Problems:
– Data is stored in files – No standards
– Each file has a – Data duplication
specific format – Data dependence
– Programs that use – No way to generate
these files depend on ad hoc queries
knowledge about – No provision for
that format security, recovery,
concurrency, etc.
Relational Systems
• Problems
Then, in 1970,
with early
E. F. Codd
databases
wrote “A Relational
Model of Data
– Navigating for Large
the records Shared
requires Databanks”
complex programs
and introduced
– There is minimalthe relational
data model
independence
– No theoretical foundations
Relational Systems
• Information
The relational is stored
modelascovers
tuples 3orareas:
records in
relations or tables
– Data structure
• There
– Data is a sound mathematical theory of
integrity
relations
– Data manipulation
• Most modern DBMS are based on the
relational model
DBMS vs File System
• There are following differences between
DBMS and File system: