ITEC5 Lec5.5

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

DATABASE

APPLICATIONS
ITEC 5A – Lecture 5.5
Query Data
• Query data is used in the following:
• Queries that being used to retrieve data from a table or to make
calculation are called select queries.
• As tables grow in size they can have hundreds of thousands of
records, which makes it impossible for the user to pick out specific
records from that specific table.
• Queries that add, change, or delete data are called action queries.
• Queries can be used to supply data for a form or report.
• In a well-designed database, the data that presented by using a
form or report is often located in different tables.
Query Data
• Create a Simple Query
1. Select Create ribbon, under the category Queries, select Query
Design.
Query Data
• Create a Simple Query
2. In the Tables tab, on the Show Table dialog, double-click the
desired table/s and then close the dialog box.
Query Data
• Create a Simple Query
3. In the selected table, double-click all the fields which you want to
see as result of the query.
Query Data
• Create a Simple Query
4. All the selected data will be added to the Query Design Grid
that consists of:
• Field: Field name.
• Table: Current table selected.
• Sort: Either Ascending/Descending.
• Show: To show in the Query.
• Criteria: Specific criteria you want to do in the specific field (such as
calculations, sorting, etc.)
Query Data
• Create a Simple Query
5. Once all the necessary data is selected, save Query and click
run under Design Ribbon.
Query Data and Criteria
• Concatenation in Query
• To concatenate text (String data) in Query, under the Query
Design Grid. In Field, add (expr: [fieldname] + [fieldname2]. . . .).

• Query criteria helps to retrieve specific items from an Access


database. If an item matches with all the criteria being entered, it
appears in the query results.
• A query criterion is an expression that Access compares to query field
values to determine whether to include the record that contains each
value.
• To add some criteria to query, Query must be opened in the Design
View. Then identify the fields for which you want to specify criteria.
Query Criteria
• Create a Simple Query Criteria:
1. Select Create ribbon, under the category Queries, select Query
Design.
2. In the Tables tab, on the Show Table dialog, double-click the
desired table/s and then close the dialog box.
3. In the selected table, double-click all the fields which you want to
see as result of the query.
4. Under the Query Design Grid, select the specific column and
add a criteria of your choice.
Forms
• Forms
• These are like display cases in stores that make it easier to view or
get the items that needed.
• Two basic types of forms
• Bound Forms
• Bound forms are connected to some underlying data source such as a table,
query, or SQL statement.
• Bound forms are what people typically think of when they think of the purpose
of a form.
• Forms are to be filled out or used to enter or edit data in a database.
• Examples of bound forms will typically be what users use to enter, view or edit
data in a database.
• Unbound Forms
• These forms are not connected to an underlying record or data source.
• Unbound forms could be dialog boxes, switch boards, or navigation forms.
• In other words, unbound forms are typically used to navigate or interact with
the database at large, as opposed to the data itself.
Creating Forms
• Simple Creation of Form
1. Go to the Create tab and in the Forms group, select the Form
Wizard Form.

2. Let us assume we want to simply have a quick form that to be


use for data entry of our employee information.
Creating Forms
• Simple Creation of Form
3. From Tables/Queries drop-down list, select your desired table.
Click on the double arrow to move all fields at once. Then click
next.
Creating Forms
• Simple Creation of Form
4. In the following screen in the Form Wizard will ask for the layout
to be used. The selections are columnar, tabular, datasheet
and justified layouts. We will select Columnar.
Creating Forms
• Simple Creation of Form
5. In the next screen, it will ask for the title. Once the title is given to
the form, we can open the form to see what it looks like or modify
the form design. After the selection, then select Finish.
Create Reports
• Simple Creation of Report
1. Go to the Create tab, in Reports Tab, select Report Wizard.

2. Assume that we will only create a simple report of the list of


employees, we will use the Report Wizard.
Create Reports
• Simple Creation of Report
3. From Tables/Queries, select your desired table. Then select all
the fields in the selected table and then click Next.
Create Reports
• Simple Creation of Report
4. In the next screen, it will ask for grouping levels. We will leave
is to default format. Then click Next.
Create Reports
• Simple Creation of Report
5. In the next screen, it will ask to sort records up to four fields in
either ascending or descending order. We will leave them
empty to maintain the default settings. Then click Next.
Create Reports
• Simple Creation of Report
6. In the next screen, it will ask how the layout of the record will be.
There will be three options: Columnar, Tabular, and Justified.
We will select Tabular then click Next.
Create Reports
• Simple Creation of Report
7. In the last screen, it will ask for the title of the report, and it will
ask if you want to preview the report or modify the report design.
Then click Finish.

You might also like