1. Wkiipedia Definition
A database is an organized collection of data, generally stored and accessed electronically from a computer system.
2. Programming data structures and databases
- You have to find a way to map data structures in your programming language to data structures held by the (relational) database.
- OO data structure <——> DBs
3. The world’s simplest databases
3.1. File-based databases
- Linux configuration files: /etc/xxx
- DNS/Network configuration files …
3.2. Problems
- No standards
- Data duplication
- Data dependence
- No way to generate complex queries (e.g., JOIN)
- No provision for concurrency, security, recovery, etc.
4. DBMS - Database Management Systems
4.1. Definition
A database is a system to allow multiple users to share the same information
A Database Management System (DBMS) is the software that implements a database
- a collaborative system
- uniqueness
- data integrity/consistency
4.2. What a DBMS does?
- store data
- manage change (updates)
- organise data
- retrieve data
- retain privacy (security)
- ensure reliability & consistency (no redundancy, transactional model, etc.)
4.3. What a DBMS provides?
SQL=(DDL, DML, DCL)
- Data Definition Language (DDL)
- e.g., ‘CREATE’ table
- Data Manipulation Language (DML)
- e.g., ‘INSERT’ row
- Data Control Language (DCL)
- e.g., ‘GRANT’ privilege on table to user
4.4. DBMS components
- Data dictionary: stores information about database objects
- Data dictionary compiler: extracts database information and stores it in the data dictionary
- Query processor: parses / interprets and optimises user queries (caching?)
- Transaction manager: communicates with recovery manager and scheduler to ensure data consistency in multi-user environments
- Storage manager: deals with concrete file I/O etc.
4.5. ANSI / SPARC architecture
Three tier architecture:
- internal level/schema: For systems designers (OS, file system level , provides platform independent service for conceptual level)
- Conceptual level/schema: For database designers (structure for all users, abstracted from internal level)
- External level/schema: For database users (user view, subject to access permissions, multiple possible views)
Not fully implemented in any DBMS: Eg. external level blended with conceptual level (MySQL)
4.6. Database systems programmers
- Database systems programmers: writes the DBMS software
- Database administrators (DBA): designs and manages the database system
- Applications developers: write the client software that allows end users to interface with the DBMS
- End users: use the information provided by the database to achieve a personal or organisational goal
5. Lab Exercise
5.1. Exercise Guide
5.2. My Answer
1 | -- Create Database |