Lecture 1 DBMS

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 24

Introduction to Database

Systems
Database Systems Lecture 1
Natasha Alechina
www.cs.nott.ac.uk/~nza/G51DBS
In this Lecture
• Course Information
• Databases and Database Systems
• Some History
• The Relational Model
For more information
• Connolly and Begg – Chapters 1 and 2
• Ullman and Widom (2ed.) – Chapter 1
• The module website
www.cs.nott.ac.uk/~nza/G51DBS/
Course Information
•Contact details •Assessment
• Natasha Alechina • 25% Coursework
• Some lab-marked
[email protected] exercises
• Office: B50 • A written exercise
with a database
•Lectures design
• Mondays at 9 (sorry, • 75% Examination
not my fault) LT2 • 2 hour written exam
• Wednesdays at 12 in • Answer 3 out of 5
LT3 questions
• Labs Wednesday 9-11 • Format similar to last
years’ G51DBS and
starting 13 February G52DBS before that.
Textbook
• Recommended •Other textbooks:
textbooks: • There are lots of
• ‘Database Systems: A database texts
practical approach to • Most of them would
design, implementation be fine also
and management’ by
Connolly and Begg •For example:
• ‘Database Systems’ by
• `A first course in
CJ Date
database systems’ by
Ullman and Widom.
Course Overview
• Several main topics • Practical sessions
• Database systems • Will start on 13
• Data models February
• Database design • SQL
• SQL • creating a database
• querying a database
• Transactions
• Concurrency
• Administration
Why Study Databases?
• Databases are useful • Databases in CS
• Many computing • Databases are a ‘core
applications deal with topic’ in computer
large amounts of science
information • Basic concepts and
• Database systems skills with database
give a set of tools for systems are part of
storing, searching and the skill set you will
managing this be assumed to have
information as a CS graduate
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
Databases
• Web indexes • Train timetables
• Library catalogues • Airline bookings
• Medical records • Credit card details
• Bank accounts • Student records
• Stock control • Customer histories
• Personnel systems • Stock market prices
• Product catalogues • Discussion boards
• Telephone directories • and so on…
Database Systems
• A database system • Database systems
consists of allow users to
• Data (the database) • Store
• Software • Update
• Hardware • Retrieve
• Users • Organise
• We focus mainly on • Protect
the software their data.
Database Users
• End users • Database
• Use the database Administrator (DBA)
system to achieve • Designs & manages
some goal the database system
• Application • Database systems
developers programmer
• Write software to • Writes the database
allow end users to software itself
interface with the
database system
Database Management
Systems
• A database is a • Examples:
collection of • Oracle
information • DB2 (IBM)
• A database • MS SQL Server
management system • MS Access
(DBMS) is the • Ingres
software than • PostgreSQL
controls that • MySQL
information
What the DBMS does
• Provides users with • DBMS provides
• Data definition • Persistence
language (DDL) • Concurrency
• Data manipulation • Integrity
language (DML) • Security
• Data control language • Data independence
(DCL)
• Data Dictionary
• Often these are all
• Describes the
the same language database itself
Data Dictionary - Metadata
• The dictionary or • The dictionary holds
catalog stores • Descriptions of
information about database objects
the database itself (tables, users, rules,
views, indexes,…)
• This is data about • Information about
data or ‘metadata’ who is using which
• Almost every aspect data (locks)
of the DBMS uses • Schemas and
mappings
the dictionary
File Based Systems
• File based systems • Problems:
• Data is stored in files • No standards
• Each file has a specific • Data duplication
format • Data dependence
• Programs that use • No way to generate
these files depend on ad hoc queries
knowledge about that • No provision for
format security, recovery,
concurrency, etc.
Relational Systems
• Problems with early • Then, in 1970,
databases E. F. Codd wrote “A
• Navigating the Relational Model of
records requires Data for Large
complex programs Shared Databanks”
• There is minimal data and introduced the
independence
relational model
• No theoretical
foundations
Relational Systems
• Information is stored • The relational model
as tuples or records covers 3 areas:
in relations or tables • Data structure
• There is a sound • Data integrity
mathematical theory • Data manipulation
of relations • More details in the
• Most modern DBMS next lecture…
are based on the
relational model
ANSI/SPARC Architecture
• ANSI - American • A three-level
National Standards architecture
Institute • Internal level: For
• SPARC - Standards systems designers
Planning and • Conceptual level: For
database designers
Requirements and administrators
Committee • External level: For
• 1975 - proposed a database users
framework for DBs
Internal Level
• Deals with physical • Internal Schema
storage of data RECORD EMP
LENGTH=44
• Structure of records
HEADER: BYTE(5)
on disk - files, pages,
OFFSET=0
blocks
NAME: BYTE(25)
• Indexes and ordering OFFSET=5
of records SALARY: FULLWORD
• Used by database OFFSET=30
system programmers DEPT: BYTE(10)
OFFSET=34
Conceptual Level
• Deals with the • Conceptual Schema
organisation of the CREATE TABLE
data as a whole Employee (
• Abstractions are used Name
to remove VARCHAR(25),
unnecessary details of Salary REAL,
the internal level
Dept_Name
• Used by DBAs and
VARCHAR(10))
application
programmers
External Level
• Provides a view of • External Schemas
the database tailored Payroll:
to a user String Name
• Parts of the data may double Salary
be hidden
• Data is presented in a Personnel:
useful form char *Name
• Used by end users char *Department
and application
programmers
Mappings
• Mappings translate • Physical data
information from one independence
level to the next • Changes to internal
• External/Conceptual level shouldn’t affect
• Conceptual/Internal conceptual level

• These mappings • Logical data


provide data independence
independence • Conceptual level
changes shouldn’t
affect external levels
ANSI/SPARC Architecture
User 1 User 2 User 3

External External
External Schemas
View 1 View 2

External/Conceptual Mappings
Conceptual DBA
Conceptual Schema View

Conceptual/Internal Mapping

Internal Schema Stored


Data
This Lecture in Exams
• Describe the three levels of the ANSI/SPARC model.
You should include information about what each level
is for, which users might be interested in which levels,
and how the levels relate to one another. (2004/05, 7
marks)
Next Lecture
The Relational Model
• Relational data structure
• Relational data integrity
• Relational data manipulation
For more information
• Connolly and Begg chapters 3 and 4
• Ullman and Widom (2 ed.) Chapter 3.1, 5.1
• E.F. Codd’s paper
(there is a link on last year’s G51DBS
webpage)

You might also like