Database Systems
description
Transcript of Database Systems
Database SystemsDatabase Systems
Department of Information Department of Information TechnologyTechnology
Database Systems – week 1Database Systems – week 1
0. Introduction0. Introduction
1. Database Concepts1. Database Concepts
0.1 Aims or Objectives0.1 Aims or Objectives
1.1. Fundamental of relational database;Fundamental of relational database;2.2. Understanding in relational data Understanding in relational data
model;model;3.3. Knowledge and skills in the use of Knowledge and skills in the use of
relational DBMS and PosterSQLrelational DBMS and PosterSQL4.4. Knowledge of database design.Knowledge of database design.
0.2 What does it cover?0.2 What does it cover?
1.1. Idea of database approaches (week 1-2);Idea of database approaches (week 1-2);2.2. Relational model and relational database Relational model and relational database
management systems (weeks 2-4);management systems (weeks 2-4);3.3. Database languages and programming (4-7)Database languages and programming (4-7)4.4. (Relational) Database design ((Relational) Database design (weeks weeks 8-10)8-10)5.5. Others: database administration, advanced dOthers: database administration, advanced databases etc. (atabases etc. (weeks weeks 11-12)11-12)
0.3 Learning Strategy0.3 Learning Strategy
Lecture Tutorials Lab
0.3 Learning Strategy0.3 Learning Strategy
A) T. M. Connolly, C. E. Begg, Database Systems: A Practical Approach to Design, Implementation, and Management (Fourth Edition), Addison-Wesley, 2004.ISBN: 0-321-21025-5, URL: http://www.booksites.net/connolly
B) Eaglestone.BM, Relational Databases, Stanley Thornes,1991.
Guided reading of the text book
0.4 Learning Assessment 0.4 Learning Assessment
A) Course work (20%)• SQL Lab Test (10%): Week 10.
• Database Design (10%): Week 10.
B) Exam (80%): Jan 2007.
0.5 Teaching Team0.5 Teaching Team
1.1. Lecturers: Lecturers:
2.2. Teaching Assistants:Teaching Assistants:
1.1 What is a Database System?1.1 What is a Database System?
Scenario: Scenario: You are a book shop ownerYou are a book shop owner..• Readers buy books from you;Readers buy books from you;• Readers can order books from you;Readers can order books from you;• Readers can rent books from you.Readers can rent books from you.
• • NeedsNeeds• if a book (how many copies) is available?if a book (how many copies) is available?• Which book has this reader rented? Which book has this reader rented? • If it is overdue?If it is overdue?• Which book has this reader ordered?Which book has this reader ordered?• When will a ordered book become available?When will a ordered book become available?
1.1 What is a Database System?1.1 What is a Database System?
1. What Information do you need to for 1. What Information do you need to for managing your book shop?managing your book shop?
2. What management activities are involved?2. What management activities are involved?
3. How to design a computer system to help 3. How to design a computer system to help the staff to manage all the activities? the staff to manage all the activities?
1.1 What is a Database System?1.1 What is a Database System?
1. Information needed:1. Information needed:• Books (authors, title, price);Books (authors, title, price);• Readers (name, address, telephone, orReaders (name, address, telephone, ordered book, books rent)dered book, books rent)• Books in shop;Books in shop;• Books on order;Books on order;
1.1 What is a Database System?1.1 What is a Database System?
2. Management activities2. Management activities1) To check the availability of a book;1) To check the availability of a book;2) If this book is on order?2) If this book is on order?3) How many book has a reader rent?3) How many book has a reader rent?4) If there is any book overdue?4) If there is any book overdue?5) The charge to rent or buy a book5) The charge to rent or buy a book6) ……6) ……
1.1 What is a Database1.1 What is a Database
Books:Books:
Readers:
Book_Title Authors Published date Price
Relational Databases BEA 2000.5 12.35
Java EFH 2001.2 16.50
Name Address Telephone
Eric Leeds 0113-
Peter Bradford 01274-
Any More…….?
1.2 How to implement the Database 1.2 How to implement the Database ManagementManagement
Interaction between Interaction between DataData and and ProgramsPrograms
Data Program User
1.3 Conventional Approach1.3 Conventional Approach
File-oriented:File-oriented:• Data: represented in a convenient Data: represented in a convenient
form. form. Database, BEA, 2000.5, 12.5Jave, EFH, 2001.2, 16.5…………
Need to design the data files for a specific activity;
Database does not exist as a single structure,
Database is distributed across a number of files.
1.3 Conventional Approach1.3 Conventional Approach
Programs are central, need to know:Programs are central, need to know:• how the files are organized?how the files are organized?• how records may be accessed, and the how records may be accessed, and the
meaning of data?meaning of data?As a result,As a result, Expensive to develop/maintain the Expensive to develop/maintain the
systemsystem Difficult in Manage Data. Difficult in Manage Data.
DB1Program
DB2
DB3 DB4
1.4 Database Approach1.4 Database Approach
Database-oriented:Database-oriented: Data: represented in table form. Data: represented in table form.
Database is central –designed and managed in its own right, by Database administrator (DBA).
• Programs are designed around the database.
Book_Title Authors Published date Price
Databases BEA 2000.5 12.35
Java EFH 2001.2 16.50
1.5 What is a Database1.5 What is a Database
Database management system (DBMS): Database management system (DBMS): a type of computer program, which is used a type of computer program, which is used
to manage data stored on a computer;to manage data stored on a computer; DBMS aims to enable other programs and DBMS aims to enable other programs and
users to make use of that data.users to make use of that data.
User1Database
User2
User3 User4
1.5 What is a Database1.5 What is a Database
Relational DBMS - (RDBMS)Relational DBMS - (RDBMS)• one of the wide used and the easies to one of the wide used and the easies to
operate database systems.operate database systems.• Relational data model – the basis of Relational data model – the basis of
RDBMS.RDBMS.
1.5 What is a Database1.5 What is a Database
Relational DBMS - RDBMS:Relational DBMS - RDBMS:• theoretical foundationtheoretical foundation – relational – relational
model.model.• Logical data structure -Logical data structure - Table Table..
a table has a name and is made up of named a table has a name and is made up of named columns of data. Each row contains one value columns of data. Each row contains one value per column.per column.
Warehouse_No Location
WH1 Leeds
WH2 Bradford
1.6 RDBMS Architecture1.6 RDBMS Architecture
Relational DBMSRelational DBMS
External Model A External Model n
Program 1 Program 2 Program n
Logical Model
Internal Model
Device ModelHardware Level
Physical Level
Global Level
DBMS
Datadictionary
Database
1.6 Advantage and Cost of a Database 1.6 Advantage and Cost of a Database ApproachApproach
Program
????? ?!?!
Database
1.6 Advantage and Cost of a Database 1.6 Advantage and Cost of a Database ApproachApproach
Advantages:Advantages:1) without affecting the users.1) without affecting the users.
Database may be tuned;Database may be tuned; Database can be updated;Database can be updated;
2) Data may be shared by many applications/users;2) Data may be shared by many applications/users;3) Greater security and integrity: 3) Greater security and integrity:
the data is collected together, the data is collected together, the data is managed by database administrator (Dthe data is managed by database administrator (DBA)BA)
Database
1.6 Advantage and Cost of a Da1.6 Advantage and Cost of a Database Approachtabase Approach
4) Greater productivity4) Greater productivity - easier and faster to create applications programs- easier and faster to create applications programs - - NO NO need to include details of how the data are need to include details of how the data are
physically stored;physically stored; - - NOTNOT necessary to change applications programs necessary to change applications programs
when the database is changed;when the database is changed; - - NONO need to be re-store the data for new need to be re-store the data for new
applications.applications.
1.6 Advantage and Cost of a Da1.6 Advantage and Cost of a Database Approachtabase Approach
Costs:Costs:1) requires more hardware resources - a minimu1) requires more hardware resources - a minimum requirement in order to run the DBMS.m requirement in order to run the DBMS.2) additional software is required to support the 2) additional software is required to support the database approach - need extend programmidatabase approach - need extend programming languages.ng languages.3) Cost of employing DBA team.3) Cost of employing DBA team.
1.7 Your Homework1.7 Your Homework