4_User-Oriented

Download Report

Transcript 4_User-Oriented

USER-ORIENTED
DESCRIPTION OF A
DATABASE MANAGEMENT
SYSTEM
CS 143
1
TWO TYPES OF DATABASES
(1) STATIC DATABASE
• Describes Entities existing in the system through
their properties.
• Describes Relationships existing between entities.
• Basically “static”; changes in the entities properties
and relationships require “protected” operations.
(2) DYNAMIC DATABASE
• Describes dynamic Entities and Relationships.
• Usually constructed as “simulation systems”.
• Dynamic behavior and commands are inherent to
the system.
CS 143
2
GENERAL USER ORIENTED
DESCRIPTION OF DBMS
• A Database Management System
(DBMS) consists of:
(1) Database
(2) Data Definition Language (DDL)
(3) Query Language (QL)
(4) Data Manipulation Language (DML)
(5) “System”
CS 143
3
THE DATABASE
• A Database may be defined as a collection of “related”,
“stripped down”, “declarative” statements arranged in a tabular
form.
• Example
Starting with the declarative statements:
- John Smith is an employee earning $35,000/year.
- Paula Jones is an employee earning $40,000/year.
- Peters is an employee working in the toy department
and earning $30,000/year.
- Paula Jones is the manager of the toy department.
- John Smith works in the toy department.
- Peters works in the toy department.
CS 143
4
SOME ACTUAL DATABASE
INSTANCES
- We would construct the following two databases:
Employee
Managers
First Name
Last Name
Department
Salary
John
Smith
toy
35000
Paula
Jones
toy
40000
Peters
toy
30000
Supervisor
Supervisees
Jones
Smith
Jones
Peters
CS 143
5
DATA DEFINITION LANGUAGE
Permits users to state imperative commands that yield (upon execution)
database Schemas and Instances.
Example:
(1) to create the schema EMPLOYEE:
CREATE TABLE EMPLOYEE (fname: string, lname: string,
department: string, salary: integer)
(2) to create the instance of EMPLOYEE shown in slide 5 above:
INSERT EMPLOYEE (<John, Smith, toy, 35000>,
<Paula, Jones, toy, 45000>, <null, Peters, toy, 30000>)
CS 143
6
QUERY LANGUAGE (QL)
• QUERY LANGUAGE (QL)
• Permits users to state queries against
the database.
• Example
SELECT lname, salary
FROM Employee
WHERE salary > 35000
CS 143
7
DATA MANIPULATION LANGUAGE
(DML)
• Permits users to manipulate (i. e. to modify)
the database.
• Example
ALTER TABLE employee
ADD COLUMN ssn INTEGER
N.B. The DDL and DML are often combined
into a single language.
CS 143
8
THE SYSTEM
• The software and hardware which
permit users to define, construct, query
and modify the database.
CS 143
9