.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

SQL Server 2008 - Table - Clarifications

Posted By: Aarti     Posted Date: October 17, 2009    Points:2   Category :Sql Server
I am new to SQL Server 2008 database development.

Here I have a master table named 'Student' and a child table named 'Address'. The common column between these tables is 'Student ID'.

My doubts are:

> Do we need to put 'Address Id' in the 'Address' table and make it primary key? Is it mandatory?
( I won't be suing this 'Address Id' in any of my reports )

> Is Primary key column a must in any table?

Would you please help me on these.

Would you please also refer best links/tutorials for SQL Server 2008 database design practices (If you are aware of) which includes naming conventions, best practices, SQL optimizations etc. etc.

Thank you,

Author: Amit Mehra             
Posted Date: October 17, 2009     Points: 5   

Hi Aarti,

Yes if the Child table is Address than you should put Address Id as a primary key.

No its not necessary to have primary key in all the tables but its best SQL Practices to have primary in in all the table. It will help to fetch the record faster because index is been created in the primary key column and foreign key column automatically.

I would also recommend you to have foreign key Student Id in Address Table.


Please "Mark As Answer " if this post help you.

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend