lab 3
lab 3
Objective:
The purpose of this lab is to introduce students to relational databases and the concept of
relationships between tables in MS Access. By the end of this lab, students will understand how
to create multiple related tables, define relationships, enforce referential integrity, and run
queries that span multiple tables.
Chapter Overview
1. Introduction to Relational Databases
A relational database organizes data into tables (also called relations) that can be linked together
based on shared data fields. This allows for efficient management of data without redundancy. In
a business context, relational databases are essential for managing complex data, such as customer
orders, employee records, and inventory.
Key Concepts:
1. Creating Relationships:
o Go to the Database Tools tab and click on Relationships.
o Add the Employees, Departments, and Projects tables to the relationships
window.
2. Linking Tables:
o Drag Department ID from the Departments table to Department ID in the
Projects table. This creates a relationship between departments and projects.
o Drag Manager ID from the Departments table to Employee ID in the
Employees table. This links each department to a manager.
o Select Enforce Referential Integrity and Cascade Update Related Fields to
ensure data consistency.
3. Saving Relationships:
o Save the relationships once they are established.
Task 3: Entering Data into Related Tables
1. Creating a Report:
o Use the Report Wizard to create a report based on the Projects table.
o Add fields such as Project Name, Department ID, and Start Date to the report.
2. Customizing the Report:
o In Design View, you can adjust the layout, add a title, and group the data by
Department ID to create a more structured report.
3. Saving and Printing the Report:
o Save the report as Projects by Department Report and print it if needed.
Discussion Questions:
1. Why is referential integrity important in relational databases? Discuss how enforcing
referential integrity helps ensure data accuracy and consistency across related tables.
2. How can relationships between tables simplify complex data structures in business
environments? Explore how relational databases reduce data redundancy and improve
data organization.
3. What are the advantages of using queries to extract data from multiple tables?
Discuss how queries that span multiple tables help managers gain insights into
interconnected datasets.
Lab Assignment:
• Assignment Task:
Create a database for managing customer orders. Include the following tables:
o Customers Table: Fields for Customer ID, Name, Contact Info.
o Orders Table: Fields for Order ID, Customer ID (Foreign Key), Order Date, and
Total Amount.
o Products Table: Fields for Product ID, Product Name, Price.
o Define relationships between the tables.
o Populate the tables with sample data.
o Create a query to list all orders placed by a specific customer.
o Design a form for entering new customer orders.
o Generate a report that shows all orders and their total amount, grouped by
customer.
• Submission:
Submit your Access database file through the learning management system.
Key Takeaways:
• Relational databases provide a powerful way to manage complex data by linking tables
through relationships.
• Referential integrity ensures that relationships between tables remain valid and
consistent.
• Forms, queries, and reports are essential tools for interacting with and presenting
relational data in business environments.