Beruflich Dokumente
Kultur Dokumente
Books Fundamentals of Database Systems, Elmasri and Navathe An Introduction to Database Systems, C.J. Date Database Analysis and Design, I.T. Hawryszkiewycz An Introduction to Database Systems, B.P. Desai
Course Outline Introduction to Database Systems and Architecture The Relational Model Data Modelling and Entity-Relationship Diagrams Relational Languages Relational Design and Functional Dependency Normal Forms and Decomposition
Why Databases?
Single User Case A wine list is an example Using a database for a very small list does not show advantages Consider a large off licence chain the wine lists could be very large and could change frequently
Advantages of Databases Compactness compared to paper Speed Fast updates Less Drudgery paper is tedious Currency up-to-date and accurate
Multi-user Case More complex databases Same advantages as above + multiple simultaneous users Single point of control for a large enterprise
RELATION: WINELIST
Bin# 2 21 22 30 43 45 48 50 51 52 58 64 12 Wine Chardonnay Fume Blanc Fume Blanc Gewurztram. Cab. Sauv. Cab. Sauv. Cab. Sauv. Pinot Noir Pinot Noir Pinot Noir Merlot Zinfandel Riesling Producer Buena Vista Ch. St. Jean Robt. Mondavi Ch. St. Jean Windsor Geyser Peak Robt. Mondavi Gary Farrell Fetzer Dehlinger Clos du Bois Cline Jekel Year 1997 1997 1996 1998 1991 1994 1993 1996 1993 1995 1994 1994 1998 Bottles 1 4 2 3 12 12 12 3 3 2 9 9 1 Ready 1999 1999 1998 1999 2000 2002 2004 1999 2000 1998 2000 2003 1999
Retrieving Data:
SELECT BIN#, WINE, PRODUCER FROM WINELIST WHERE Ready=2000;
This query statement would add a new row to the table. Changing Existing Data:
UPDATE WINELIST SET Bottles=3 WHERE BIN# = 21;
Data Administration Data is one of an enterprises most valuable assets. In large organisations: The Data Manager should be a senior management person. They determine the database layout (database schema), interfaces, policy and upgrades. They determine who can access the data (security policy) and what permissions they have (e.g. read only, update, delete). The Database Administrator implements the technical processes of installing, configuring and maintaining the database.
Avoid any data inconsistency - if the same data is stored in two different files, it must be ensured that if the data is updated in one location, the data in the other location remains consistent with the change. Otherwise, conflicting data will exist within the database for the same information. If this does occur, the database is said to be inconsistent and may provide incorrect or conflicting information to its users. Note how this requirement is related to the requirement to reduce redundancy. Provision for security restrictions - the database manager must be able to put security checks in place to ensure that all users are accessing the database through the proper channels. It may also be required to protect sensitive information from unauthorised access. Security is vital in a large database system, as there is usually a core set of data, which, if tampered with could potentially result in the destruction of the database, and which must therefore be restricted from general access.
Database Architecture
A data-independent architecture is divided into three general levels, as follows: The internal level is the one closest to physical storage - i.e. it is the one concerned with the way the data is actually stored; The external level is the one closest to the users - i.e. it is the one concerned with the way the data is viewed by individual users; The conceptual level is a 'level of indirection' between the other two.
User View
User View
User View
External Level
Conceptual Level
Storage View
Internal Level
If the external level is concerned with individual user views, the conceptual level may be regarded as being concerned with a community user view. In other words, there will be many distinct external views, each consisting of a more or less abstract representation of some portion of the total database, and there will be precisely one conceptual view of a similarly abstract representation of the database in its entirety. The storage view shows how the data is actually stored in reality - in bits and bytes on some storage unit.
An example, using relational database structures would appear as shown below. The tables shown on the conceptual level represent the structures of two relational files. In the external views, new tables are created by mapping fields of the conceptual tables onto a new structure defined specifically for that user view. Similarly, the data in the fields of the conceptual view are acquired through a mapping to the actual location of that data on the storage medium.
ID 01 02 07
Name
External View
ID 01 02 07
ID
Conceptual View
01 02 07
01
Smith 07
02 Brown
Storage View
The strength of this architecture is contained in the mappings between the levels. If it is desired to create a new user view or alter an existing view, it is only necessary to define the mappings from the conceptual level. Also, in a similar fashion, if the administrator wishes to alter the location (or data type, size in bytes etc.) of data in the database, it is not necessary to alter the conceptual view a change in the mapping from conceptual to internal level (if necessary) will allow the conceptual view to remain the same, with the mapping pointing to the new data location.
The DBMS The Database Management System (DBMS) is the software which handles all database access. Therefore, all users of external views read and manipulate data by sending requests to the DBMS. The DBMS then examines the external views, conceptual view and mappings to evaluate the operations which need to be carried out on the actual data in storage. It is also through the DBMS that the database administrator creates new external views, adapts the conceptual or storage view and manipulates mappings. Therefore, the system architecture may be amended as shown below to show that the DBMS touches on all levels of the architecture, and that therefore, all manipulation of the structure of the database or the information in it must be done through the DBMS.
User View
User View
User View