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



Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

Database: Define primary key and foreign key?

Posted By :shankey     Posted Date :July 27, 2011    Points :40   Category :Sql Server 
Primary key is use to uniquely identify each row they are unique and cannot be null where as foreign key are use to ensure data integrity and relationship between tables.

You can also find related Interview Question to Database: Define primary key and foreign key?  below: 

Database: What is the difference between primary key and foreign key?

  

PK will enforce entity integrity whereas FK will enforce referential integrity.
(More...)

What are primary keys and foreign keys?

  
Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.
Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.


Shashi Ray (More...)

What are primary keys and foreign keys?

  
Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.
Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables. (More...)

what is the difference between primary key and foreign key?

  
A primary key is a column which uniquely identifies the
records in a table. In a broad sense, a primary key is the
mixture of a unique key and an index: A collumn with a primary
key is indexed to deliver a faster query, and doesn't allow
duplicate values to ensure specific data.

A foreign key is a column (the child collumn) in a table which
has a corresponding relationship and a dependency on another
collumn (the parent collumn) that is usually in a different
table. Parent collumns can have multiple child collumns, but a
child collumn can only have one parent collumn.

Primary key does't allow null value
while foreign key allow null value
(More...)

Database: Define Stored Procedure

  
.A stored proceduer is a named group of sql statements that have been previously created and stored in server database. (More...)

Database: Define trigger?

  
It is a Stored procedure that initiates an action when an event occurs. Event can be insert, delete or update. (More...)

Database:Define cursor?

  
It is a object that manipulate data in a set row by row. (More...)

Database: Define collation?

  
Collation is a set of rules that defines how the data is to be sorted and compared. (More...)

Database: Define sub query

  
A sub-query is also refereed as sub-select, they are enclosed with in the body of another sql statement, Sub select statement generally return single row i.e atomic value and then compared with multiple rows using IN keyword in sql statement that encompases sub-select statement. (More...)

Database: Define Identity Column?

  
Identity column is a column that automatically generates numeric values. Start and increment value are the two properties of prior importance that need to be set with respect to Identity column. Value of this column is mostly used to identify each row uniquely (More...)

Database:Define SQL server agent

  

Its main aim is to ease the implementation of task for the dba with scheduleing of the jobs and scripts. (More...)

Database: How many primary key constraints can be created for one table?

  
Only one primary key constraints can be created for one table. (More...)

Database Concurrency in Sql Server.

  
When two or more user try to update same type of data in a table then Database Concurrency helps in this situation.

There are 2 types of Database Concurrency

Pessimistic: When one user try to change the data with pessimistic concurrency then a lock is placed on the data in a table so that another user cannot change data. when one user finishes then other user can able to change.

Optimistic: When two user works on the same data in a table and one change that data first then second user cannot change that same data becasue the which he have using is allready changed so he cannot do the change becasue change apply to another data that is changed by first user. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


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