Create A Database Apex Ltd. A. Create A Table of Customers
Create A Database Apex Ltd. A. Create A Table of Customers
A. Customer table
B. Inventory Table
C. Invoice Table
D. Payment Table
2. Find all the records from customer table whose state = “CA” AND Credit limit is greater
than 500000.
3. Find all the records from customer table whose state = “CA” OR Credit limit is greater
than 500.
4. Find all the records from Sale orders table whose has placed the order in between Jan
2010 to March 2010.
5. All inventory details from the “Car”, “snowmobile” and “Boat” categories along with the
details of the order placed for them. Using Inventory Table.
6. A contact list for all customer whose first name starts with A, M or R. Using Customer
Table.
7. A list of all the product that were sold with a quantity greater than 5 or the price greater
than 1000. Using Sales Items Description Table
8. Show all the records from table [Sales Order Table] by adding the 7 days in Sales Date.
[using DateAdd function]
9. Display the full name by adding the First & Last name using the (+) sign. (Using
Customer Table.)
10. Display a list of all the orders from table [Sales Order Table] which have not been
shipped. (check for orders with NULL shipped date).
11. Display the length of the first name by using table customer. [by using len fucniton]
12. Display the revere order of the last name by using table customer. [by using strreverse
function]
13. Show all the records from the [Sales Items Description Table] Quarter wise using
datepart.
Chapter 1
1. Rohit is an Accountant in Apex Ltd. At the closing of the quarter, he has to check the Invoices for
which the payments are made in Quarter-I of year 2014. ( Using Payment Table & Invoice
Table)
1.1 Rohit is an Accountant in Apex Ltd. At the closing of the year, he has to check the Sales Order
for which the Payments Term is Cash. On behalf of the result show all details of the customer.
(Using Sales Order & Customer Table)
2. Ankur Mathur, Sales Head of Apex Ltd. wishes to reduce the production of few products. To
analyse which products should not be produced further, he needs to find out the products
.which have not been ordered so far. (Using Inventory & Sales Item Description tables)
3. Varun Gupta, a Chartered Accountant in Apex Ltd., is required to audit the invoices and the
payments. While tracking the payments he noticed that multiple invoices have been created for
a single sales order. To sort out the things, he wishes to check all the sales order having
duplicate invoices. (Using table Invoice Table)
4. The Country Head in Apex Ltd. wishes to compute the sales volume of its products. He also
would like to see the number of orders placed for each product, so that they can focus on
products with greater sales volume. ( using Inventory & Sales item Description Table)
Note: - Select the fields Category and Item Number from Inventory table &
Sales Order Number from Sales Item Description table.
5. Considering the problem of retrieving Sales volume of Products as discussed in Q. No-4, Country
Head wants to have a look at only the products with at least an order count of two. The
management authority also thought of maintaining the products which are cheaper and have
more sales volume.
6. The company Apex Ltd. wishes to revise the credit limit of its customers. For this purpose,
Ashish, the PRO needs a summary report that indicates the count of orders placed by each
customer in every month of first Quarter of the year 2014.
Solution:-
1. Open the Query Design window, by clicking Create -> Queries -> Query Design
2. Select the Inventory, Sales Item Description and Sales Order tables from Show
Table window and click Add
3. Select the columns Category and Item Number from Inventory Table and drag them
to the columns tab. Similarly, select column Sales Date from table Sales Order and
drag it to the columns tab.
4. Now to compute the Total Sales of the Product, multiply Quantity * Price and create
a new column. Write the expression Total Sales: [Quantity]*[Price] in the Field tab of
the next column.
5. Open the query in PivotTable View by clicking PivotTable View from Home ->
Views
6. A PivotTable view of the query having:
Category field as a filter
Product field on row
Year, Quarter and Month on columns
Total Sales (which is computed as Quantity sold into Product cost) displayed as
values.
Solution
To represent the data graphically, we need to create a PivotChart. For this purpose, we
first create a query to display Summary Report and then create a PivotChart based on
that query. In the Pivot Chart, the fields will be placed as:
Category as Filter Field
Years & Quarters field on X-Axis
Total Sales on Y-Axis
Item Number as Series Field