Download Database Foundations

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

IMDb wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Concurrency control wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Functional Database Model wikipedia , lookup

ContactPoint wikipedia , lookup

Relational model wikipedia , lookup

Clusterpoint wikipedia , lookup

Database model wikipedia , lookup

Transcript
Databases
Terms & Concepts
•
•
•
•
•
Field
Record
File / Table
Database
Entity
•
•
•
•
•
Attribute
Key Field / Primary Key
Candidate Key
Composite Key
Foreign Key
Traditional File Processing
Flat File Example – (Hospital)
Radiology Department
Patno Fname Lname Street City
1111
Jane
Smith
Main
Service
Cape X-ray
Servchrg
$125.00
Pathology Department
Patno Fname Lname Street City
1111
Jane
Smith
Main
Service
Cape Blood
Servchrg
$15.00
Traditional File Environment Problems
•
•
•
•
•
•
Data redundancy
Data inconsistency
Program-data dependence
Lack of flexibility
Poor security
Lack of data sharing and availability
Advantages of the Database Approach
1. Program-data independence
2. Minimal data redundancy
3. Improved data consistency
4. Improved data sharing
5. Increased productivity of application
development
4-6
Advantages of the Database
Approach (cont’d)
6. Enforcement of standards
7. Improved data quality
8. Improved data accessibility
9. Reduced program maintenance
4-7
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
Database Exercise
Students
StudentID, St_FirstName, St_LastName, DOB, Entry_Date
Courses
CourseID, CourseNum, CourseSection, CourseDescription,
CourseHours
Zip_codes
ZipCode, City, State
Student_addresses
StudentID, Street, ZipCode, AddressType
Instructors
InstructorID, Instructor_FirstName, Instructor_LastName,
Instructor_Phone
Flat File Example – Student Db
StuID Fname Lname Street City
1111
Jane
Smith
Main
1111
Jane
Smith
1111
Jane
Smith
State ZipCd
Cape MO
Sem
63701
Spring
North Anna IL
62980
Spring
Railrd Sike
63755
Spring
MO
Continued
Year
2009
2009
2009
CID
0413
0413
0413
Course
MI375
MI375
MI375
Sec
01
01
01
Desc
MIS
MIS
MIS
Hrs
3
3
3
Prof
Schw
Schw
Schw
Phone
7387
7387
7387
DrID
DS1
JR3
Relational File Example
Student Database
SID
Fname Lname
1111
Jane
Smith
Students
SID
Street Zip
1111
Main
SID
1111
CID
2345
EID
DS1
1111
3687
JR3
Phone Addtype
63701 2100
home
CID
CrsNum Sec
Desc
0375
0301
MI375
MK304
MIS
3
MKTG 3
03
01
Fname Lname
Dana Schwie
James Ricks
Hrs
Course
Schedule
Student_Address
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
Effective Management of Databases
• 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
4-13
Entering Data
• Forms
– Enter data about a record
– Field in a form corresponds to attribute in a record
– Used to add, modify, or delete data
4-14
Querying Data
• Query: Used to retrieve information
• Structured Query Language (SQL)
– Example: Display students who earned an “A”
– Writing SQL queries can become very complex
4-15
Query by Example
• Simpler than
SQL
• Drag-and- drop
features
• Construct a
sample of the
data we would
like to see
4-16
Creating Database Reports
• Report
– Compilation of data from the database
• Report generators
– Retrieve, manipulate, and display data
• Example
o Quarterly sales for a
restaurant
• Adding
• Grouping
4-17
Operational vs. Informational Systems
4-18
Data Warehouses and Data Marts
• 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
4-19
Associations
TB-20
• Used to relate information between tables
• Needed to retrieve information
• Example: Basketball league database