Presentation is loading. Please wait.

Presentation is loading. Please wait.

Technology Review Professor Martin Professor Xiong CSUS This lecture is based primarily on Romney & Steinbart(2003). It also draws on Martin (2002). Updated.

Similar presentations


Presentation on theme: "Technology Review Professor Martin Professor Xiong CSUS This lecture is based primarily on Romney & Steinbart(2003). It also draws on Martin (2002). Updated."— Presentation transcript:

1 Technology Review Professor Martin Professor Xiong CSUS This lecture is based primarily on Romney & Steinbart(2003). It also draws on Martin (2002). Updated on: Monday, January 27, 2003

2 Agenda Agenda  Database Management–An Introduction  Relational Database  Entity-Relationship Diagram

3 WHAT IS DATA MANAGEMENT? (The first seven slides are based on Watson (2002)) t The management of organizational memory t Involves designing, using, and managing memory systems of modern organizations

4 EXAMPLES OF INDIVIDUAL AND ORGANIZATIONAL MEMORY SYSTEMS t INDIVIDUAL u Internal memory u External memory (diaries, bookmarks, address books) t ORGANIZATIONAL u examples people, filing cabinets, policy manuals, planning boards, and computers. (Do organizations have external memories?) u Characteristics similar to Individual memory

5 DESIRABLE ATTRIBUTES OF ORGANIZATIONAL MEMORY t Shareable u readily accessed by more than one person at a time t Transportable u Easily moved to a decision maker t Secure u Protected from destruction and unauthorized use t Accurate u Reliable, precise records t Timely u Current and up-to-date t Relevant u Appropriate to the decision

6 TYPICAL PROBLEMS WITH FILE- BASED SYSTEMS t Organizational memory may be seen as a vast, disorganized data warehouse. Problems include: t Redundancy: same data stored in different memories t Data control: data not managed as a valuable resource t Interface: difficult to access data t Delays: long delays in responding to requests for data t Lack of reality: data do not reflect the complexity of the real world t Lack of data integration: data dispersed across different systems; also where data is stored may not be known.

7 File-Oriented Approach Application program #2 Application program #1 File # 1 Item A Item B Item C File # 2 Item B Item D Item E

8 DATABASE APPROACH TO MANAGING PERSISTENT DATA u The database approach emphasizes the integration and sharing of data across the organization.

9 Database Approach Application program #3 Application program #2 Database management system Application program #1 Item A Item B Item C Item D Item E Database

10 BENEFITS OF THE DATABASE APPROACH t Redundancy can be reduced t Thus, inconsistency can be avoided t Integration of data t Data can be shared among applications t Standards can be enforced by the DBA v formats, representation, naming, documentation t Security restrictions can be applied

11 BENEFITS OF THE DATABASE APPROACH t Data integrity can be maintained v by minimizing inconsistency v by having controls to check against incorrect updates, especially in the multi-user context

12 BENEFITS OF THE DATABASE APPROACH t Data independence u Broadly -- the immunity of applications to change in storage structure and access technique u Logical -- capacity to change conceptual schema without changing application programs (e.g., adding an attribute or an entity type) u Physical -- capacity to change internal schema without having to change external or conceptual schema (e.g., creating additional access structures to improve retrieval performance) t Ease of Application Development t Data accessibility and responsiveness enhanced t Reduced program maintenance

13 SOME DEFINITIONS t What is a database? v a shared collection of logically related persistent data, designed to meet the needs of multiple users usually within an organization. t What is a database management system? v DBMS is a collection of programs that enables users to define, construct and manipulate a database. (More detailed defn. later). t What is a database system?

14 FUNCTIONS OF A DBMS t Data definition using DDL t Data manipulation using DML t Data security and integrity t Data recovery and concurrency control t Data dictionary t Satisfactory performance

15 STEPS IN DATABASE DEVELOPMENT PROCESS t Analysis u creation of the Entity-Relationship Model t Design u Logical Database Design v creation of normalized relations u Physical Database Design v specification storage technology requirements v specification/ creation of appropriate file structures

16 Schemas t What are schemas? t A schema describes the logical structure of a database. t There are three levels of schemas: 1 Conceptual-level schema 2 External-level schema 3 Internal-level schema

17 Schemas t The conceptual-level schema is an organization-wide view of the entire database. t The external-level schema consists of a set of individual user views of portions of the database, also referred to as a subschema. t The internal-level schema provides a low-level view of the database.

18 Agenda Agenda  Database Management–An Introduction  Relational Database  Entity-Relationship Diagram

19 Relational Databases t A data model is an abstract representation of the contents of a database. t The relational data model represents everything in the database as being stored in the form of tables. t Technically, these tables are called relations.

20 Basic Requirements of the Relational Data Model 1 Primary keys must be unique. 2 Every foreign key must either be null or have a value corresponding to the value of a primary key in another relation. 3 Each column in a table must describe a characteristic of the object identified by the primary key.

21 Basic Requirements of the Relational Data Model 4 Each column in a row must be single- valued. 5 The value in every row of a specific column must be of the same data type. 6 Neither column order nor row order is significant.

22 Accessing records t Records are typically updated, stored, and retrieved using an identifier called a primary key – customer number for customer file – invoice number for invoice file – stock number for inventory file

23 Accessing Records t A secondary key is another field used to identify a record t Secondary keys do not uniquely identify individual records t Examples of secondary keys – invoice due date – zip code – bank customer last name

24 Accessing Records t Foreign key: attribute (field) in one table (record) that matches primary key in another table t Used to link tables together

25 Relational Database ProductNumberVendor Code Code 123467 123467 ZDG ZDG 243893 243893 CFC CFC 277883 277883 TBT TBT 476556 476556 BBC BBC 775622 775622 DFF DFF Product Table Primary Key Primary Key Foreign Key Foreign Key Vendor Code Code Ship Ship Mode Mode ACC ACC TRK TRK BAD BAD ARP ARP BBC BBC TRK TRK CAC CAC UPS UPS Vendor Table Go to top of Vendor Table Go to top of Vendor Table Search sequentially until find ‘BBC” Search sequentially until find ‘BBC” ***

26 Relational Databases Formal Formal Term Term Less Less Formal Formal Term Term Data DataProcessing Term Term relation relation table table file file tuple tuple row row record record attribute attribute column column field field

27 Agenda Agenda  Database Management–An Introduction  Relational Database  Entity-Relationship Diagram

28 ENTITY-RELATIONSHIP MODEL (proposed by CHEN, 1976) t A detailed logical representation of data for an organization or business area t Four Basic Constructs: -Entity -Relationship -Attribute -Cardinality (participation)

29 1.ENTITY: Entities are named objects in the universe of discourse t Types of entities u Thing (truck, building) u Person (customer, employee) u Event v Instant duration (sale, purchase, cash receipt) v Extended duration (month-long use of a truck, a course offering that starts on JAN 3 & ends on 15 May) u Concept (category of customer, course) u SYMBOL -- Rectangle CustomerCourse offering

30 2. RELATIONSHIP : Association between two (or more ?) entities t Examples: u employee “assigned to” building u customer “participates in” sale u professor “teaches” course-offering t SYMBOL -- Diamond CustomerSale participates in

31 3. ATTRIBUTE : Characteristics or elementary properties of entities or relationships. They are used for actual communication about the real world phenomena represented by entities or relationships t Example attributes for the entity INVENTORY: u stock#, color, price, cost, weight t A primary key is a special attribute used to represent an instance of an entity or relationship in a database u Must be unique and universal u Can be a concatenated (combined key) u “No representation without identification” u For this class, we assume that relationships are identified by the keys of their participating entities t SYMBOL – small connected circle (filled in for primary key) Inventory Stock# Color Price

32 4. Participation CARDINALITY (min, max): These show the correspondence of entities and relationships AB rel (min, max) Entity “A” participates in relationship “rel” at a minimum of - “0” times (optional) - “1” time (mandatory) Entity “A” participates in relationship “rel” at a maximum of - “1” time (single time only) - “n” times (many times)

33 4. Participation CARDINALITY (min, max): (other side of relationship) A B rel (min, max) Entity “B” participates in relationship “rel” at a minimum of - “0” times (optional) - “1” time (mandatory) Entity “B” participates in relationship “rel” at a maximum of - “1” time (single time only) - “n” times (many times)

34 An Example t Assuming two entities (EMPLOYEE and COURSE), draw an E-R diagram for the following (sample data). Assume that Employee_name and Course_titles are unique. Also assume other attributes such as Employee Address, and Course Credits. t Employee_nameCourse_titleDate_completed t Chen C++06/98 t ChenJava09/98 t LisaC++06/98 t LisaSQL03/99 t TrinaJava03/98 t HeikkiPerl06/98 t HeikkiJava09/98 t ……….…….……..

35 More Examples t A company has a number of employees. The attributes of EMPLOYEE include NAME, ADDRESS, and BIRTH- DATE. The company also has several projects. The attributes of Project include PROJECT_CODE, DESCRIPTION, and START_DATE. Each employee may be assigned to one or more projects, or may not be assigned to any project. A project is required to have at least one employee assigned, but may have several employees assigned. t A university has a large number of courses in its catalog. Attributes of courses include CRS_NO, CRS_NAME, and UNITS. Each course may have one or more other courses as prerequisites, or may have no prerequisite.

36 Assignment t A college course may have one or more scheduled sections, or may not have a scheduled section. COURSE attributes include CRS_ID, CRS_NAME, and UNITS. Attributes of SECTION include SECTION_NO and INSTRUCTOR. t A laboratory has several chemists who work on various projects, and who may use certain kinds of equipment on each project. Attributes of CHEMIST include CHEMIST_ID, NAME, and PHONE. Attributes of PROJECT include PROJ_ID and START_DATE. Attributes of EQUIPMENT include EQUIP_NO and COST.

37 Topics Discussed  Database Management–An Introduction  Relational Database  Entity-Relationship Diagram


Download ppt "Technology Review Professor Martin Professor Xiong CSUS This lecture is based primarily on Romney & Steinbart(2003). It also draws on Martin (2002). Updated."

Similar presentations


Ads by Google