Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2011
    Posts
    2

    Unanswered: Help with drink database design

    I'm trying to design a drink database and need some help with the design.

    I created the following tables: an ingredients table that lists all possible ingredients (i.e. rum, coke, vodka and orange juice). A drinks table with a list of all possible drinks (i.e. "rum & coke", "screwdriver"). Finally a Recipes tables describes how to make the drink, so for "rum & coke" there are two entires one with the ingredients ID for rum and one for ingredients ID for coke both with a foreign key to the same drink id.

    What I want to do is given a list of available ingredients id - 1(rum), 2(coke) and 3(vodka) I want to come up with a list of drinks that are possible to make. So I can make rum & coke but not a screw driver because I don't have orange juice.

    Any suggestions on how to write such a select statement or how to better design the tables?

    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    teh tabl dezigngs are okj hic

    what if you have ony 2 oz of vodka, hell, i have even less but i'm saving the last swig

    so you need "qty" quantititity (heh) column as well eh

    hey i still have half a bottle of rum here

    do you wnat your query to be able to make any qty drink?

    like for instance a really dry martini is mostly gin and kind of wave the vermouth cork over the glass

    i speak from considerable experience

    hey i still have almost half a bottle of rum here
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by r937 View Post
    like for instance a really dry martini is mostly gin and kind of wave the vermouth cork over the glass
    Quoted for truth.

  4. #4
    Join Date
    Dec 2011
    Posts
    2
    That's for the reply - I don't need to query for the quantity I'm assuming there's always plenty of liquor to go around.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by shivangp View Post
    That's for the reply - I don't need to query for the quantity I'm assuming there's always plenty of liquor to go around.
    I have my doubts about that especially with those two topers on your case
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •