Introduction Example databases Overview of concepts Why use database systems Who wants to study databases? What is the use of all the courses I have taken so far? This course shows very concrete how CS is used in the outside world This course uses a lot of the basics introduced in the 200/300 level courses I want to work in an interdisciplinary environment Be an application developer building solutions for all kinds of fields working with people from other areas (e-commerce, science, administration, law, etc. etc.) I love the internals of how computers and systems work Be a database administrator or a DBS developer: a DBMS is an entire operating system and more I am more a theoretical person Database systems have a very sound theoretical foundation and there are many exciting open problems I want to work with computer languages, human-computer interaction, multimedia, logic, communication, distributed systems, knowledge management,. It s all there I want to make a lot of money E-commerce, banks and business: here you are I am not interested in databases You will have to use them anyway 421B: Database Systems - Introduction 2
Example Databases University Data: departments, students, exams, rooms,... Usage: creating exam plans, enter exam results, create statistics, build timetables, Web-based access common Bank Airline Online Bookstore Weather and Climate Forecast 421B: Database Systems - Introduction 3 The good of DB: data-centric Data model Interface Insert data Query data Change data Efficiency Index structures / storage Own operating system Transactions Consistency persistence 421B: Database Systems - Introduction 4
Emphasis of the Course How to organize, maintain and retrieve information using a DBMS design of databases usage of DBMS Understand how DBMS work in order to use them appropriately 421B: Database Systems - Introduction 5 Client/Server-Architecture End user Application Programmer Application Programs Interpreter for ad-hoc queries Clients Database Management System Server Database Administrator Database 421B: Database Systems - Introduction 6
Example DBMS Relational DBMS companies like Oracle IBM offers its relational DB2 system. With IMS (40 years old!), a non-relational system, IBM is by some accounts the largest DBMS vendor in the world Microsoft offers SQL-Server, plus Microsoft Access for the cheap DBMS on the desktop, answered by lite systems from other competitors There exist several widely used open-source DBMS: PostgreSQL and MySQL being the best known of them XML database systems Object-oriented database systems Embedded database systems 421B: Database Systems - Introduction 7 Data Models A data model is a collection of concepts for describing data Data models from programming languages / data structure class: object with attributes struct in C list in LISP a binary tree A schema is a description of a particular collection of data, using a given data model 421B: Database Systems - Introduction 8
Relational Data Model Most DBMS are based on the relational data model Main concept: relation, basically a table with rows and columns Every relation has a schema, which describes the columns (also called attributes or fields) and their data types (always basic) the set of rows in the table is called the instance of the relation CD SID LastName FirstName. (int) (string) (string) Schema of Relation Student 123 Bunny Bugs. 124 Explorer Dora. 125 Shortcake Strawberry Instance of Relation Student 421B: Database Systems - Introduction 9 Why the relational model alternative schemes: pre-relational: network / hierarchical post-relational: OO / XML all are more complex / appear more powerful / integrate more semantic meaning advantages of relational model simple strong mathematical foundation very good optimization possibilities for data access 421B: Database Systems - Introduction 10
Semantic Data Model: Entity- Relationship Model Entity A Att1 Att2 att3 Relationship related to Entity B Btt1 Btt2 btt3 421B: Database Systems - Introduction Querying Data Querying the database: Give me all Students that major in Computer Science Give me the number of students registered in COMP 421 Inserting data into the database Insert a new student Register a student into a course Updating existing data change the grade of a student in a course Specific query languages for DBMS: best known is SQL and OQL 421B: Database Systems - Introduction 12
Data Storage and Data Access A typical DBMS has a layered architecture Disk space management, buffer management, files and access methods represent (nearly) an operating system on top of the operation system Fast and sophisticated data retrieval requires special index structures query optimization techniques Query Optimization And Execution Relational Operators Files and Access Methods Buffer Management Disk Space Management 421B: Database Systems - Introduction 13 DB Transaction Management: Controlling the Database Access Key concept is transaction, which is an atomic sequence of database actions (read and write operations on data items) A transaction represents a logical unit of operations (from the application point of view) Often user program = transaction For instance: transfer transaction = debit of account X, credit on account Y ACID properties: atomicity, consistency, isolation, durability 421B: Database Systems - Introduction 14