views:

72

answers:

5

This are few of the fundamental database questions which has always given me trouble. I have tried using google and wiki but I somehow I miss out on understanding the functionality rather than terminology.

If possible would really appreciate if someone can share more insights on this questions using some visual representative examples.

  • What is a key? A candidate key? A primary key? An alternate key? A foreign key?

  • What is an index and how does it help your database?

  • What are the data types available and when to use which ones?

+2  A: 

Buy an introductory book about relational databases, such as one of these.

SLaks
Downvoters: Why do you disagreee?
SLaks
I'm not a down-voter, but the only thing I can think of is that the books cited in the SO question tend to be 'practical' rather than explaining the fundamentals. There should be a combination of the two sides of the game - theory and practice.
Jonathan Leffler
+1  A: 

I highly recommend Data Modeling for Information Professionals. You are asking about basic fundamental theory and concepts which are much better explained in a book than on a Q&A answer site like SO.

fuzzy lollipop
A: 

You could simple search google or wiki...

What is an index and how does it help your database?

What are the data types available and when to use which ones?

But in every database (every version of the same db) You can have other data types...its better if You specify which type of db You are interesting

A primary key

In this site You find other keys also ;)

netmajor
A: 

There's not really much difference between a "primary key" and an "alternate key". Searches by primary key might be more optimized.

Data types vary a lot between databases, but generally you'll have:

  • Numeric data types like INTEGER and REAL.
  • At least one string type like VARCHAR.
  • Raw binary data (BLOB).
  • NULL, to indicate the absence of a value.
dan04