csc 4480: principles of database systems goals for today's class

23
CSC 4480: Principles of Database Systems Professor Mirela Damian http://www.csc.villanova.edu/~mdamian/ 2 Goals for Today’s Class Course overview – Introductions – Course goals – Resources – Grading – Policies Introduction to Databases

Upload: dinhkien

Post on 04-Jan-2017

229 views

Category:

Documents


0 download

TRANSCRIPT

CSC 4480: Principles of Database Systems Professor Mirela Damian

http://www.csc.villanova.edu/~mdamian/

2

Goals for Today’s Class

•  Course overview –  Introductions – Course goals – Resources – Grading – Policies

•  Introduction to Databases

3

Introductions

•  Mirela Damian (professor) –  Room 167A in the Mendel Science Building –  [email protected]

4

Course Goals

•  Understand database principles and technologies underlying database management systems.

•  Understand data models, physical data organization, data design, normalization, and querying.

•  Learn a commercial database systems, such as Oracle and MySQL.

•  Develop an application based on a medium size database.

5

Learning Materials •  Required book

–  Modern Database Management, 11/E –  Jeffrey A. Hoffer, Ramesh Venkataraman

and Heikki Topi

•  Additional materials posted on the class web site.

6

Resources: Programming Environment •  Unix machine csdb.csc.villanova.edu"•  Runs oracle and mysql"

tanner csgate

degas rodin csdb

NFS

Any lab, or your own "PC/Mac/Linux Computer"

SSH"

SSH

SSH

7

Resources: Programming Environment •  On your laptop, install"-  Microsoft SQL Server 2008 R2 (database engine)"-  SQL Server Management Studio Express (client)"-  Visual Web Developer Express 2010 (IDE)"

-  Available for free at "

http://www.microsoft.com/express/Downloads/"

8

Grading •  Exam (30%)

–  One exam

•  Assignments (30%) –  Typed and neatly drawn –  First assignment is available now

•  Project (30%) –  To be completed in stages

•  Other – Class Participation (10%) •  Lecture attendance is mandatory

Any questions before we start?

Chapter 1 The Database Environment and

Development

12

Basic Definitions

•  Database (DB): collection of data •  DB Application: App with specific purpose

that accesses one database •  Database Management System (DBMS):

generic program to manage databases

13

Basic Terms

•  Data: Meaningful facts, graphics, images, sound, video segments.

•  Information: Data processed to be useful in decision making.

•  Metadata (schema, intension): Description of data (Data about the data).

•  Database instance (extension): Actual data

14

Figure 1-1a Data in Context

Difficult to interpret or make decisions based on large volume of facts

15

Figure 1-1b Summarized data

Useful information that managers can use for decision making and interpretation

16

Importance of Information •  Information is at the core of everything

around us. Our entire existence (including businesses) is a process of gathering, analyzing, understanding, and acting on the information.

•  Modern organizations are said to be drowning in data but starving for information.

17

Descriptions of the properties or characteristics of the data, including data types, field sizes, allowable

values, and data context

18

•  Driver’s name, address, and birthdate

•  The driver’s name is a 30-character field •  A photo image of the driver •  An image of the driver’s fingerprint •  The driver’s birth date must precede today’s

date by at least 16 years

Data or Metadata?

19

Types of Data Processing

•  File-based data processing •  Data-based data processing

20

Figure 1-2: Old file processing systems at Pine Valley Furniture

Duplicate Data

What is the main problem in the

company’s processing systems?

21

Disadvantages of File Processing •  Program-Data Dependence

–  All programs maintain metadata for each file they use

•  Data Redundancy (Duplication of data) –  Different programs have separate copies of the same data

•  Limited Data Sharing –  No centralized control of data

•  Lengthy Development Times –  Programmers must design their own file formats

•  Excessive Program Maintenance –  80% of of information systems budget

22

SOLUTION: The DATABASE Approach

•  Central repository of shared data •  Data is managed by a controlling agent •  Stored in a standardized, convenient form

Requires a Database Management System (DBMS)

23

Database Management System

DBMS manages data resources like an operating system manages hardware resources

DBMS Database

containing centralized

shared data

Application #1

(Order)

Application #2

(Invoicing)

Application #3

(Payroll)

n  A software system that is used to create, maintain, and provide controlled access to user databases

24

Database Management System

•  A DBMS is a data storage and retrieval system which permits data to be stored non-redundantly while making it appear to the user as if the data is well-integrated.

•  In short, a DBMS is a software package that manages a database.

25

Advantages of Database Approach

•  Program-Data Independence –  Metadata stored in DBMS, so applications don’t need to worry

about data formats (you will know this when you learn SQL) –  Data queries/updates managed by DBMS so programs don’t need

to process data access routines –  Increased application development and maintenance productivity

•  Minimal Data Redundancy – Leads to increased data integrity/consistency

•  Plus many others, see Table 1-3 –  Security, Backup/Recovery, Concurrency (not in Table 1-3)

The Database Approach

27

Elements of the Database Approach •  Data models

–  Graphical system capturing nature and relationship of data –  Enterprise Data Model

•  high-level entities and relationships for the organization –  Project Data Model

•  more detailed view, matching data structure in database

•  Entities –  Noun form describing a person, place, object, event, or concept –  Composed of attributes

•  Relationships –  Usually one-to-many (1:M) or many-to-many (M:N)

•  Relational Databases –  Database technology involving tables (relations) representing

entities and primary/foreign keys representing relationships

28

Segment of an Enterprise Data Model

Figure 1-3: Comparison of enterprise and project level data models

CUSTOMER ORDER

Q1. One CUSTOMER normally places ___ ORDER?

Q2. One ORDER normally is placed by __ CUSTOMER?

How about the relationship between ORDER and PRODUCT? (see next slide)

1

M

29

Q3. One PRODUCT normally is contained in __ ORDER?

Q4. One ORDER normally contains __ PRODUCT? M

M

30

Q3. One PRODUCT normally is contained in __ ORDER?

Q4. One ORDER normally contains __ PRODUCT? M

M

Figure 1-3 Segment of enterprise data model

31

Figure 1-3 Segment of enterprise data model

One customer may place many orders, but each order is placed by a single customer

à One-to-many relationship

32

Figure 1-3 Segment of enterprise data model

One order has many order lines; each order line is associated with a single order

à One-to-many relationship

33

Figure 1-3 Segment of enterprise data model

One product can be in many order lines, each order line refers to a single product

à One-to-many relationship

34

Figure 1-3 Segment of enterprise data model

Therefore, one order involves many products and one product is involved in many orders

à Many-to-many relationship

35

Exercise #1 (p.44)

For each of the following pairs of related entities, indicate whether (under typical circumstances) there is a one-to-many or many-to-many relationship. Draw a diagram for each relationship. a.  STUDENT and COURSE (students register for courses) b.  BOOK and BOOK COPY (books have copies) c.  COURSE and SECTION (courses have sections) d.  SECTION and ROOM (sections are scheduled in rooms) e.  INSTRUCTOR and COURSE

36

Exercise #12 (p.44) Consider your school as a business enterprise. Define several major data entity types and draw a preliminary enterprise data model.

37

Figure 1-3 Segment of project data model

38

Figure 1-5 Components of the database environment

39

Components of the Database Environment

•  CASE Tools–computer-aided software engineering •  Database Management System (DBMS) –software for

managing the database •  Database–storehouse of the data •  Application Programs–software using the data •  User Interface–text and graphical displays to users •  Data/Database Administrators–personnel responsible

for maintaining the database •  System Developers–personnel responsible for

designing databases and software •  End Users–people who use applications and databases

40

Figure 1-6 Two-tier database

41

The Range of Database Applications

(Web-enabled Database )

(Wide Area Network)

(WAN)

(Local Area Network)

42

The Range of Database Applications

•  Personal databases •  Two-tier Client/Server databases •  Multitier Client/Server (or called web-

enabled) databases •  Enterprise applications

– Enterprise resource planning (ERP) systems – Data warehousing implementations

43

Figure 1-12 Three-tiered database architecture

44

Three-Schema Architecture

•  3 levels of abstraction – External: view of managers, employees – Conceptual: view of data architect / administrator –  Internal (Logical/Physical): data representation

45

Example of Views

46

Steps in the Database Development Process

•  Enterprise Modeling (Ch. 1) •  Conceptual Data Modeling (Ch. 2, 3) •  Logical Database Design (Ch. 4) •  Physical Database Design (Ch. 5) •  Database Implementation (Ch. 6, 7) •  Database Maintenance (all)