70 likes | 193 Views
Database Design 1 Session 3 : Queries. HO 3 & 4 - Check. Have you: Correctly imported the data into tblSuppliers and tblProducts Related the two tables and enforced referential integrity. Queries Overview. Ask questions about ( interrogate ) the data in your database Two types of query
E N D
HO 3 & 4 - Check Have you: • Correctly imported the data into tblSuppliers and tblProducts • Related the two tables and enforced referential integrity
Queries Overview • Ask questions about (interrogate) the data in your database Two types of query • Select • Displays selected records • Does not change data in your tables • Action • Makes changes to the data stored in your tables
Creating Queries • Create in Query Design View • Include required fields from one or more tables • Set criteria to filter the records you require • Set a sort order for the selected records
Running Queries • From Query toolbar • From Database window • Query results are dynaset • Changes made in the query datasheet will be reflected in the underlying table • This means that queries can be used for data input
Totals Queries • Summarise data • Use (sigma) button to display Totals row • Group By • Aggregate functions
Queries Review • Selectqueries display data that matches the criteria you specify • Changes made in the query dynaset will be reflected in the underlying table • Create queries in Design View • Add tables • Add fields • Set criteria • Set sort order • Totals queries • Special type of select query for summarising data • Totals row • Group by • Aggregate functions