databases

20
Databases

Upload: chaz

Post on 23-Feb-2016

39 views

Category:

Documents


0 download

DESCRIPTION

Databases. Field Record File / Table Database Entity. Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key. Terms & Concepts. Traditional File Processing. Flat File Example – (Hospital). Radiology Department. Pathology Department. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Databases

Databases

Page 2: Databases

Terms & Concepts

• Field• Record• File / Table• Database• Entity

• Attribute• Key Field / Primary Key• Candidate Key• Composite Key• Foreign Key

Page 3: Databases

Traditional File Processing

Page 4: Databases

Flat File Example – (Hospital)

Patno Fname Lname Street City Service Servchrg

1111 Jane Smith Main Cape X-ray $125.00

Patno Fname Lname Street City Service Servchrg

1111 Jane Smith Main Cape Blood $15.00

Radiology Department

Pathology Department

Page 5: Databases

Traditional File Environment Problems

• Data redundancy• Data inconsistency• Program-data dependence• Lack of flexibility• Poor security• Lack of data sharing and availability

Page 6: Databases

Advantages of the Database Approach

4-6

1. Program-data independence2. Minimal data redundancy3. Improved data consistency4. Improved data sharing5. Increased productivity of application

development

Page 7: Databases

Advantages of the Database Approach (cont’d)

4-7

6. Enforcement of standards7. Improved data quality8. Improved data accessibility9. Reduced program maintenance

Page 8: Databases

Database Exercise

• Create the following five tables using the fields listed below. Underline the Key field(s) for each table.

Tables: Students Courses Zip_codes Student_addresses Instructors

Fields: StudentID (2), Instructor_ID, City, Student_firstname, Zipcode (2), State, CourseID, Course_num, Instructor_firstname, Course_section, Address_ type, Student_lastname, Street, DOB, Entry_date, Instructor_lastname, Instructor_phone, Course_description, course_hours

Page 9: Databases

Database ExerciseStudents

StudentID, St_FirstName, St_LastName, DOB, Entry_DateCourses

CourseID, CourseNum, CourseSection, CourseDescription, CourseHours

Zip_codes ZipCode, City, State

Student_addressesStudentID, Street, ZipCode, AddressType

InstructorsInstructorID, Instructor_FirstName, Instructor_LastName, Instructor_Phone

Page 10: Databases

Flat File Example – Student Db

StuID Fname Lname Street City State ZipCd Sem

1111 Jane Smith Main Cape MO 63701 Spring1111 Jane Smith North Anna IL 62980 Spring

1111 Jane Smith Railrd Sike MO 63755 Spring

Year CID Course Sec Desc Hrs Prof Phone2009 0413 MI375 01 MIS 3 Schw 73872009 0413 MI375 01 MIS 3 Schw 73872009 0413 MI375 01 MIS 3 Schw 7387

Continued

Page 11: Databases

Relational File Example

SID Fname Lname

1111 Jane Smith

SID CID EID1111 2345 DS11111 3687 JR3

Student Database

SID Street Zip Phone Addtype

1111 Main 63701 2100 home

CID CrsNum Sec Desc Hrs

0375 MI375 03 MIS 30301 MK304 01 MKTG 3

Schedule

Student_Address

Course

Students

DrID Fname LnameDS1 Dana SchwieJR3 James Ricks

Page 12: Databases

Creating a Database • Designing

– Data need to be organized for retrieval and analysis• Key elements of a database

– Data» Normalization

• Repeating groups– Structure

» Data model• A map or a diagram representing entities and their relationships

» Entity-Relationship (ER) Diagram

• Distributing– Client / server networks

• Partitioned database• Duplicate database

Page 13: Databases

Effective Management of Databases

4-13

• Database Administrator (DBA)– Responsible for development and management

of databases• Works with system analysts and programmers • Works with users and managers • Implements security features• Grants access rights

– One of the key actors in creating a successful database

Page 14: Databases

Entering Data

4-14

• Forms– Enter data about a record– Field in a form corresponds to attribute in a record– Used to add, modify, or delete data

Page 15: Databases

Querying Data

4-15

• Query: Used to retrieve information• Structured Query Language (SQL)

– Example: Display students who earned an “A”

– Writing SQL queries can become very complex

Page 16: Databases

Query by Example

4-16

• Simpler than SQL

• Drag-and- drop features

• Construct a sample of the data we would like to see

Page 17: Databases

Creating Database Reports

4-17

• Report– Compilation of data from the database

• Report generators– Retrieve, manipulate, and display data

• Exampleo Quarterly sales for a

restaurant• Adding• Grouping

Page 18: Databases

Operational vs. Informational Systems

4-18

Page 19: Databases

Data Warehouses and Data Marts

4-19

• Data Warehouse– Integration of multiple large databases and other

information sources into a single repository– Pull together, integrate, and share critical corporate data

throughout the firm

• Data Mart – Data warehouse that is limited in scope– Customized for the decision support applications of a

particular end-user group

Page 20: Databases

AssociationsTB-20

• Used to relate information between tables• Needed to retrieve information• Example: Basketball league database