Sie sind auf Seite 1von 5

Access 2-1 Exams

Create a database holding data for specialties, disciplines, students, exams and giving the
opportunity for getting the needed information through a set of queries and reports.

Tables
1. Create a table Specialties with the following structure:
SpecialtyID Number, Primary Key;
SpecialtyName - Text with length 50 (see Rules and restrictions section
below).
2. Create a table Disciplines with the following structure:
DisciplineID - Number, Primary Key;
Disciplne - Text 50;
NumberOfHoursLectures - Number;
NumberOfHoursPractice - Number;
3. Create table Students with the following structure:
FacultyNumber Text, 10 digits, Primary Key;
Name - Text 50;
SpecialtyID - Number, Combo box (see Combo box section below);
GroupNumber - Number.
4. Create a table Exams with the following structure:
ExamDate - Date/Time, Primary Key;
DisciplineID - Number, Combo box, Primary Key;
FacultyNumber - Text, Combo box, Primary Key;
Mark Number, in the interval from 2 to 6.

Rules and restrictions


1. Restriction for the size of the values can be set in the properties of each field

2. Restriction for entered values can be realized by defining a Validation Rule (for
example >=2 and <=6). Optionally an error message can be entered in Validation
Text (for example Incorrect value entered for mark! Enter value between 2 and
6).

Combo Box
Some fields represent values from another table. They can be entered from a dropdown list
(Combo box). This is a combined field combining properties of a text field and a list field.
Following the instructions below make the fields that have combobox in the explanation
above as combobox.
Open the table containing the field in design view
From the dropdown list for datatype select Lookup Wizard

Select the table containing the values that you need if this is the field
SpecialtyID in Students, you have to select Specialties table here

Select the corresponding field for the value (SpecialtyID) and the field
containing the value you want to be displayed (SpecialtyName)

Specify sorting for the records as you need

Check the box on the next screen if you dont want to display the value field.
(For the FacultyNumber combo box you have to remove the check, as we need
to see not only the names of the students but also their faculty numbers)

5. Create relationships between the tables.


6. Add 3 records in table Specialties, 5 records in table Disciplines, 10 records in table
Students and 15 records in table Exams.

Queries
1. Some help with the queries:
1) If the data should be ordered by a field, in the column where the field is selected,
in the row Sort, select Ascending or Descending.
2) If the records should be filtered according to criteria for a field, it is entered in the
row Criteria for the corresponding column. Here are some examples for the
results of using expressions in Criteria row for the SpecialtyId field:
3 records in which SpecialtyId=3 will be shown in the query;
>1 records in which SpecialtyId is greater than 1;
[Specialty ID?] records in which SpecialtyId is equal to entered by the user
value during querys execution.
1. Create a Query with fields FacultyNumber, Name, SpecialtyId, SpecialtyName,
GroupNumber, ordered by FacultyNumber.
2. Create the same query again but this time SpecialtyId is a parameter entered before each
execution of the query.
3. Create a Query, containing fields Discipline, TotalHours (NumberOfHoursLectures +
NumberOfHoursPractices),

ExamDate,FacultyNumber,

Name,

SpecialtuName,

GroupNumber, Mark.
The column TotalNumberOfHours is a new field, its NumberOfHoursLectures +
NumberOfHoursPractice. Use the Expression Builder (Build from context menu or
Builder from Design tab). In our case the expression may have the following
structure:
TotalNumberOfHours:
[Disciplines]![NumberOfLectures]+[Disciplines]![NumberOfLectures]
4. Create a Total Query with columns Discipline, Specialty, Average mark.

Das könnte Ihnen auch gefallen