• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

SQL server: what does this mean?

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome!
 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Sheriff
Posts: 16278
271
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic