210 likes | 407 Views
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.
E N D
Field Record File / Table Database Entity Attribute Key Field / Primary Key Candidate Key Composite Key Foreign Key Terms & Concepts
Flat File Example – (Hospital) Radiology Department Pathology Department
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 • Program-data independence • Minimal data redundancy • Improved data consistency • Improved data sharing • Increased productivity of application development
Advantages of the Database Approach (cont’d) • Enforcement of standards • Improved data quality • Improved data accessibility • Reduced program maintenance
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 Continued
Relational File Example Student Database Schedule Students Student_Address Course
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
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
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
Query by Example Simpler than SQL Drag-and- drop features Construct a sample of the data we would like to see
Creating Database Reports • Example • Quarterly sales for a restaurant • Adding • Grouping • Report • Compilation of data from the database • Report generators • Retrieve, manipulate, and display data
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
Associations Used to relate information between tables Needed to retrieve information Example: Basketball league database