1 Bit 20803 Chapter 1 Dbconcepts

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

Concepts of Database System

Chapter 1
Chapter 1 - Objectives
• Introduction to database
• File-based systems.
• Common uses of database systems.
• Database model
Introduction to database

BIT 20803 3
Introduction to database
• A database is a collection of information that is stored electronically.
• This information could be anything from a list of customer names and
addresses to a collection of scientific data.
• Databases are used to organize and manage large amounts of
information in a way that makes it easy to find and use.
• helpful for businesses, organizations, and individuals who need to keep track
of lots of information, such as customer orders, inventory, or financial data.
• Databases are created and managed using specialized software called
database management systems (DBMS).
• help to ensure that the data is organized, secure, and easily accessible to
those who need it.

BIT 20803 4
Database Prehistory
Early Automation
• Data management and
application code were all
tangled together
• Hard to modify Data entry Storage and retrieval
• Hard to generalize
• Many competing approaches
• Data manipulation code
written at very low levels of
abstraction

Query processing Sorting

5
The history

6
E. F. Codd

• Edgar F. "Ted" Codd ( August 23, 1923 - April 18, 2003) was a
British computer scientist who invented relational databases while
working for IBM.
• He was born in Portland, Dorset, studied maths and chemistry at
Oxford. He was a pilot in the Royal Air Force during WWII.
• In 1948 he joined IBM in New York as a mathematical
programmer. He fled the USA to Canada during the McCarthy
period.
• Later, he returned to the USA to earn a doctorate in CS from the
University of Michigan in Ann Arbor. He then joined IBM research
in San Jose.
• His 1970 paper “A Relational Model of Data for Large Shared Data
Banks” changed everything.
• In the mid 1990’s he coined the term OLAP.

7
History of Database Systems

• First-generation
• Hierarchical and Network

• Limitation
• Complex program for simple query
• Minimum data independence
• No theoretical foundation

• Second generation
• Relational

• Limitation
• Limited data modeling

• Third generation
• Object-Relational
• Object-Oriented
First Generation of DB

Hierarchical Network
• One-to-many relationships.
• Similar to the hierarchical
• A hierarchical database model is a data model where
data is stored as records but linked in a tree-like model but records are
structure organized differently
• Each record has only one parent. The first record of the
data model is a root record • allows each record to have
multiple parents and
multiple child records. A
network database allows
flexible relationship model
between entities.

9
Relational Model
• The relational model (RM) for database management
is an approach to manage data using a structure and
language consistent with first-order predicate logic,
first described in 1969 by Edgar F. Codd.
• Uses a two-dimensional table of rows and columns of
data
• Rows are records
• Columns are fields

• Data dictionary: Stores definitions


• Data types for fields, default values, and validation rules for data in each field

• Primary key
• Uniquely identifies every record in a relational database

• Foreign key
• Field in a relational table that matches the primary key column of another table
• Used to cross-reference tables
• Normalization
• Improves database efficiency by eliminating redundant data
• Ensures that only related data is stored in a table
• Goes through different stages from first normal form (1NF) to fifth normal form (5NF)
Database Evolution

11
File-Based Systems

• Collection of application programs that perform services for the end users (e.g. reports).
• Each program defines and manages its own data.

File-Based Processing
Limitations of File-Based Approach
• Separation and isolation of data • Data dependence
• Each program maintains its own set of • File structure is defined in the program
data. code.
• Users of one program may be unaware of
potentially useful data held by other • Incompatible file formats
programs.
• Programs are written in different
languages, and so cannot easily access
• Duplication of data each other’s files.
• Same data is held by different programs.
• Wasted space and potentially different • Fixed Queries of application programs
values and/or different formats for the • Programs are written to satisfy particular
same item. functions.
• Any new requirement needs a new
program.

Pearson Education © 2014


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

Pearson Education © 2014


Difference between File System and DBMS:
DBMS(Database Management System)
File System : :
• The file system is basically a way of • Database Management System is basically
arranging the files in a storage medium software that manages the collection of
like a hard disk. related data.
• The file system organizes the files and • It is used for storing data and retrieving
helps in the retrieval of files when they the data effectively when it is needed.
are required. • It also provides proper security measures
• File systems consist of different files for protecting the data from unauthorized
which are grouped into directories. The access.
directories further contain other folders • In Database Management System the
and files. data can be fetched by SQL queries and
• The file system performs basic operations relational algebra.
like management, file naming, giving
access rules, etc.

15
Difference between File System and DBMS:

16
Database

• A database is a large, integrated collection of logically


related data (and a description of this data)
• Logically related data comprises entities, attributes, and
relationships of an organization’s information.
• A database contains a model of something!
• Designed to meet the information needs of an organization.
• System catalog (metadata) provides description of data to
enable program–data independence.

Pearson Education © 2014


Database Management System (DBMS)

• A software system that enables users to define, create, maintain, and


control access to the database.
• (Database) application program: a computer program that interacts
with database by issuing an appropriate request (SQL statement) to
the DBMS.

https://budibase.com/blog/best-database-management-software/

Pearson Education © 2014


Manages Very Large Amounts of
Data
Supports efficient access to Very
What does Large Amounts of Data
a database Supports concurrent access to
system do? Very Large Amounts of Data
Supports secure, atomic access
to Very Large Amounts of Data
19
Programming languages and software engineering
(obviously)
Databases
are a Rich Data structures and algorithms (obviously)

Area for Logic, discrete maths, computation theory

Computer • Some of today’s most beautiful theoretical results are in


“finite model theory” --- an area derived directly from

Science database theory

Systems problems: concurrency, operating systems,


file organization, networks, distributed systems…

20
Recommended Reading
• Connoly, T. & Begg, C., (2018). Database system: a practical approach to design, implementation and
management. 6th ed. New York: Addison-Wesley
• Carlos Coronel & Steven Morris (2018) Database Systems: Design, Implementation, & Management 13th Edition.
Cengage Learning
• Hoffer, Jeffrey A, (2016). Modern Database Management 12th ed. Pearson Education Limited. Call Number:
QA76.9.D3.H64 2016
• Nenad Jukic, Susan Vrbsky & Svetlozar Nestorov (2016). Database Systems: Introduction to Databases and Data
Warehouses. Pearson.
• Silberschatz, A., Korth, H. & Sudarshan, S., (2011). Database system concepts. 6th ed. New York: McGraw-Hill. Call
Number: QA76.9.D3 .K69 2011.
• Date, “An introduction to database systems”, 8th ed.
• Elmasri & Navathe, “Fundamentals of database systems”, 4th ed.
• Silberschatz, Korth & Sudarshan, “Database system concepts”, 4th ed.
• Ullman & Widom, “A first course in database systems”.

21
It is common to describe databases in two ways

• The logical level:

Database • What users see, the program or query language interface, …


• The physical level:

system
• How files are organised, what indexing mechanisms are used, …

It is traditional to split the logical level into two: overall


architecture database design (conceptual) and the views that
various users get to see

A schema is a description of a database

22
Three-level architecture
External External External

Schema 1 Schema 2 Schema n

External
Conceptual level
Conceptual
level Schema

Physical Internal
level Schema

23
Data independence is the ability to change
the schema at one level of the database
system without changing the schema at the
next higher level
Logical and Logical data independence is the capacity to
change the conceptual schema without
physical data changing the user views
independence
Physical data independence is the capacity
to change the internal schema without
having to change the conceptual schema or
user views
24
Database design process
• Requirements analysis
• User needs; what must database do?
• Conceptual design
• High-level description; often using E/R model
• Logical design
• Translate E/R model into (typically) relational schema
• Schema refinement
• Check schema for redundancies and anomalies
• Physical design/tuning
• Consider typical workloads, and further optimise

25
Examples of Database Applications

• Purchases from the supermarket • Online encyclopaedias


• Purchases using your credit card
(Wikipedia)
• Booking a holiday at the travel agents
• Using the local library • Social media websites
• Taking out insurance (Facebook)
• Renting a video
• CRM systems (Salesforce)
• Using the Internet
• Studying at university • Email systems (Gmail)
• E-commerce websites
(Amazon)
3.2 Interaction Between the User, DBMS
and Database
Database Management System (DBMS)

Pearson Education © 2014


Components of DBMS
Environment
• Hardware
• Can range from a PC to a network of computers.
• Software
• DBMS, operating system, network software (if necessary) and also the
application programs.
• Data
• Used by the organization and a description of this data called the schema.
• Procedures
• Instructions and rules that should be applied to the design and use of the
database and DBMS.
• People
Components of a DBMS Components of Database Manager

30
Functions of a DBMS

• Data Storage, Retrieval, and Update. • Authorization Services.


• A User-Accessible Catalog. • Support for Data Communication.
• Transaction Support. • Integrity Services.
• Concurrency Control Services. • Services to Promote Data Independence.
• Recovery Services. • Utility Services.

31
Data definition language (DDL)
Data manipulation language (DML)

Database Structured query language (SQL)


Management Security system
System Integrity system
Facility Concurrency control system
Backup & recovery system
View mechanism
System Catalog

• Repository of information (metadata) describing the data in the database.


• One of the fundamental components of DBMS.
• 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.

Pearson Education © 2014 33


Multi-User DBMS Architectures

• Teleprocessing Systems - one computer (one CPU): multiple dumb terminals


• Client-Server Systems - multiple computers usually connected in a LAN where the
database resides on the server and the applications are on the clients
• File-Sharing Systems - server only contains the files, while the clients contain the
applications and the DBMS (more traffic): used for nondatabase applications
• Distributed Database Systems - database is distributed to different computers

34
Roles in the
Database
Environment
• There are five distinct types of
people that participate in the
DBMS environment:
• Data Administrator (DA)
• Database Administrator
(DBA)
• Database Designers (Logical
and Physical)
• Application
Programmers/developers
• End Users (naive and
sophisticated)
Advantages of DBMSs

• Control of data redundancy Balance conflicting requirements


• Data consistency
• More information from the same amount of data Improved data accessibility and responsiveness
• Sharing of data
• Improved data integrity Increased productivity
• Improved security
• Enforcement of standards Improved maintenance through data independence
• Economy of scale
Increased concurrency

Improved backup and recovery services


Disadvantages of DBMSs

• Complexity
• Size
• Cost of DBMS
• Additional hardware costs
• Cost of conversion
• Performance
• Higher impact of a failure

Pearson Education © 2014


Types of
database models
• Hierarchical database model.
• Relational model.
• Network model.
• Object-oriented database
model.
• Entity-relationship model.
• Document model.
• Entity-attribute-value model.
• Star schema.
Multimedia DB
• Multimedia document management with image,
audio, and text information packaged as documents
• Instagram, Youtube

Document oriented DB
CURRENT • XML
TRENDS • Mongo DB

Mobile DB
• Stationary database that can be connected to by a
mobile computing device
• Eg: Sybase SQL Anywhere, Oracle Lite, Microsoft SQL
Server Compact, SQLite
Important terms

Data is a collection of information

Database is a collection of interrelated data; stored in the form


of tables.

Let’s recap
Database system is computerized system, whose overall
purpose is to maintain the information and to make that the
information is available on demand.

Database Management System (DBMS) is a collection of


programs that enables user to create and maintain a database.
Next topic
• DATABASE RELATIONSHIP
MODEL

You might also like