Post on 15-May-2015
description
Microsoft office Access 2007
2013 Page 1
Question1-
Create a database for company.
i. Create table for employee details are as follows-
Emp code Name Address Joining date Dept id salary
ii. Create table for dept details are as follow
Dept id Dept name Manager name Vendor id
iii. Create table for vendor details are as follows-
Vendor id Name Address Contact no Email id
Select blank database and write file name as company
Click on create button
Microsoft office Access 2007
2013 Page 2
Step for Creating Employee Table
- Go to view menu
- Select design view
Write table name to save it.
E.g. - Employee table name
Click on ok.
By default id with be field name and
data type will be auto number.
ID is primary key.
Microsoft office Access 2007
2013 Page 3
Enter field name and data type in employee table.
Emp code is primary key.
Save the employee table.
Now go to design
Select view and click on datasheet view for entering the record.
Enter the records in employee table and save it.
Microsoft office Access 2007
2013 Page 4
Field name and data type entered in dept table.
Dept id is the primary key.
Go to create
menu
Click on table
for new table.
Now the save the
table as “dept”
Click on ok button.
Now go to home menu.
Click on view and select design view
for entering the field and data type in
dept table.
Microsoft office Access 2007
2013 Page 5
Enter the record in dept table and click on Save (ctrl+S) the dept table.
Click on datasheet
view
Go to create
menu
Click on table
for new table.
Now the save the
table as “vendor”
Click on ok button.
Microsoft office Access 2007
2013 Page 6
Now go to home menu.
Click on view and select design
view for entering the field and data
type in dept table.
Field name and data
type is entered in vendor
table.
Vendor id is the primary
key.
Save (ctrl+S) the vendor
table.
Go to design menu
Click on view and select
datasheet view for
entering the records in
vendor table.
Microsoft office Access 2007
2013 Page 7
Records are entered in the vendor table.
Save the records of vendor table.
Question 2-
Create relationship between these tables.
Go to datasheet
menu
Click on relationships
Microsoft office Access 2007
2013 Page 8
Click on dept and then click on add
Click on employee table and then click on add.
Click on vendor table and then click on add.
Now you can see we have select the table and clicked on add among which we have
to create relationship.
Now click on edit relationship to create relationship among tables.
Microsoft office Access 2007
2013 Page 9
In edit relationship click on create new.
Now in create new, create the relationship among the table.
Click on ok and again press ok and output will be displayed as shown below.
Microsoft office Access 2007
2013 Page 10
Click on create new in edit relationship window for creating new relationship.
Now in create new, create the relationship among the table.
Click on ok and again press ok and output will be displayed as shown below.
OUTPUT-
Microsoft office Access 2007
2013 Page 11
Question 3-
Select the joining date field and find the data above from 20th December 2012
in employee table.
Select joining date and go to home menu.
Click on filter.
In date filter, select after and press ok.
Microsoft office Access 2007
2013 Page 12
Output
Question 4
Explain split forms with the conditional formatting. The condition is employee
address=”Mumbai”. (the formatting of the field is color=”yellow”, text color=”black”, bold,
italic, underline and text font=18).
Go to create menu.
Click on split form
Split form is used to show a datasheet in the upper section and a form in the lower section
for entering information about the record selected in the datasheet.
Write the joining date is on or after
20/12/2012
Now press ok
Microsoft office Access 2007
2013 Page 13
Now click on conditional and a conditional formatting window will appear which is shown
below.
In condition 1 write field value is equal to “Mumbai”.
Apply the changes like the field is color=”yellow”, text color=”black”,
bold, italic, underline and text font=18).
Microsoft office Access 2007
2013 Page 14
Output-
Data found where address=”Mumbai”
Microsoft office Access 2007
2013 Page 15
Question 5
Execute the query using query design. Select emp code, name, joining date, dept name and vendor
name.
Click on query design for executing a query.
Show table window select dept and click on add
Click on employee and then click on add button.
Click on vendor and then click on add button
Now you can see in above image all table are display and relationship is also established.
Microsoft office Access 2007
2013 Page 16
Now in field select the field name.
Select the table in name in table.
And check the show box in show.
After all this step done , go to design and click on run to execute the query.
Output