Sei sulla pagina 1di 10

MS ACCESS

Hands On Exercise
Create Following tables
Table: Customer
Cust_Id
Text
Cust_title

Text

Cust_FName

Text

CustLName

Text

Cust_City
Text
Cust_Contact_ Text
No

Should start
with C
Should not be
NULL
Should not be
NULL
Should not be
NULL
Should not
exceed 10
digit

mdp@somaiya.edu
1

Table: Item
Item_Id

Text

Item_Name

Text

Item_Rate

Number

Sup_id

Text

Table: Supplier
Supplier_Id
Text

Should start
with I
Should be
selected from
list
Should not be
negative or
zero

Should start
with S

mdp@somaiya.edu
2

Supplier_Name

Text

Should not
be NULL

Supplier_Addres Text
s
Suppl_Contact_ Text
No
IS_Supplier_Mu Yes/no
mbai

Table: Order
Order_No

Text

Order_Date
Cust_ID

Date
Text

Should start
with O

mdp@somaiya.edu
3

Table: Order_Detail
Order_No
Text
item_Id
Text
Quantity
Number

It should be
greater than
zero

Relationships

Create a relationship between the 2 tables

Click on Database Tools and choose Relationships. Add both tables as seen below

mdp@somaiya.edu
4

When both tables have been selected, close the window. Click in Code No from the
first table and drag into Code No in the second table. This will bring up the
following window.

mdp@somaiya.edu
5

Click Create and a line will now join the 2 tables. There is now a relationship
between the 2 tables.

mdp@somaiya.edu
6

How to enter data?


The Sequence of entering data
Around 10 records in each table

Queries
Perform following Queries related to order form
1)
2)
3)
4)
5)
6)

Display list of all approved supplier


Display list of all customers who are from Mumbai
Display names and contact numbers of the customers who are from Delhi
Display list of all supplier whose name start from V
Display details of supplier who supplied order O101
Display item list in the ascending order of its prices.

mdp@somaiya.edu
7

7) Display the items which are priced below Rs.10


8) Display the items which are priced between Rs. 5 to Rs. 10
9) Display all orders that were ordered before 01/01/2010
10) Display all suppliers who are from Mumbai or Pune
11) Display list of all orders supplied by supplier with supplier_id S102
12) Display names of customers whose orders are supplied by Vikas
13) Display list of all items supplied by supplier Vikas
14) Display information of top 2 products we deal with
15) Display top 25% product we deal with
16) Display information of those customer who ordered Pencil
17) Display all orders placed by customer having cust_id C101
Calculation fields
18) Find out the bill amount of all orders
19) Display order numbers of those orders whose bill amount is more than 200
20) Count the number of customers we deal with
21) Display how many characters are there in every customers name.
22) Display the list of item names in capital letters
23) Display the first 3 characters of every customers name
24) Display the last 3 characters of every customers name
25) Display 4th, 5th, 6th characters of every customers name
26) Display the number of orders given by each customer
27) Display the number of items each customer ordered for
Crosstab Query
28) Display order wise item distribution.
Update Queries
29) Update item table increase the rate of Pencil by Rs. 10
30) Update the price of the product Eraser to Rs. 25
mdp@somaiya.edu
8

31) Update the mobile number of customer having cust_id C101 to 9696961515

Delete Queries
32) Delete record from Supplier table having supplier_id S103
33) Display records of those customers who are staying in City, where city name will be
provided by user at runtime.
34) Delete record from supplier table, accept supplier_id at runtime

Working with Forms


35) Create Form to enter data in Customer table using Form wizard
36) Create Form to enter data in Supplier table using Form wizard
37) Create Form for customer data using Form Button
38) Create form for order data using Form Button

Report Creation
39) Create report showing list of all customer name and contact number.
40) Create a report which displays details of all order wise total amount
41) Create report of those customers who are staying in City, where city name will be
provided by user at runtime.

mdp@somaiya.edu
9

mdp@somaiya.edu
10

Potrebbero piacerti anche