Sei sulla pagina 1di 29

1

1.

Create a student table by using table wizard:

Ans: Tables are the main units of data storage in Access. Recall that a table is made up of one or more
columns (or fields) and that a given column may appear in more than one table in order to indicate a
relationship between the tables.
There are a number of ways to create a table in Access. Access provides wizards that guide the user through
creating a table by suggesting names for tables and columns. The other main way to create a table is by
using the Design View to manually define the columns (fields) and their data types.
Steps to create Student Table:
1.

2.

When Microsoft Access first starts up, a dialog box is automatically displayed with options to create a
new database or open an existing one.

If this dialog box is displayed, click Access Database Wizards, pages, and projects and then click OK.
If you have already opened a database or closed the dialog box that displays when Microsoft Access starts
up, click New Database on the toolbar.

3. Then you give a name to the new database, and click on Create.
4. After clicking the database objects window will be displayed on the screen.

5. In the above picture you select table, we can create database by using three methods, they are Create
table by Design view, Create table by using wizard and Create table by entering data.
6. So you press on Create table by using wizard.
7. Then the table wizard will be displayed on the screen.

8. In the above picture has tow options one is Business and second one is personal.
You select any one of the option. Than you select a category which you want.
Eg: SNo, StuName, Address, Marks1, Marks2, Marks3, Marks4 and Marks5.
You select some fields and rename it as in the following picture.

9.Than you press next button, it will show in the following window.

10. In the above picture asking name for your table , give a name in the place of Oders as Student. Next you
press Next button.
11. After next window will show three options like:

You select Modify the table desing., then you press Finish button.
12. Then you select the data type to enter data.

13. Then you save it. After your enter student data into database, as in the following picture.

2.Convert an employee table of fields EmpNo,


EmpName, Designation, Salary and JobLocation
into a form in design view.
1. Create a table in the name employee using in the following fields
EmpNo,EmpName, Salary and Joblcation.
As in the following picture.

2. Select in the window employee table.


3. Than you click on new object Icon.

4. Then the New Object icon show in the following list:

5. Than you click on Form button or Icon.


6. Next the New form window will bed displayed on the screen.

7. After display in the above window you select employee table name at the place of Choose the table
or query where the objects data comes from and click on Ok button.
8. Now Form1 design view will be displayed as in the following picture.

9. Then you drag the fields and set as in the following fields.

Another Model:
1. When you create table after it will show in the following picture.

2. Then you click on Forms button in Objects.


3. Then the form window will be displayed on the screen

4. You click on Create form in design view, than you will get grid line design view with Tool
box.
5. Then you design in the following picture.

6. After completion of design view than you click on view icon then it will show in the following
picture.

10

10. You Click on Form view , then it will show as a form.

3. Create a query of students and sort all the


marks fields in Ascending order .
Ans: After creation database of student, then you set some fields
in Ascending order or descending order.
Steps:
1. You click on Query button in object .

11

2. in the above picture you click on Create query by using


wizard.
3. After clicking Create query by using wizard it wills how in
the following picture.

4. After you select your table in the place of Tables/Queries.


Than you set the move fields Available fields into selected
fields and press Next Button.
5. Then the simple query window will be displayed as

12

6. Then you select detail option and press next button.


7. After click next button the query wizard asking name of
your query.

8. Finally you press Finish button.


9. Next you click on New object icon on the Toolbar, then I wills
how in the picture.

13

10.
click on Query, then the new query will be displayed on
the screen. Next you select design view.
11.
After you set the require fields into sorting order.

14

15

4. Create a Report for an Employee as fields


EmpNo, EmpName, Designation, Salary by using
Wizard.
Ans: When you create tables you can make that as a report. We can create report by
using two methods.
1.Create Reports in Design view
2. Create Report in Using Wizard.
Now we discus about creating reports by using Wizard.
Steps:
1. First you create employee tables using any method.
2. Then the Database window will be displayed as in the following picture

3. Than you click on Reports button in Objects.


4. After the database window will display as in the following picture.

16

5. You click on Create report by using wizard.


6. The report wizard will displayed.

7. First you select your table in the place of Tables/ Queries , than you move the
fields from available to selected fields.
8. Then you press next button.
9. Next you press Next button it will show grouping window than you press again
next button.
10.
After the report wizard asking sorting order, then you press Next button.
11.
Next the report wizard asking layout models, it has three types they are
Columnar, Tabular and Justified. You select tabular layout.Then press Next
button.
12.
Then the report wizard asking style, you select any one of the style and
press next button.

17

13.
Finally you press Finish button you will get report as in the following
picture.

5. Create a Form by using wizard of a Customer


contains the fields CustNo, CustName,
CustAddress, Product and Billed Amount.
Ans: Forms generally serve to define screens with which to edit the records of a table or query.
In this unit we will see how to create a form, and how to operate it for the editing of records and changing its
design.
To create a form we need to position ourselves in the database window with the Form object selected, if we
then click on the
button a window opens with the various ways we have to create a form:
Design view opens a blank form in design view, and we then need to incorporate the various object that
we would like to appear in it. This method is not used much as it is easier and faster to create an autoform, or
to use the wizard and afterward modify the design of the created form to adjust it to our needs. We will see
ahead in this unit how to modify the form design.
Form wizard uses an a wizard that guides us
step by step in the creation of the form.
Autoform consists of automatically creating a
new form that contains all the data from the source
table.
To start the wizard we can do it as describe in the
last point, or a faster way would be from the
Database window with the Forms object selected,
by double clicking on the Create form using wizard
option.

18

The first window of the wizard appears:

In this window we are asked to introduce the fields to include in the form.
Firstly we select from the Table/Queries box the table or query that we are going to get the data from, this
will be the form source. If we want to extract data from various tables it would be better to first create a
query to obtain this data and then select this query as the form source.
Next we will select the fields to include in the form by clicking on the field and then the
simply double click on the field.

button or

19

If we selected the wrong field click on the


list.

button and the field will be removed from ther selected fields

We can select all the fields at the same time by clicking on the
using the button
.

button or deselect all the fields at once

Next we click on the Next> button and the window seen in the following example will appear...

In this screen we select the data distribution within the form. By selecting a format it will appear on the left
side the way it will be seen in the form.

Once we have selected the distribution of our choice click Next and the following window will appear:

20

In this screen we select the forms style, we can select between the various defined styles that Access has. By
selecting a style it will appear on the left side as it will in the form.
Once we have selected a style of our choice we click on the Next button and the last screen of the forms
wizard will appear.

In this window we are asked for the title of the form, this title will also be the name assigned to the form.
Before clicking on the Finish button we can choose between:

After you click on Finish Button , you will get in the following form window.

21

6. Convert a customer table into query using


wizard.
Ans: In order to get specific information we can use the
queries. Suppose we want to see only the names of
employees, department and salaries.
Steps to convert customer table to query:
1. Create a customer tables as in the following screen.

2. Than you goto database object window.


3. Next you click on Query.

22

4. Than you click on Create query by using wizard.


5. After the simple query wizard window will be displayed on the
screen

6. Next you move the fields available fields into selected fields , then
you press Next Button.
7. Again press Next button it will show in the following screen

23

In the above picture has two options Open the query to view
information and modify the query design.
If you want to modify the query you must select Modify the query
desing
Than press Finish button.
8. Now the custom query window will be displayed for modify your
query.

7.Create some tables like producer, customer ,


supplier and create a relationship between
them. An show the relationship in a beat
diagram.

24

Ans: A database normally consists of more than one table. In odder to link
some fields in one table to another field in other tables. First we have to provide
relationships between the tables. Here relationships means providing links
between two or more pages.
In order to provide the link between tables, there must be a common field in
both the tables.
We have already created a table. Now let us create another table and provide
relationship between the two tables.
Let us crate the following three tables now.
1. Producer
2. Supplier
3. Customer
Now we have three tables in database.

Now we will provide link between three tables.


1. First click on tools menu and select Relationships.

25

2. Than the Show table window will be displayed.

Select tables 1 , 2 and 3 click on Add consequently, the table goes into
relationship screen.
3. In order to provide relationships, we should link the common field like
ProductID. Click an ProductID field in table 1 and again click on
ProductID 2 and 3.
4. Consequently the following screen appears.

5. Drag the mouse starting from the common field to second and third.
The folloing screen appears.

26

6. Click on create in the above screen.


Now close the above screen. When a box appears asking to save or
not. Click an Yes to save the information.
Now total relationship will display as like:

8. Create a cross tab query, write the procedure.


Ans: Cross tab queries are used to compare summarized values by two
factors.(Ex: you can calculate the average age of students in each class and
under each section). To create a crosstab query do the following steps.
1. In database window, under objects click on Queries.
2. Click on new button in Database window.
3. A new window popup with types of queries.

27

4. Select Crosstab Query. Click on OK.


5. Now the Cross tab query wizard window Appears. These select the table of
query you want. To add more than one table, crate a query with the required
tables and select that query.
6. In the next window select one or more fields on which you want to sort your
data (in out example select Name) you can see the sample results in lower
part of the window.
7. In the next window you will see will see only the remaining fields. Select one
field for column headings.(eg: Select Total makrs) Click on Next.
8. In the next screen, the field to be analyzed(AVG) and he function used to
analyze(avg) from the options boxes.
9. In the next window enter a name for the query.
10. Select the choice view the query to see the results.
11. Click on Finish.

Now you can see the results of the query in a dynaset. The results show the average
total marks of students in each student.

28

9. By using Design view how to create a table of


Supplier.
Ans: Table in Design View
Now we will create the supplier table. Make sure you are able to see the database
window then click the Tables option, select New and then Design View. The table design
dialog box will open similar to the illustration below.
Table Design View

n the next page is a list of the fields and their attributes. Create the fields then save the table
as supplier.

Table Design Details


Complete the supplier table by creating the following fields in the design window. Set the
properties of the fields as follows:
Field Name

Properties
Data
Type

Field
Size

SupName

Text

30

SupAddress

Text

SupCellNum

Number

Caption

Indexed?

Default
Value

Required

Primary
Key

Yes (No
Duplicates) *

Yes

No

100

No

Yes

No

Long
Integer

Yes

No

No

SupEmail
Text
30
No
No
* This will be set automatically when you define the field as the primary key

No

29

Potrebbero piacerti anche