April 26th, 2003, 06:50 PM
|
#1 (permalink)
| | Junior Member
Join Date: Apr 2003
Posts: 27
| Urgent Help Required!!!!!!!
i have this one query to do in database and i could not figure out how to do that, first of all the question is The databasemust have the ability of producing (on demand) reports on current sales figures, such reports shell provide valuable statistical information on the number of items sold for each product (up to a period of one year). that was the questions and i need to find out the sales figures and the tables i have are CUSTOMER, ORDER, EMPLOYEES, PRODUCTS, SUPPLIERS, there are the tables and what formula or methods do i need to use in query to get the sales figures
Cheers
I hope u all will try ur best to solve this matter |
| |
April 27th, 2003, 06:27 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Oct 2001
Posts: 21,019
|
[quote]what formula or methods do i need to use in query to get the sales figures
Possibly...
SUM
COUNT
GROUP BY (required by SUM and COUNT)
Although its sounding like homework, so can't give it all away  |
| |
April 27th, 2003, 09:20 PM
|
#3 (permalink)
| | Junior Member
Join Date: Apr 2003
Posts: 27
|
vass thanks very much for replying but i dont understand what u have described here, and its not a homework, i have created a database for my uncle's work and he asked to produce a sales figure report, please could u explain me again
__________________
WestSide, BadBoy Killer
|
| |
April 27th, 2003, 10:12 PM
|
#4 (permalink)
| | Ultimate Member
Join Date: Oct 2001
Posts: 21,019
|
You're not really giving us any information to work with. We don't have the table structure to give you the data you require...
You're giving us a 4 tires, and telling us to build a car
What are the columns in the tables? What are the relationships?
SUM, COUNT, GROUP BY are SQL functions that are great for reports but we have no information to build a real query. |
| |
April 27th, 2003, 10:24 PM
|
#5 (permalink)
| | Ultimate Member
Join Date: Jun 2002 Location: Iowa
Posts: 2,879
|
I suspect this thread will be kept open, and the others closed, so I'll post here.
#1 what type of database are you using ? |
| |
April 28th, 2003, 06:42 AM
|
#6 (permalink)
| | Junior Member
Join Date: Apr 2003
Posts: 27
|
First of all i am sorry for posting double threads, didnt know, anyway i dont why u guys keep saying its a home work, i am using Microsoft Access Database, and this time i will try my best to give you all the related information which i hope will help u guys to understand more about this problem. customer table is related to Order, Customer-1-m- Order( that means one to many), Order table is related to Product, Order-m-1-product, Order table is related to Employee table, Order-m-1-employee, product related to supplier, product-m-1-supplier, employee table related to department table, employee-m-1-department. now i will tell you the entitys of these tables.
Customer table
Custmer Id No (p Key)
Surname
forename
Date Of birth
Address
Telephone No
Cradit
Order Table
Order ID No (p key)
Customer Id Number
Product No
Quantity
Employee Id No
Date Of Order
Total Price
Product Table
Product Name
Product No (p Key)
Product Cost
Amount Purchased
Supplier Id Number
Date of Order
Employee Table
Employee ID No (p key)
Department Name
Name
Department Table
Department Name (p key)
Supplier Table
Supplier Id No (p key)
supplier Name
Address
Telephone No
that is my Access database structure. i hope u guys understand and i am sorry surreal for posting same threads to many times. |
| |
April 30th, 2003, 12:29 AM
|
#7 (permalink)
| | Ultimate Member
Join Date: Oct 2001
Posts: 21,019
|
It looks like ORDER will be your primary table so you can start simple
SELECT *
FROM ORDER
Then you can add a join Code: SELECT *
FROM ORDER
INNER JOIN PRODUCT
ON PRODUCT.[PRODUCT NO] = ORDER.[PRODUCT NO]
WHERE DATEDIFF(year, 1, Now(), ORDER.[DATE OF ORDER]) < 1 Something like that should get ya started...
why is date of order in the product table |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |