comp 207 database development and design

33
COMP 207 Database development and design M S Khan Room G.22 Dept of computer science University of Liverpool [email protected] www.csc.liv.ac.uk/~khan/COMP207.html

Upload: hunter-everett

Post on 31-Dec-2015

44 views

Category:

Documents


3 download

DESCRIPTION

COMP 207 Database development and design. www.csc.liv.ac.uk/~khan/COMP207.html. M S Khan Room G.22 Dept of computer science University of Liverpool [email protected]. What is this module about?. In COMP 102 you learn the basics of relational databases. Here we focus on: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: COMP 207 Database development and design

COMP 207

Database development and design

M S Khan

Room G.22

Dept of computer science

University of Liverpool

[email protected]

www.csc.liv.ac.uk/~khan/COMP207.html

Page 2: COMP 207 Database development and design

What is this module about?

In COMP 102 you learn the basics of relational databases.

Here we focus on:• Database design principles for ER models:

• Logical and physical layer

• Transaction models• Concurrency• Recoverability

• Object oriented models• Semi structured models

2

Page 3: COMP 207 Database development and design

Prerequisites

• Entity relationship (E/R) modelling• Relational data model• Good knowledge of SQL

3

Page 4: COMP 207 Database development and design

Content of the course

Part 1: Revise basic notions of relational DatabasesPart 2: Advanced database design: Normalisation,

Logical and Physical DB design methodologies; Part 3: Transaction management;Part 4: Overview on Object Oriented and Object

Relational databases;Part 5: Semi-structured models: XML;Part 6: Data Mining.

4

Page 5: COMP 207 Database development and design

Aims

To introduce students to:• a systematic design approach to developing

databases, including the use of normalisation; • the problems arising from concurrency in

databases, and how they are solved; • the problems involved in the integration of

heterogeneous sources of information and semi-structured data;

• non-relational databases; • techniques for analyzing large amounts of data.

5

Page 6: COMP 207 Database development and design

Learning outcomes

At the conclusion of this module, students should:• understand the principles of the relational database model.• understand the design process underlying the design of

databases and the use of normalization;• understand the concepts involved in transaction

management;• understand the XML terminology and syntax and

understand how to use XML;• understand OODBS and their advantages and

disadvantages to relational DBS;• understand basic concepts of data mining;

6

Page 7: COMP 207 Database development and design

Textbooks

• Connolly & Begg. “Database systems”. Addison Wesley (fifth edition); • R. Elmasri, S.B. Navathe. “Fundamentals of Database Systems” (third

edition) Addison Wesley;• H. Garcia-Molina, J.D.Ullman, J Widom "Database systems. The

complete book”. Prentice Hall (First or Second Edition);

Useful readings: • J.D.Ullman, J Widom ”A First Course in Database Systems" Prentice

Hall (ThirdEdition);• Silberschatz, Korth and Sudarshan. “Database System Concepts”

McGraw-Hill

• N. Shah, "Database Systems using Oracle", Prentice Hall

7

Page 8: COMP 207 Database development and design

Assessment weightings

• 80% Exam;• Note - all of material covered by the module is relevant, and

thus any of it could appear in the exam...!

• 20% Coursework;

1. The coursework will consist of two assignments, most probably one in week 5 and the other in week 9;

2. There are 4 lab slots available, in order to avoid conflicts with lectures:

3. The lab slots can also be used to access the weekly exercises on Vital!

8

Page 9: COMP 207 Database development and design

Module Delivery

Lecture Times:

– Tuesday 12:00 (SHER-LT1)

– Thursday 13:00 (CHAD-LT CHAD)

– Friday 09:00 (SHER-LT1)

Lab Classes:– Formal Labs (with exercises) weekly at:

– Thursdays: 09:00 – 10:00 and 10:00 – 11:00

– Fridays: 10:00 – 11:00 and 11:00 – 12:00

– Commence in Week 3 in Lab 3, Holt Building

– Check the course website to see which class you’re in

Page 10: COMP 207 Database development and design

Resources

Printouts of the lecture notes will be available from the Computer Science Helpdesk

– This module will evolve as the module proceeds. Whilst we will strive to adhere to the made available at the beginning of the module (lecture 3), these may vary slightly from the slides delivered. Additional or amended notes will appear on the web after each lecture.

Exercises, and answer to common questions will be posted on Vital.

Page 11: COMP 207 Database development and design

Expectations

The field of Databases is vast and still evolving:– Exams and Exercise questions rely on

understanding and applying much of the material in this module.

– Don’t rely on simply remembering the notes, as this won’t help you pass...!

Page 12: COMP 207 Database development and design

Finally...

The obvious...– Switch off all mobile phones during lectures

– Remember to sign the register

– Do not sign the register on behalf of others

– Attend lectures and attempt the exercises set – – this will help you pass the exam

– Attend the practical classes – these will help you do the coursework

– Ask questions if there is anything that you do not understand

– If you can’t hear me in the back, let me know!

And respect your fellow students...– There are people here who want to learn!

– If you want to talk or mess around, then don’t bother attending!

Page 13: COMP 207 Database development and design

13

Page 14: COMP 207 Database development and design

Lecture 1

Introduction to Databases

Page 15: COMP 207 Database development and design

Examples of Database Applications

Purchases from the supermarket:Queries for stock, prices, etc

Purchases using your credit card: Queries for credit limit, available credit…

Booking a holiday at the travel agents

Using the local library

Taking out insurance

Renting a video

Using the Internet: Amazon, Itunes…

Studying at university

Page 16: COMP 207 Database development and design

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.• Programmers need to write routines to:

- Enter new data (in the right position);- Update data making sure that no inconsistencies arise;- Delete data;- Query the relevant data;- Make sure changes are propagated throughout the file!

Page 17: COMP 207 Database development and design

Limitations of File-Based Approach

Separation and isolation of data• Each program maintains its own set of data:

– Spider and Tulip would maintain separate data!

• Users of one program may be unaware of potentially useful data held by other programs.

Duplication of data• Same data is held by different programs.• Wasted space and potentially different values

and/or different formats for the same item– Loss of data integrity

Page 18: COMP 207 Database development and design

Limitations of File-Based Approach

Data dependence• File structure is defined in the program code:

– Every change in format requires reading the original file, adding a new record to a temporary file (with the modified data), repeat this for every record! Then delete the original file and rename the temporary file… Lots of work.

Incompatible file formats• Programs are written in different languages, and so

cannot easily access each other’s files.– Makes the integration of different applications difficult

Fixed Queries/Proliferation of application programs• Programs are written to satisfy particular functions.• Any new requirement needs a new program.• Access restricted to one user at a time.

Page 19: COMP 207 Database development and design

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

We will look at many DBMS functionalities, such as transaction management, recoverability, etc…

Page 20: COMP 207 Database development and design

Database

Shared collection of logically related data (and a description of this data), designed to meet the information needs of an organization:• From disconnected files with redundant data to

integrated data items with minimum amount of duplication

System catalog (metadata) provides description of data to enable program–data independence.

Logically related data comprises entities, attributes, and relationships of an organization’s information.

Page 21: COMP 207 Database development and design

Database Management System (DBMS)

A software system that enables users to define, create, maintain, and control access to the database:• Allows the definition of the DB and its constraints (Data

Definition Language);• Allows the update, deletion and retrieval of data (Data

Manipulation Language);- In relational databases SQL is both the DDL and the DML.

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

Page 22: COMP 207 Database development and design

Database Approach

Data definition language (DDL).• Permits specification of data types, structures and

any data constraints. • All specifications are stored in the database.

Data manipulation language (DML).• General enquiry facility (query language) of the

data.

Page 23: COMP 207 Database development and design

Database Approach

The DBMS provides controlled access to database including:• a security system• an integrity system• a concurrency control system• a recovery control system• a user-accessible catalog.

Page 24: COMP 207 Database development and design

Views

Allows each user to have his or her own view of the database.

A view is essentially some subset of the database.

Page 25: COMP 207 Database development and design

Views - Benefits

Reduce complexity:• Users see only the data they are interested in;

Provide a level of security:• Data is excluded from what a user can access;

Provide a mechanism to customize the appearance of the database:• Allows users to change to rename data;

Present a consistent, unchanging picture of the structure of the database, even if the underlying database is changed

Page 26: COMP 207 Database development and design

Components of DBMS Environment

Page 27: COMP 207 Database development and design

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.

Page 28: COMP 207 Database development and design

Components of DBMS Environment

Procedures• Instructions and rules that should be applied

to the design and use of the database and DBMS.

People

Page 29: COMP 207 Database development and design

Roles in the Database Environment

Data Administrator (DA)

Database Administrator (DBA)

Database Designers (Logical and Physical)

Application Programmers

End Users (naive and sophisticated)

Page 30: COMP 207 Database development and design

History of Database Systems

First-generation • Hierarchical and Network

Second generation• Relational

Third generation• Object-Relational• Object-Oriented

Page 31: COMP 207 Database development and design

Advantages of DBMSs

Control of data redundancyData consistencyMore information from the same amount of dataSharing of dataImproved data integrityImproved securityEnforcement of standardsEconomy of scale

Page 32: COMP 207 Database development and design

Advantages of DBMSs

Balance conflicting requirements

Improved data accessibility and responsiveness

Increased productivity

Improved maintenance through data independence

Increased concurrency

Improved backup and recovery services

Page 33: COMP 207 Database development and design

Disadvantages of DBMSs

Complexity

Size

Cost of DBMS

Additional hardware costs

Cost of conversion

Performance

Higher impact of a failure