Click here to Skip to main content
15,921,169 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is type: something** ? Pin
Derek Waters26-Jul-01 18:30
Derek Waters26-Jul-01 18:30 
GeneralRe: What is type: something** ? Pin
Sam C26-Jul-01 19:42
Sam C26-Jul-01 19:42 
QuestionSQL ? Pin
otvac26-Jul-01 1:39
otvac26-Jul-01 1:39 
AnswerRe: SQL ? Pin
Matt Gullett26-Jul-01 2:09
Matt Gullett26-Jul-01 2:09 
AnswerRe: SQL ? Pin
Hadi Rezaee27-Jul-01 18:18
Hadi Rezaee27-Jul-01 18:18 
GeneralRe: SQL ? Pin
Jamie Nordmeyer27-Jul-01 20:22
Jamie Nordmeyer27-Jul-01 20:22 
GeneralRe: SQL ? Pin
Hadi Rezaee27-Jul-01 20:45
Hadi Rezaee27-Jul-01 20:45 
GeneralRe: SQL ? Pin
Jamie Nordmeyer27-Jul-01 22:36
Jamie Nordmeyer27-Jul-01 22:36 
Hi Hadi. Primary Keys are used in pretty much every brand of database, not just Access. The Primery Key(s) of a table provide a unique way to identify its records, and is almost always an integer of some sort. If a field has been defined as a Primary Key, it may not have any records with the same data; if two records in the table had the same data in a field defined as a Primary Key, that would defeat the purpose of the Primary Key being there... identification.

Let's say you have a central company database (Access, SQL Server, Oracle, doesn't matter... they all use Primary Keys). One table is called 'Staff', and of course contains the employees of the company. The 'Staff' table has one Primary Key field called 'EmployeeID'. Another table in the database might be called 'Projects', and stores information about each project that is being worked on by the company. One of the fields in 'Projects' is also called 'EmployeeID'. If my ID is 1204, for example, this ID would be in every project that I was in charge of. Rather than put all of my information (name, age, date of hire, pay rate, etc) in to each project record, which would be redundant, we store my ID with the record. We can still get to my employee data via the ID, but I'm only storing a small number, not a complex structure of information.

Primary Keys have to be unique, meaning that no 2 records in the same table may have the same value. If another employee also had an ID of 1204, but the company charged the client differently for his/her service, than the client would be under/over billed. Not good, of course, so uniqueness is defintely a requirement.

I hope that answered your question. I know it was a somewhat involved answer, but I was hoping to be as 'unconfusing' as possible. Big Grin | :-D

Jamie Nordmeyer
Portland, Oregon, USA
GeneralRe: SQL ? Pin
Hadi Rezaee28-Jul-01 18:58
Hadi Rezaee28-Jul-01 18:58 
Generallogging winsock send/receive Pin
Kuniva26-Jul-01 0:30
Kuniva26-Jul-01 0:30 
Generalclass design question Pin
26-Jul-01 0:25
suss26-Jul-01 0:25 
GeneralRe: class design question Pin
Tomasz Sowinski26-Jul-01 2:50
Tomasz Sowinski26-Jul-01 2:50 
GeneralRe: class design question Pin
26-Jul-01 2:58
suss26-Jul-01 2:58 
GeneralRe: class design question Pin
Tomasz Sowinski26-Jul-01 3:09
Tomasz Sowinski26-Jul-01 3:09 
GeneralRe: class design question Pin
26-Jul-01 3:57
suss26-Jul-01 3:57 
GeneralRe: class design question Pin
Tomasz Sowinski26-Jul-01 4:25
Tomasz Sowinski26-Jul-01 4:25 
GeneralRe: class design question Pin
26-Jul-01 6:04
suss26-Jul-01 6:04 
Generalclass design question Pin
26-Jul-01 0:24
suss26-Jul-01 0:24 
Questionwhats wrong here?? Pin
26-Jul-01 0:14
suss26-Jul-01 0:14 
AnswerRe: whats wrong here?? Pin
Steve T26-Jul-01 12:24
Steve T26-Jul-01 12:24 
GeneralOwner Drawn Buttons Pin
Derek Lakin25-Jul-01 23:22
Derek Lakin25-Jul-01 23:22 
GeneralRe: Owner Drawn Buttons Pin
jerry0davis25-Jul-01 23:33
jerry0davis25-Jul-01 23:33 
GeneralRe: Owner Drawn Buttons Pin
Derek Lakin26-Jul-01 1:45
Derek Lakin26-Jul-01 1:45 
GeneralRe: Owner Drawn Buttons Pin
Paolo Messina26-Jul-01 11:37
professionalPaolo Messina26-Jul-01 11:37 
GeneralRe: Owner Drawn Buttons Pin
Derek Lakin26-Jul-01 21:20
Derek Lakin26-Jul-01 21:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.