09.02.2015 Views

Lecture 1: Introduction to Database - Nubacad.com

Lecture 1: Introduction to Database - Nubacad.com

Lecture 1: Introduction to Database - Nubacad.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Levels of Abstraction (cont…)<br />

1. Physical or Internal level<br />

The lowest level of abstraction describes how the data are actually<br />

s<strong>to</strong>red. Complex low-level data structures and access methods<br />

are described in detail.<br />

2. Logical or Conceptual level<br />

The middle level describes what data are s<strong>to</strong>red in the database,<br />

and what relationships exist among those data. The entire<br />

database is described in terms of a small number of relatively<br />

simple structures.<br />

3. View or External or User level<br />

The highest level of abstraction describes only part of the entire<br />

database of concern <strong>to</strong> a user or application program. application<br />

programs hide details of data types. Views can also hide<br />

information (e.g., salary) for security purposes.<br />

The system may provide many views for the same database.<br />

21<br />

• Conceptual schema:<br />

Example: University <strong>Database</strong><br />

• Students(sid: string, name: string,<br />

login: string, age: integer, gpa:real)<br />

• Courses(cid: string, cname:string,<br />

credits:integer)<br />

• Enrolled(sid:string, cid:string,<br />

grade:string)<br />

• External Schema (View):<br />

• Course_info(cid:string,enrollment:integer)<br />

• Physical schema:<br />

• Relations s<strong>to</strong>red as unordered files.<br />

• Index on first column of Students.<br />

View 1 View 2 View 3<br />

Conceptual Schema<br />

Physical Schema<br />

DB<br />

22<br />

• Instance<br />

Instances and Schemas<br />

<strong>Database</strong> change over time as information is<br />

inserted and deleted. The collection of information<br />

s<strong>to</strong>red in the database at a particular moment is<br />

called an instance of the database.<br />

[<br />

• Schema<br />

The overall design of the database is called the<br />

database schema.<br />

<strong>Database</strong> systems have several schemas,<br />

partitioned according <strong>to</strong> the levels of abstraction. At<br />

the lowest level is the physical schema; at the<br />

intermediate level is the logical schema; at the<br />

highest level is the subschema.<br />

23<br />

Data Models<br />

A data model is a collection of concepts for<br />

describing data and data relationships.<br />

•Entity-Relationship model<br />

•[<br />

•Relational model<br />

•Other models:<br />

object-oriented model<br />

semi-structured data models (XML)<br />

Older models: network model and hierarchical<br />

model<br />

24<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!