-1

I'm really stuck on this SQL question on my hw assignment. I was wondering if any of you can help me. These are the questions that I'm stuck on...

I really don't know which queries to go with to grab data from two different tables for example:

get supplier names to anybody who shipped to the COLLATOR Project.

Would it be..

SELECT sname
FROM suppliers, project
WHERE projnum = 'J5' ?

Because that pulls up all of the Supplier names and that's incorrect because they don't all ship to J5.

11.Get supplier names for suppliers who shipped to the COLLATOR project.

13.Get a list of the supplier names, and the total quantities each of them shipped of each part.

  1. Get project names for projects using at least two parts from supplier S1.

17.Get part names for parts shipped by at least 2 different suppliers in LONDON.

36.Get all the colors that are not shipped by the supplier S1.

You can access the tables at this link: https://i.stack.imgur.com/Q12dw.png

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Anthony Sawah
  • 57
  • 1
  • 7
  • We can help you with your homework but we aren't here to do it for you. Start with one question. try your best, when you get stuck then post the question, some sample data (not a picture of it), what you have tried, and what your expected output is. then what you learn from that question you can apply to the next question and if you get stuck then we can look at that one. also Read [How to write good questions](http://stackoverflow.com/help/how-to-ask) – G B Jan 18 '15 at 01:36
  • ..... I'm not asking anyone to do my homework for me, I'm simply asking for help. Once I see how one of the questions or any of the questions were done, I analyze and see how they did it and then I use that to answer my other questions, and I already did one question up there. Next time if you'd like to help, please do so. If you don't like what I'm doing, then you can email me and we can happily resolve our personal issues privately. :) – Anthony Sawah Jan 18 '15 at 01:44

1 Answers1

0

--11 - You need to join your tables

SELECT
   s.sname
FROM suppliers s, projects p, orders o
   WHERE s.sup# = o.sup#
   AND p.proj# = o.proj#
   AND p.projname = 'collator'

-- The other questions are all the same issue, you need to join to get what you want.