Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Keys and diagram

Status
Not open for further replies.

Pearlios

Programmer
Sep 3, 2012
24
0
0
AU
Hello, just started learning SQL and have some questions.

First is what is the diagram and how is it useful. All i understand is that the primary key is the column with unique entries.
Using this picture for example from could someone point me a really good explanation for it?

Also, If I ran a select query on a stupidly large data, does it have a fail safe of not providing me with data? I ask this because I'm getting zilch when I know data should be there.

Third, is there a way to view the large amount of data inside tables without knowing what I want to query from it? Like have it list everything in it.
I've tried Select * From tblsomething and nothing is returned to me.
 
1 the diagram is useful to gain an understanding of the relationships between tables

picture = 1000 words

2 that's only a proposed architecture, and only for surrogate keys

it's ~not~ the way you should be learning about primary keys

2a if you are getting zilch when you know there should be some rows, that means you've done something wrong in your query

3 if SELECT * FROM tblsomething returns no rows, that means there aren't any rows



r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top