0% found this document useful (0 votes)
44 views6 pages

Лаб 7

This document provides instructions for students to create a database in Microsoft Access. It describes creating a table called Students with fields like name, address, phone number, and setting the primary key. Steps include adding data types, validation rules, input masks and changing field properties. The document also describes switching to the datasheet view to enter sample records and experiment with validation. The overall aim is to familiarize students with creating a relational database in Access.

Uploaded by

jackwild868
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views6 pages

Лаб 7

This document provides instructions for students to create a database in Microsoft Access. It describes creating a table called Students with fields like name, address, phone number, and setting the primary key. Steps include adding data types, validation rules, input masks and changing field properties. The document also describes switching to the datasheet view to enter sample records and experiment with validation. The overall aim is to familiarize students with creating a relational database in Access.

Uploaded by

jackwild868
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Laboratory work№ 5

Development of the database structure, creation of database objects (tables,


queries, reports and forms)
Aim:To acquaint students with the relational database in the DBMS MS Access.
Technical and instrumental supports of the laboratory work :PC, OS Windows, MDB
MS Access.
CONTENT
Methodical instructions
Computer data base- isrealized by means ofcomputerinformation modelthat reflectsthe
state of objectsand their relationships. Information model(ordata structure) is the set ofrelated
data. The main purpose of the database is to quickly find the information they contain.
A database createdin thedatabaseAccess,is a relationaldatabase.Ina relationaldatabase
modelis the notion ofthe relationship(relation).
Microsoft Access databasework with the followingtypes of data:
 Text - the type of data used to store regular plain text of limited size (up to 255
characters);
 Memo - a special type to store large amounts of text (up to 65,535 characters).
 Numeric- data type to store real numbers;
 Date / Time - the type of data to store the calendar date and the current time;
 Money - the data type for storing monetary amounts;
 Count- a special type of data to store unique (non-repeating field) of natural
numbers with automatic capacity;
 Logic - the type of logical data storage (can take only two values, such as yes or
no);
 Object field OLE - a special data type for storing objects OLE, such as multi-
media;
 Hyperlink - a special field for storing the address URL WEB-sites Internet.
Database objectsaretables, queries, forms, reports, macrosandmodules
Task1:
STEP 1 : Create a New Database
1. Click the Start button to display the Start menu. Click the Programs menu, then click
Microsoft Access to start the program.

2. You should see the Microsoft Access dialog box as shown on the left side. Click the
option button to create a new database using a Blank Access Database. Click OK.
3. Click the drop-down arrow on the Save in: list box. Click the appropriate drive (drive
C or drive A), depending on the location of your data. Double click the Exploring Access folder
to make it the active folder.
4. Click in the File Name text box and drag to select db1. Type My First Database as the
name of the database you will create. Click the Create button.
STEP 2: Create the Table
1. The database window for My First Database should appear on your monitor. The
Tables button is selected by default.

2. Click and drag an edge or border of the Database window to change its size. Click and
drag the title bar of the Database window to change its position on the desktop.
3. Click the New button to display the New Table dialog box. Click (select) Table Wizard
in the New Table dialog box, then click OK to start the Table Wizard.

STEP 3: The Table Wizard


1. If necessary, click the Business Option button. Click the down arrow on the Sample
Tables list box to scroll through the available business tables. Click (select) Students within the
list of sample tables. The tables are not in alphabetical order, and the Students table is found near
the very bottom of the list.
2. The StudentID field is already selected in the Sample Fields list box. Click the > button
to enter this field in the list of fields for the new table.
3. Enter the additional fields for the new table by selecting the field and clicking the >
button. The fields to enter are: FirstName, LastName, Address, City, and StateOrProvince.
4. Click the Rename Field command button after the adding the StateOrProvince field to
display the Rename Field dialog box. Enter State to shorten the name of this field. Click OK.
5. Add PostalCode and PhoneNumber as the last two fields in the table. Click the Next
command button when you have entered all the fields.
STEP 4 :
1. The next screen in the Table Wizard asks you to name the table and determine the
primary key.
2. Accept the Wizard’s suggestion of Students as the name of the table.
3. Make sure that the option button Yes, set a primary key for me is selected.
4. Click the Next command button to accept both of these options.

5. The final screen in the Table Wizard asks you what to do next.
6. Click the option button to Modify the table design.

7. Click the Finish command button. The Students table should appear on your monitor.
Pull down the File menu and click Save to save the table.

STEP 5 : Add the Additional Fields


Click the cell immediately below the last field in the table (PhoneNumber). Type
BirthDate.
Press the Tab key to move to the Data Type column. Click the down arrow on the drop-
down list box. Click Date/Time.
Add the remaining fields to the Students table. Add Gender as a text field. Add Credits as
a Number field. Add Points as a Number field.

STEP 6 : Change the Primary Key


Point to the first field in the table and click the right mouse button to display the shortcut
menu. Click Insert Rows.
Click the Field Name column in the newly inserted row. Type SSN (for social security
number) as the name of the new field. Press enter. The data type will be set to Text by default.
Click the Required box in the Properties area. Click the drop-down arrow and select Yes.
Click in the Field Name column for SSN, then click the Primary Key button on the Table
Design toolbar to change the primary key to social security number. The primary key symbol has
moved to SSN.
Point to the StudentID field in the second row. Click the right mouse button to display the
shortcut menu. Click Delete Rows to remove this field from the table definition. Save the table.

STEP 7 : Add an Input Mask


Click the Field selector column for SSN. Click the Input Mask box in the Properties area.
Click the Build button to display the Input Mask Wizard. Click Yes if asked whether to
save the table. Click Social Security Number in the Input Mask Wizard dialog box.
Click the Try It text box and enter a social secyrity number to see how the mask works. If
necessary, press the left arrow key until you are at the beginning of the text box, then enter a
social security number (digits only). Click the Finish command button to accept the input mask.
Click the field selector column for BirthDate, then follow the steps detailed above to add
an input mask. (Choose the Short Date format.) Click Yes if asked whether to save the table.
Save the table.

STEP 8 : Change the Field Properties


Click the field selector column for the FirstName field:
 Click the Field Size box in the Properties area and change the field size to 25.
 Click the Required box in the Properties area. Click the drop-down arrow and
select Yes.
Click the field selector column for the LastName field:
 Click the Field Size box in the Properties area and change the field size to 25.
 Click the Required box in the Properties area. Click the drop-down arrow and
select Yes.
Click the field selector column for the State field:
 Click the Field Size box in the Properties area and change the field size to 2.
 Click the Format box in the Properties area. Type a > sign to display the data in
uppercase.
Click the field selector column for the Credits field:
 Click the Field Size box in the Properties area, click the drop-down arrow to
display the available field sizes, then click Integer.
 Click the Default Value box in the Properties area. Delete the 0.
Click the field selector column for the Points field:
 Click the Field Size box in the Properties area, click the drop-down arrow to
display the available field sizes, then click Integer.
 Click the Default Value box in the Properties area. Delete the 0. Save the table.

STEP 9 : Add a Validation Rule


Click the field selector column for the Gender field. Click the Field Size box and change
the field size to 1. Click the Format box in the Properties area. Type a > sign to display the data
entered in uppercase.
Click the Validation Rule box. Type “M” or “F” to accept only these values on data
entry.
Click the Validation Text box. Type You must specify M or F. Save the table.
STEP 10 : The Datasheet View
Pull down the View menu and click Datasheet View to change to the Datasheet view.
The insertion point is automatically set to the first field of the first record.
Type 111111111 to enter the social security number for the first record. (The input mask
will appear as soon as you enter the first digit.) ¾ Press the Tab key, the right arrow key, or the
enter key to move to the FirstName field. Enter the data for Brad Pitt and make up data for other
fields.
Scrolling takes place automatically as you move within the record.
Enter data for the two other students, but enter deliberately invalid data to experiment
with the validation capabilities built into Access. Save the table.

CONTROL QUESTION
1. What objectsare storedinthe data?
2. How can I createa table?
3. What are sometypesof data?
4. What is a form in the database?
5. How to create a report in the database?
6. What is the key field?
7. How to create a linked table?
8. How to create a form with autoform?
TASKS OF SELF-STUDY
Theme 5: The database structure and DB objects.
1. Introduction to the topic.
2. Know about the database and DBMS MS Access
3. Prepare an oral presentation on the topic about theconsept of relational database and
DBMS MS Access.
4. Create mindmap by https://www.mindmeister.com/ about main objects of MS Access.

You might also like