Advanced Database Systems: Module Title
Advanced Database Systems: Module Title
Module Leader: Room no: Email address: Week 1 (Part 1 of 2) Introduction to the Module, Revision of Key Database Concepts, Revision of Key Relational Concepts Module Tutor: Room no: Email address: Delivery:
Paul Massey IT0.08 [email protected] Annette Marshall G0.35 [email protected] One hour lecture One hour tutorial
100% ICA
Assessment:
Page 1 of 34
AM - September 2009
Page 2 of 34
AM - September 2009
Module Description
The module is aimed at developing the student's ability to design and implement database applications to meet business needs. The module will investigate the issues and technologies associated with implementing and supporting databases and the services that are needed to maintain and access a repository of data. Investigations will be undertaken in a number of areas including data warehouses, integrating legacy data, data management and approaches that support the modelling and visualisation of data for a range of user views. The module will be assessed by an ICA. For this students will be required to design and implement a database solution for a given scenario and write up the results of research undertaken into a particular database area related to that scenario. 1.
Module Aims
To undertake a detailed analysis and modelling of an enterprises information processing requirements. To design and build a database that meet an enterprises information processing requirements. To investigate the issues associated with database server administration. To explore practical development issues associated with integrating legacy data and data services. To explore new and emerging trends in information visualisation and representation.
2.
3.
4.
5.
Page 3 of 34
AM - September 2009
Page 4 of 34
AM - September 2009
Key database concepts Key relational concepts SQL To enhance database design skills: Conceptual design (ER + EER modelling) Logical design (normalisation) Physical design To introduce: Query processing Query optimisation Indexes With particular reference to SQL Server. To complete the first, design, half of the ICA.
2.
3.
4.
5.
Page 5 of 34
AM - September 2009
Page 6 of 34
AM - September 2009
Tut
Wk 2 Tut
Wk 11 Tut
Working on ICA. Working on ICA. Hand in part 1 of ICA. Paul Hand in part 2 of ICA.
Page 8 of 34 AM - September 2009
Page 7 of 34
AM - September 2009
Recommended Books
Database Systems, by Thomas Connolly and Carolyn Begg, published by AddisonWesley, ISBN 0-321-21025-5 (4th Edition) Database System Concepts by Avi Silberschatz, Henry F. Korth, S. Sudarshan, published by McGrawHill, ISBN 0-07-295886-3 (5th Edition) Fundamentals of Database Systems by R. Elmasri, Shamkant B. Navathe, published by Prentice-Hall, ISBN 0-321-36957-2 (5th Edition) Database Solutions, by Thomas Connolly and Carolyn Begg, published by Addison-Wesley, ISBN 0 321 17350 3 (2nd Edition)
Tutorial 2
Revision of SQL: DDL statements for creating other constraints. DML statements for inserting data into tables. DML statement SELECT o For joining tables and retrieving data from them. o For views.
Page 9 of 34
AM - September 2009
Page 10 of 34
AM - September 2009
Page 11 of 34
AM - September 2009
Page 12 of 34
AM - September 2009
Traditional Approach
From the earliest days computers were used to store files of information. Separate systems, ie separate files and programs, were developed for each application, eg payroll files, personnel files, accounts files, etc.
Data File
Resource System
Resource Summary
Page 13 of 34
AM - September 2009
Page 14 of 34
AM - September 2009
Problems
Inconsistency Redundancy Lack of integration and control
What is a Database?
A shared collection of logically related data, and a description of this data, designed to meet the information needs of an organisation. Database Systems by Connolly & Begg Addison-Wesley, ISBN 0-201-70857-4
A database system can be thought of as a computerised record-keeping system. Such a system involves the data itself (stored in the database), hardware, software and most important! users. Databases are integrated and (usually) shared; they are used to store persistent data. An Introduction to Database Systems by C J Date, Addison-Wesley ISBN 0-201-38590-2 (7th Edition)
Resource System
Page 15 of 34
AM - September 2009
Page 16 of 34
AM - September 2009
Page 17 of 34
AM - September 2009
Page 18 of 34
AM - September 2009
External Level
The users view of the database. Also known as the applications view.
Conceptual Level
The objective is to separate each users view of the database from the way it is physically represented. 3 levels or views of data within a database: External level Conceptual level Internal level The overall view of the database. Also known as the global view.
Internal Level
The physical representation of the database on the computer. Also known as the storage view.
Page 19 of 34
AM - September 2009
Page 20 of 34
AM - September 2009
Schemas
The overall description of the database is called the database schema. There are 3 different types of schema in the database.
Mapping
Provides the translation between the schemas at different levels. The DBMS is responsible for mapping between the 3 types of schema. The DBMS must ensure that each external schema is derivable from the conceptual schema. The DBMS must use the information in the conceptual schema to map between each external schema and the internal schema.
External Schema
There are multiple external schemas (or subschemas), each one corresponding to a different view of the data.
Conceptual Schema
There is one conceptual schema, which describes the data stored in the database, the relationships and the integrity constraints.
Internal Schema
There is one internal schema, which describes how the data are stored in the database and how they are accessed.
Page 21 of 34
AM - September 2009
Page 22 of 34
AM - September 2009
Data Independence
A major objective for the 3-level architecture is to provide data independence, ie upper levels must be unaffected by changes to lower levels. There are 2 kinds of data independence: Logical data independence refers to the immunity of the external schemas to changes in the conceptual schema. It should be possible to alter tables, columns or relationships without having to alter existing external schemas or rewrite application programs (other than those that are directly affected). Physical data independence refers to the immunity of the conceptual schema to changes in the internal schema. It should be possible to alter file organizations, storage devices, indexes, etc, without having to alter the conceptual or external schemas.
Page 23 of 34
AM - September 2009
Page 24 of 34
AM - September 2009
Database Languages
A Data Definition Language (DDL) is used to specify the data in the database. A Data Manipulation Language (DML) is used to access the data. A Data Control Language (DCL) is used to control access to the data.
Types of Database
5 main logical structures (in terms of how data are organised, stored and manipulated): 1. Hierarchical 2. Network 3. Relational 4. Object-oriented
Some databases have a combined DDL, DML and DCL (often called a Query Language), eg SQL.
5. Object-relational See pp 45-47 of Connolly & Begg for brief descriptions of 1-3 and Chapters 25-28 for details of 4-5.
Page 25 of 34
AM - September 2009
Page 26 of 34
AM - September 2009
At first considered impractical, but in the late 1970s prototype System R developed by IBM and during 1980s commercial products began to appear, in particular Oracle from Oracle Corporation.
Page 27 of 34
AM - September 2009
Page 28 of 34
AM - September 2009
Relation A relation is a table that obeys the following rules: There are no duplicate rows in the table. The order of the rows is immaterial. The order of the columns is immaterial. Each attribute value is atomic, ie each cell can contain one and only one data value. ANIMAL ANAME Candice Zona Sam Elmer Leonard AFAMILY Camel Zebra Snake Elephant Lion WEIGHT 1800 900 5 5000 1200
Page 29 of 34
AM - September 2009
Page 30 of 34
AM - September 2009
No part of the primary key may have a null value. This is known as the entity integrity rule.
Page 31 of 34
AM - September 2009
Page 32 of 34
AM - September 2009
You may need to combine 2 or more tables to find out a particular piece of information, eg you may want a report on the animal name, family and food. You relate the data in one table to the data in another through foreign keys.
ANO in the ANIMAL-FOOD table is part of the primary key and also a foreign key.
Page 33 of 34
AM - September 2009
Page 34 of 34
AM - September 2009