Presentation is loading. Please wait.

Presentation is loading. Please wait.

Databases and Database Users Sept. 2012Yangjun Chen ACS-39021 Outline: Introduction (Chapter 1 – 3 rd, 4 th, 5 th, 6 th ed.) What is a database? The main.

Similar presentations


Presentation on theme: "Databases and Database Users Sept. 2012Yangjun Chen ACS-39021 Outline: Introduction (Chapter 1 – 3 rd, 4 th, 5 th, 6 th ed.) What is a database? The main."— Presentation transcript:

1 Databases and Database Users Sept. 2012Yangjun Chen ACS-39021 Outline: Introduction (Chapter 1 – 3 rd, 4 th, 5 th, 6 th ed.) What is a database? The main characters of a database system The basic database design method The entity-relationship data model for application modeling

2 Databases and Database Users Sept. 2012Yangjun Chen ACS-39022 Types of databases traditional multimedia - pictures, video, sound Scientific database - GIS: maps, weather, satellite images - biological database: DNA sequence analysis warehouse, OLAP - analysis, decision making real-time, active databases - industrial processes deductive databases - combination of inference and databases web databases

3 Databases and Database Users Sept. 2012Yangjun Chen ACS-39023 Types of databases traditional multimedia - pictures, video, sound GIS - maps, weather, satellite images data warehouse, OLAP - analysis, decision making real-time, active databases - industrial processes deductive databases - combination of inference and databases web databases Our focus, but we will examine deductive databases to some degree Read Chapter 1 For next day, read Chapters 2 and 3

4 Databases and Database Users Sept. 2012Yangjun Chen ACS-39024 Database collection of related data represents some aspect of the real world logically coherent collection built with a specific purpose in mind could be anywhere - notebook, spreadsheet, Access, Oracle, … could be manual / could be computerized Data known and recordable facts name, phone number, address, grade,...

5 Databases and Database Users Sept. 2012Yangjun Chen ACS-39025 Database Management System (DBMS) collection of software facilitating the definition, construction and manipulation of databases Definition record structure data elements names data types constraints etc Construction create database files populate the database with records Manipulation querying updating

6 Databases and Database Users Sept. 2012Yangjun Chen ACS-39026 Database Management System (DBMS) collection of software facilitating the definition, construction and manipulation of databases Users/ actors Request manager Storage manager Meta data Stored database DBMS

7 Databases and Database Users Sept. 2012Yangjun Chen ACS-39027 Sample database Student Name StNo Class Major Smith 17 1 CS Brown 8 2 CS Course CName CNo CrHrs Dept Database 8803 3 CS C 2606 3 CS Section SId CNo Semester Yr Instructor 32 8803 Spring 2000 Smith 25 8803 Winter 2000 Smith 43 2606 Spring 2000 Jones Grades StNo Sid Grade 17 25 A 17 43 B file1file2 file3 file4

8 Databases and Database Users Sept. 2012Yangjun Chen ACS-39028 REL_NAME ATTR_NAME ATTR_TYPE MEMBER_OF_PK MEMBER_OF_FK FK_RELATION CourseCname VSTR15 no CourseDept STR9 no StudentName STR20 no... Meta data for table structures StudentStNo INTEGER yesno GradeStNo INTEGER noyesStudent

9 Databases and Database Users Sept. 2012Yangjun Chen ACS-39029 Characteristics of the Database approach single repository of data sharable by multiple users concurrency control transaction control self-describing - system catalogue contains meta data program-data independence some changes to the database are transparent to programs/users multiple views of data - to support individual needs of programs/users

10 Databases and Database Users Sept. 2012Yangjun Chen ACS-390210 Database Actors Database Administrator (DBA) -authorizing access to the database -coordinating and monitoring its use -aquiring software and hardware as needed -solving problems such as breach of security or poor system performance Database Designers/Modelers -identifying the data to be stored -choosing appropriate data structure End-users -access to the database: querying, updating, generating reports Software Engineers -developing application programs

11 Databases and Database Users Sept. 2012Yangjun Chen ACS-390211 Advantages of the Database approach (capabilities we would look for in a DBMS) controlled redundancy database design integrates different user data needs performance tuning may lead to replicated data controlled/authorized access to data SQL Grant and Revoke commands enforcing integrity constraints intra-record constraints: e.g. data type, net<gross inter-record constraints: StNo in “Grades” exists as a StNo in “Student” backup and recovery

12 Databases and Database Users Sept. 2012Yangjun Chen ACS-390212 Implications of the Database approach standards enforcement DBA can enforce standard naming conventions, etc reduced application development time adding new functionality to an existing database is “easy” flexibility adding new data and making some types of changes is “easy” up-to-date information - due to sharable characteristic economies of scale - due to sharable resources the whole organization can make one investment

13 Databases and Database Users Sept. 2012Yangjun Chen ACS-390213 When not to use a DBMS overhead costs are too great high initial investment generality overhead of security, concurrency control, recovery, integrity data and applications are simple, well-defined, not expected to change stringent real-time constraints multi-user environment not needed

14 Databases and Database Users Sept. 2012Yangjun Chen ACS-390214 Database design let’s jump ahead to see this ERDs are covered in Chapter 3 Grades Student Delivery 1 N Course Section N M

15 Databases and Database Users Sept. 2012Yangjun Chen ACS-390215 Database design let’s jump ahead to see this ERDs are covered in Chapter 3 Grades Name Major Student StNo Class Delivery Course Section 1 N N M

16 Databases and Database Users Sept. 2012Yangjun Chen ACS-390216 Database design let’s jump ahead to see this ERDs are covered in Chapter 3 Grades Name Major CName CNo Student StNo Class Delivery Course Section CrHrs Dept 1 N N M

17 Databases and Database Users Sept. 2012Yangjun Chen ACS-390217 Database design let’s jump ahead to see this ERDs are covered in Chapter 3 Grades Name Major CName CNo Instructor Semester Year SId Student StNo Class Delivery Course Section CrHrs Dept N 1 NM

18 Databases and Database Users Sept. 2012Yangjun Chen ACS-390218 Database design let’s jump ahead to see this ERDs are covered in Chapter 3 grade Grades Name Major CName CNo Instructor Semester Year SId Student StNo Class Delivery Course Section CrHrs Dept 1 N N M

19 Databases and Database Users Sept. 2012Yangjun Chen ACS-390219 employee department project dependent With attributes, etc: works for manages works on dependents of controls supervision bdate ssn name lname minit fname sex address salary birthdatenamesex relationship name numberlocation name numberlocation number of employees startdate hours 1 1 1 N supervisor supervisee M N 1 1 N N degree 1 N

20 Databases and Database Users Sept. 2012Yangjun Chen ACS-390220 ER-to-Relational mapping 1. Create a relation for each strong entity type 2. Create a relation for each weak entity type include primary key of owner (an FK - foreign key) owner’s PK + partial key becomes PK 3. For each binary 1:1 relationship choose an entity and include the other’s PK in it as an FK. Include any attributes of the relationship 4. For each binary 1:n relationship, choose the n-side entity and include an FK w.r.t the other entity. Include any attributes of the relationship

21 Databases and Database Users Sept. 2012Yangjun Chen ACS-390221 5.For each binary M:N relationship, create a relation for the relationship include PKs of both participating entities and any attributes of the relationship PK is the concatenation of the participating entity PKs 6. For each multivalued attribute create a new relation include the PK attributes of the entity type PK is the PK of the entity type and the multivalued attribute 7. For each n-ary relationship, create a relation for the relationship include PKs of all participating entities and any attributes of the relationship PK may be the concatenation of the participating entity PKs


Download ppt "Databases and Database Users Sept. 2012Yangjun Chen ACS-39021 Outline: Introduction (Chapter 1 – 3 rd, 4 th, 5 th, 6 th ed.) What is a database? The main."

Similar presentations


Ads by Google