ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
What is data integrity? Explain constraints?
 Question Submitted By :: Latha Sree
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is data integrity? Explain constraints?
Answer
# 1
A constraint is a property assigned to a column or the set 
of columns in a table that prevents certain types of 
inconsistent data values from being placed in the column
(s). Constraints are used to enforce the data integrity. 
This ensures the accuracy and reliability of the data in 
the database. The following categories of the data 
integrity exist:


Entity Integrity 
Domain Integrity 
Referential integrity 
User-Defined Integrity

Entity Integrity ensures that there are no duplicate rows 
in a table.
Domain Integrity enforces valid entries for a given column 
by restricting the type, the format, or the range of 
possible values.
Referential integrity ensures that rows cannot be deleted, 
which are used by other records (for example, corresponding 
data values between tables will be vital).
User-Defined Integrity enforces some specific business 
rules that do not fall into entity, domain, or referential 
integrity categories.

Each of these categories of the data integrity can be 
enforced by the appropriate constraints. Microsoft SQL 
Server supports the following constraints:


PRIMARY KEY 
UNIQUE 
FOREIGN KEY 
CHECK 
NOT NULL

A PRIMARY KEY constraint is a unique identifier for a row 
within a database table. Every table should have a primary 
key constraint to uniquely identify each row and only one 
primary key constraint can be created for each table. The 
primary key constraints are used to enforce entity 
integrity.

A UNIQUE constraint enforces the uniqueness of the values 
in a set of columns, so no duplicate values are entered. 
The unique key constraints are used to enforce entity 
integrity as the primary key constraints.

A FOREIGN KEY constraint prevents any actions that would 
destroy link between tables with the corresponding data 
values. A foreign key in one table points to a primary key 
in another table. Foreign keys prevent actions that would 
leave rows with foreign key values when there are no 
primary keys with that value. The foreign key constraints 
are used to enforce referential integrity.

A CHECK constraint is used to limit the values that can be 
placed in a column. The check constraints are used to 
enforce domain integrity.

A NOT NULL constraint enforces that the column will not 
accept null values. The not null constraints are used to 
enforce domain integrity, as the check constraints.
 
Is This Answer Correct ?    20 Yes 3 No
Vampire007
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
how can do you the system monitoring?  1
What about UPDATESTATISTICS ? Intelligroup2
if we have a column (Key) in a table. and values of that column is Key 1 1 1 2 2 3 3 4 4 5 5 5 and we want to show the data after query..like.. 1(3) 2(3) 3(2) 4(2) 5(3) how many times a single term comes.. Rolta5
I Have Employee table having column name as ID,SALARY how to get second max salary from employee table with id ex ID SALARY 1 20000 7 37000 2 5000  11
How can you get @@error and @@rowcount at the same time?  5
Define candidate key, alternate key, composite key.  9
SQL stops working in every 15 days displaying message that database log file is full. Log file size is 3.95 GB. It is happening after shrinking the database also. What is solution to overcome this problem. Please help me as it's urgent.  5
Is it possible to create tables in stored procedures using a variable for the table name?  2
from the table display the 2nd highest salary? and also the least 2nd salay?  6
I have a table in which phno is one of the columns.i do have some values in tht phno column.i need to update phno column values with 0(zero) as prefix.give me a correct solution plz... Value-Labs5
can you any body tell me the difference between candidate key and primary key  4
How do we rollback the table data in SQL Server  3
How to write query to Delete the records in child table and corresponding records in parent table Semantic-Space8
Wht is the difference between stored procedure and trigger TCS4
what are three different authentications to connect linked servers? CitiGroup1
What is difference between Triggers and store procedure?  2
Explain DBMS, RDBMS?  4
How do SQL server 2000 and XML linked?  2
Can you create UNIQUE and PRIMARY KEY constraints on computed columns in SQL Server 2000? Infosys1
what is Data Transformation Services (DTS) ?can u explain me in detail? TCS5
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com