File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL server: what does this mean?

 
william chaple
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi can someone elaborate this for me? I am a little confused on what exactly it is asking for

(question)
-- 1. Select all the stores for a specific company and state

 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much do you understand about relational databases and SQL? In this case, there are two tables ... one lists companies and the other lists stores. There is a foreign key to company in store, so that establishes a one company contains many stores relationship. The query finds all the stores belonging to company 2 in state NY. It joins the two tables to do this, though strictly speaking, it doesn't need to.
 
william chaple
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Charles wrote:How much do you understand about relational databases and SQL? In this case, there are two tables ... one lists companies and the other lists stores. There is a foreign key to company in store, so that establishes a one company contains many stores relationship. The query finds all the stores belonging to company 2 in state NY. It joins the two tables to do this, though strictly speaking, it doesn't need to.




awesome makes sense! Thank you!
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome!
 
william chaple
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ive been practicing it, actually I do have a question to help clarify some information


Its been asked to n Select all the stores for a specific company and state. i am having a hard time breaking it down.

Why do they use upper(name). Is that just to select all the named stores?


also,

Why are they selecting company.companyid if they can use Company Name or Location of the company. like maybe company.Location where company = FL. Like I am just trying to break it down. ha ha Sorry but I really appreciate the help guys!

 
Junilu Lacar
Bartender
Pie
Posts: 6530
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
upper() is a function that returns the argument with all letters as uppercase. As the alias suggests, upper(name) will return the name formatted as uppercase letters where appropriate.


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic