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 • � 3 lab-marked exercises • � nza@cs.nott.ac.uk • � 2 written exercises • � Office: C13 • � each worth 5% • � Lectures • � 75% Examination • � Wednesdays 9-10 in LT3 • � 2 hour written exam • � Fridays 14-15 in • � Answer 3 out of 5 JBSouth-B52 questions • � Labs Wednesday 10-12 • � Format similar to starting 18 February previous G51DBS and to G52DBS before that.
Textbook • � Recommended • � Other textbooks: textbooks: • � There are lots of database texts • � ‘Database Systems: A practical approach to • � Most of them would design, implementation be fine also and management ’ by • � For example: Connolly and Begg • � ‘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 18 February • � Data models • � SQL • � Database design • � creating a database • � SQL • � 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 • � Protect • � We focus mainly on the software their data.
Database Users • � End users • � Database Administrator (DBA) • � Use the database 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) • � MS SQL Server • � A database • � MS Access management system • � Ingres (DBMS) is the • � PostgreSQL software than • � MySQL controls that 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 database objects information about (tables, users, rules, the database itself views, indexes,… ) • � This is data about • � Information about data or ‘metadata’ who is using which data (locks) • � Almost every aspect • � Schemas and of the DBMS uses 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 Relational Model of • � Navigating the 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 • � Data integrity • � There is a sound • � Data manipulation mathematical theory • � More details in the of relations next lecture… • � Most modern DBMS are based on the relational model
ANSI/ SPARC Architecture • � ANSI - American • � A three-level National Standards architecture Institute • � Internal level: For systems designers • � SPARC - Standards • � Conceptual level: For Planning and 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 level shouldn’t affect • � External/ Conceptual conceptual level • � Conceptual/ Internal • � Logical data • � These mappings independence provide data • � Conceptual level independence 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 Stored Internal Schema 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 G51DBS webpage)
Recommend
More recommend