chapter-4

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

Chapter-

MS-Access:
queries, forms and
reports
 Foreign key-it refers to the field in a table that acts as the primary
key of another table.

Setting a relationship between tables:-


• Open MS-access and create and create two tables, save them with respective
them.
• In both the tables, there is a common field like stnd_id.
• Click on the database tools tab.
• Click on the relationships to open the show table dialog box. Both the tables
will be listed in the show table dialog box.
• Double click on both the tables to put them under relationships window.
• Click on close to close the show table dialog box.
• Create the relationship by dragging and dropping the common field of ne
table on top of the common field of the other.
• Click on create.
CREATING QUERY-
 Queries are used to display selected data from a single table or more
than one table.
 User can use query to filter data, perform calculations on it.
Step-
• Enter the data in a table.
• Click on create-----query design
• The show table dialog box appears.
• Select the customer table.
• Click on the add button.
• Click on close.
RUNNING A QUERY-
.To run a query follow the step
• Design tab-----run
SAVING A QUERY-
• Click on the file tab
• Click on save object as to open the save as dialog box.
• Type the query name.
• Click on ok.
FORMS
FORMS-
 A form is used to enter, edit and display data from the tables in
an easy to understand format.
Step-
 Select the table and click on the create tab.
 Click on form to open a new form for the table.
 Now click on the new blank record button located in the record
navigation pane. This will open a blank record, then enter the
new data.
 After enter the data, click on the save button located in the
records group under the Home tab.
Report
REPORT-
 Report are created to organize and present data in a user
friendly format.
 MS-access uses reports to present table data in an easy to read
format.
Step-
 Select the table and click on the create tab.
 Click on Report to open a report for the table. You can use the
format tab for formatting your report.
EXERCISE
 MULTTIPLE CHOICE QUESTION
 The _____key field is used to uniquely identify records in a table.
 Primary
 Foreign
 Alternate
 None
 The bottom half of the query design window is known as the
 Design grid
 Field grid
 Task pane
 Foreign grid
 The option to run a query is available on the
 Format tab
 Design tab
 Create tab
 File tab
• Which of the following options will you select from the view menu before entering a new
record in a form?
i. Form view
ii. Layout view
iii.Design view
iv.None

1. Name the tab used to do the following


a. To set a relationship between two tables______________
b. To create a query______
c. To run a query_______
d. To create a form______
e. To format a report___________
Answer the question.
 What is a foreign key ?
 How will you add a criterion to a query ?
 Write the steps to save a query.
 What is the purpose of forms ?
 How can you add a new record using a form ?
CREATE TWO TABLE WITH THE FOLLOWING STRUCTURE (LAB ACTIVITY)

STUDENT
STND_ID(TEXT) STD_NAME(TEXT) STND_CITY(TEXT) STND_SUB(TEXT) STND_HOBBY

TEACHER
TEACHER_ID(TEXT) TEACHER_NAME(TE TEACHER_CITY(TEXT) TEACHER_SUB(TEXT) TEACHER_HOBBY
XT)
THANK
YOU

You might also like