Creating Relationships
Primary key and foreign keys are used to linked two tables in a database.
A primary key is a field in a table that uniquely identifies the record.
A foreign is a field in another table that is the primary key in another table.
A primary key is a field in a table that uniquely identifies the record.
A foreign is a field in another table that is the primary key in another table.
DATA PRACTICE EXERCISE - THEORY
database_key.docx | |
File Size: | 92 kb |
File Type: | docx |
Download the sample database below to practice how to link two tables
Query with compound criteria
Aggregate Query: Count
An aggregate query is a method of deriving group. In a query containing a GROUP BY clause, the elements of the select list can be aggregate functions, such as count, avg, max, min, sum.
Calculated Query
chen_supermarket.accdb | |
File Size: | 626 kb |
File Type: | accdb |
Creating Tables
- Create a third table in the database called Products with fields, ProductName and Price
- Populate the table with three suitable records
- Create a relationship between the ORDER and PRODUCT table. NB. Both tables must have a common field.
TOPIC: DATABASE QUERY
- state the purpose of query
- create query using multiple search conditions
- create Select,Totals and Calculated queries
- modify database table structure
- generate report using report wizard
- group data in report based on given condition
- create summaries of numeric data
A query is a request for data or information from a database table or combination of tables. This data may be generated as results returned by StructuredQuery Language (SQL) or as pictorials, graphs or complex results
PRACTICAL EXERCISE
- Download thedatabase file below
- Open it and create a relationship between the tables
- Wait for tour teacher's instruction.
employee.accdb | |
File Size: | 540 kb |
File Type: | accdb |
WORKSHEET
database_queries_-_grade_10.docx | |
File Size: | 114 kb |
File Type: | docx |
HOW TO CREATE A DATABASE REPORT
NOTE: USE REPORT WIZARD ONLY