Click here to Skip to main content
15,897,371 members
Home / Discussions / Database
   

Database

 
Questionhow to make self backup to sql-server-2008 ? Pin
Gali197820-Nov-11 7:57
Gali197820-Nov-11 7:57 
AnswerRe: how to make self backup to sql-server-2008 ? Pin
Mycroft Holmes20-Nov-11 12:09
professionalMycroft Holmes20-Nov-11 12:09 
AnswerRe: how to make self backup to sql-server-2008 ? Pin
Corporal Agarn21-Nov-11 9:23
professionalCorporal Agarn21-Nov-11 9:23 
QuestionShould every table have Primary key ? Pin
yousefshokati20-Nov-11 0:48
yousefshokati20-Nov-11 0:48 
AnswerRe: Should every table have Primary key ? Pin
Jörgen Andersson20-Nov-11 3:48
professionalJörgen Andersson20-Nov-11 3:48 
AnswerRe: Should every table have Primary key ? Pin
Eddy Vluggen20-Nov-11 7:11
professionalEddy Vluggen20-Nov-11 7:11 
AnswerRe: Should every table have Primary key ? Pin
Mycroft Holmes20-Nov-11 12:06
professionalMycroft Holmes20-Nov-11 12:06 
AnswerRe: Should every table have Primary key ? Pin
SilimSayo22-Nov-11 10:46
SilimSayo22-Nov-11 10:46 
You must be careful how you create your tables. Make sure you have the right entities identified and then normalise them and create your tables accordingly.In some cases, the foreign key becomes part of the composite key(i.e. a multi-column primary key)

Since I am not familiar with what you have in mind, I will use a different example. Consider a database for students, courses, and registration

Student(StudentId, FirstName,LastName, DOB, SIN....)
Course (CourseID, CourseName)
Semester(SemesterId, StartDate, EndDate)
CourseReg(StudentId,CourseID,SemesterID)

The primary keys are bold and underlined.The primary key for CourseReg is a composite key made up of foreign keys. Foreign keys are not always used as part of the composite key; in general use the fewest possible columns in a composite key while maintaining normalisation(3NF is usually good enough)
GeneralRe: Should every table have Primary key ? Pin
yousefshokati22-Nov-11 21:38
yousefshokati22-Nov-11 21:38 
GeneralRe: Should every table have Primary key ? Pin
SilimSayo23-Nov-11 9:35
SilimSayo23-Nov-11 9:35 
GeneralRe: Should every table have Primary key ? Pin
SilimSayo23-Nov-11 9:37
SilimSayo23-Nov-11 9:37 
GeneralRe: Should every table have Primary key ? Pin
jschell25-Nov-11 9:15
jschell25-Nov-11 9:15 
QuestionC# SQL Compact v3.5 Project - ComboBox is Empty Pin
namelkcip18-Nov-11 17:18
namelkcip18-Nov-11 17:18 
QuestionSQL TABLE JOIN Pin
wonder-FOOL18-Nov-11 9:34
wonder-FOOL18-Nov-11 9:34 
AnswerRe: SQL TABLE JOIN Pin
loyal ginger18-Nov-11 9:37
loyal ginger18-Nov-11 9:37 
GeneralRe: SQL TABLE JOIN Pin
wonder-FOOL18-Nov-11 9:39
wonder-FOOL18-Nov-11 9:39 
AnswerRe: SQL TABLE JOIN Pin
wonder-FOOL18-Nov-11 11:00
wonder-FOOL18-Nov-11 11:00 
GeneralRe: SQL TABLE JOIN Pin
phome25-Nov-11 23:33
phome25-Nov-11 23:33 
AnswerRe: SQL TABLE JOIN Pin
Blue_Boy19-Nov-11 6:07
Blue_Boy19-Nov-11 6:07 
GeneralRe: SQL TABLE JOIN Pin
loyal ginger19-Nov-11 10:11
loyal ginger19-Nov-11 10:11 
GeneralRe: SQL TABLE JOIN Pin
SilimSayo19-Nov-11 11:24
SilimSayo19-Nov-11 11:24 
GeneralRe: SQL TABLE JOIN Pin
Pete O'Hanlon21-Nov-11 9:38
mvePete O'Hanlon21-Nov-11 9:38 
AnswerRe: SQL TABLE JOIN Pin
Naunt21-Nov-11 14:31
Naunt21-Nov-11 14:31 
AnswerRe: SQL TABLE JOIN Pin
Niladri_Biswas30-Nov-11 17:03
Niladri_Biswas30-Nov-11 17:03 
QuestionSQLite in-memory database - Loading sqlite db as memory db Pin
Prathapachandran18-Nov-11 2:18
professionalPrathapachandran18-Nov-11 2:18 

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.