G11_Revision_Handout02

advertisement
Port Said International Schools – National Section
Revision Handout
Better education for future generations
Grade: 11
Define the following concepts:1. Key attribute (Entity Key) (Primary Key): it's the attribute whose value
can never be repeated inside the entity (unique).
2. Composite Key: it's more than a field in a table whose components
together don't repeated, while each component can be repeated alone.
3. Foreign Key: it's a strange field in a table linked to a primary key in another
table.
4. Intermediary (junk) table: is a table used to link between two tables, the
relationship between them is (Many to Many). The fields of this table are the
primary keys for the two tables and any related attributes.
5. Multi-Valued Attribute: is the attribute for an entity that can include more
than one value. Example: when an employee has more than one qualification
(bachelor + master degree … etc.)
6. The Derived Attribute: is the attribute that can be deduced from another
attribute. Example: when we want to calculate the age from the birthdate.
7. (One to Many) relationship: it's the ability for a record in the first table
(One) to be linked to more than a record in the second table (Many), and any
record from the second table (Many) can be linked to only one record in the
first (One ).
1
M
Entity B
Entity A
8. (Many to Many) Relationship: it's the ability for a record from the first table
to be linked to more than a record in the second table, and any record from
the second table can be linked to more than a record in the first table.
Entity A
M
N
Entity B
9. (One to One) Relationship: it's the ability for a record from the first table to
be linked to a single record in the second table, and any record from the
second table can be linked to a single record from the first table.
Entity A
1
1
Entity B
10. Enforce Referential integrity: it’s a system of rules that Microsoft Access uses
to ensure the validity of the relationships and insure that you don’t accidently
delete or change related data.
11. Cascade Update Related Fields: used to automatically update the value of
the related fields in the related table whenever any record is changed in the
primary table.
Port Said International Schools – National Section
Revision Handout
Better education for future generations
Grade: 11
12. Cascade Deleted Related Fields: used to automatically delete the value of
the related fields in the related table whenever any record is deleted in the
primary table.
Data types in Microsoft Access
1. Text: combination of letters and numbers that don't require calculations
such as phone numbers, postal codes. The size is up to 255 characters.
2. Memo: like text type but it's longer, up to 65536 characters, and used for
books and descriptions.
3. Number: used for numbers that will be calculated, and it has two types:
a. Whole numbers: such as byte, integer, and long integer.
b. Decimal Numbers: such as Single, Double, and Decimal.
4. Date/Time: used with dates and times.
5. Currency: used for money. This type prevents rounding off calculation
results.
6. Yes/No: used for data that can be only one of two possible values such
as Male/Female, On/Off.
7. Auto Number: usually used for primary key field and it's automatically
incremented by 1 when a new record is added.
8. OLE Object: used for objects such as Word documents, pictures, Excel
spreadsheets, and sounds.
9. Hyperlink: used for hyperlinks. The size is up to 64000 characters.
Note: the data type of the primary key must be the same data type of the
foreign key.
Note: The (Many to Many) relationship can't be solved in Access and we must
create an intermediary (junk) table.
Adjust the lookup field property
1. The lookup feature should be done on foreign key field (it can’t be done
on a primary key field).
2. For the Row Source property, we should choose the same table that is
connected to the foreign key.
3. Column count property is used to determine the no. of columns that will
appear in the design view.
4. Column heads property is used to display the column heads of the
columns from the primary table.
5. List width property is used to adjust the list’s width that displays the
columns from the primary table.
Port Said International Schools – National Section
Revision Handout
Better education for future generations
Grade: 11
 Steps to adjust the lookup property
1. Open the table that contain the field you want to add the lookup feature
to it. (The field must be foreign key and the relationships must
be added between tables before adding the lookup feature).
2. Select the field, choose the lookup tab from the field properties.
3. Adjust the following properties:
a. Display Control: Combo Box.
b. Row Source Type: Table/Query.
c. Row Source: the table that has the primary key of the foreign key
you are adding lookup to it.
d. Column Count & Column Heads: as described before.
2
1
2
3
Download