If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Problem to calculate in MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-11, 06:13
DaKlonker DaKlonker is offline
Registered User
 
Join Date: Nov 2011
Posts: 5
Problem to calculate in MySQL

Hi guys, I have a last question
The question: what is the price of materials to manufacture product XXXX

This is my tables:
1. Product (product_name, product_price, BANR(PK)
2. Get (BANR(FK), RID(FK)
3. Recipe (receipe_name, r_update, RID(PK)
4. IN (basic_goods_amount, goods_measure, RID(FK), IID(FK)
5. Ingredient (ingredient_name, IID(PK)
6. Deliver(purchase_amount, purchase_measure, purchase_price)
All products have a unique recipe with a number of basic goods.
Basic goods are purchased in quantities from a supplier.
To answer the question I should choose a product and check out how much the ingredients cost and how much it needs.

I think I must use the following calculation:

purchase_price (table: Deliver) / purchase_amount (table: Deliver) * goods_measure (table: In).

The result should roughly look like this:

Product: name ............ Total Cost
cheesecake ............... 10

Please help me, I´ve no idea how to solve this problem
Reply With Quote
  #2 (permalink)  
Old 11-25-11, 08:23
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by DaKlonker View Post
Please help me, I´ve no idea how to solve this problem
is this true? really? ~no~ idea?

you need to go back to your teacher and get more guidance

we aren't going to do your homework for you, lol
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On