What is the difference between defining keys and constraints in database theory?
-
i mean the major difference between the defining the primary, foreign keys and constraints...
-
Answer:
A constraint is a predetermined limitation on a column in a table. Example: you can add a constraint on a bit/bool field to default to 0 if it's null. A primary key is a constraint on a column or across multiple columns which require that each row be unique for that column(s). Null's are not allowed for primary key columns. Primary keys are indexed, making data retrieval faster when searching or joining by that column(s). Foreign key's are a bit more complex. Usually they are used to require that the foreign key value corresponds with an existing primary key value in another table.
yashwanth k at Yahoo! Answers Visit the source
Related Q & A:
- What Is The Difference Between Magicjack And Magicjack Plus?Best solution by Yahoo! Answers
- What's the difference between Current (I) and Potential Difference (V?Best solution by diffen.com
- What does it mean to be unresponsive? What's the difference between unresponsive and unconscious?Best solution by answers.yahoo.com
- What does the song by Alicia Keys Unthinkable mean?Best solution by ChaCha
- What is the difference between social theory and sociological theory?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.