aspose file tools*
The moose likes Other Languages and the fly likes SQL server: what does this mean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "SQL server: what does this mean?" Watch "SQL server: what does this mean?" New topic
Author

SQL server: what does this mean?

william chaple
Ranch Hand

Joined: Mar 08, 2013
Posts: 127
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

Joined: Oct 01, 2001
Posts: 2864
    
  11

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

Joined: Mar 08, 2013
Posts: 127
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

Joined: Oct 01, 2001
Posts: 2864
    
  11

You're welcome!
william chaple
Ranch Hand

Joined: Mar 08, 2013
Posts: 127
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

Joined: Feb 26, 2001
Posts: 5288
    
  10

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.



Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL server: what does this mean?