Top Banner
Databases
20

Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Databases

Page 2: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Terms & Concepts

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

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

Page 3: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Traditional File Processing

Page 4: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Flat File Example – Student Db

StuID Fname Lname Street City State ZipCd Sem

1111 Jane Smith Main Cape MO 63701 Spring

1111 Jane Smith North Anna IL 62980 Spring

1111 Jane Smith Railrd Sike MO 63755 Spring

Year CID Course Sec Desc Hrs Prof Phone

2009 0413 MI375 01 MIS 3 Schw 7387

2009 0413 MI375 01 MIS 3 Schw 7387

2009 0413 MI375 01 MIS 3 Schw 7387

Continued

Page 11: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Relational File Example

SID Fname Lname

1111 Jane Smith

SID CID EID

1111 2345 DS1

1111 3687 JR3

Student Database

SID Street Zip Phone Addtype

1111 Main 63701 2100 home

CID CrsNum Sec Desc Hrs

0375 MI375 03 MIS 3

0301 MK304 01 MKTG 3

Schedule

Student_Address

Course

Students

DrID Fname Lname

DS1 Dana Schwie

JR3 James Ricks

Page 12: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

Operational vs. Informational Systems

4-18

Page 19: Databases. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

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. Terms & Concepts Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key.

AssociationsTB-20

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