Академический Документы
Профессиональный Документы
Культура Документы
COMPSCI 111/111G
30/04/2014
Aspects of Databases
Microsoft Access
30/04/2014
30/04/2014
Review Exercises
Review Exercises
Exercise 2: What foreign keys does tblAlbum table have (if any)?
30/04/2014
30/04/2014
Once you have created a set of related tables in Access, you can
populate your database with content.
Once you have stored content in your Access database, you can
use queries to retrieve it selectively.
30/04/2014
30/04/2014
2. Select tables to
use in query
5. Results in table form
4. Click exclamation
point to run query
30/04/2014
30/04/2014
More Exercises
10
30/04/2014
11
30/04/2014
12
Detail
Default in Access
Gives individual, detailed results
Aggregate
Group data
E.g. sums, averages, counts
Done by selecting the Sigma:
Access calls this a Totals Query
30/04/2014
13
30/04/2014
SELECT Statement
SELECT statement:
Selects rows from a table.
We can specify which table and which fields we want to
select.
We can also group or sort data and do some calculations.
14
Examples
Select all records from a given table:
SELECT * FROM <TableName>;
SELECT *
FROM Students;
General syntax:
30/04/2014
16
WHERE Clause
30/04/2014
17
30/04/2014
SQL in Access
18
Exercises
19
30/04/2014
20
Exercises
Report Wizard
Report Tool
30/04/2014
21
30/04/2014
22
Once you have selected what content to present, you can specify
ways to group the records.
23
30/04/2014
24
Results grouped
using the Country
field.
25
30/04/2014
26
27
30/04/2014
28