How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Tech_Ben Your Own Question
Tech_Ben, Computer Software Engineer
Category: Programming
Satisfied Customers: 1773
Experience:  10 years professional experience in Java, C++, Visual Basic, .NET, DB2, Oracle, SQL Server
Type Your Programming Question Here...
Tech_Ben is online now
A new question is answered every 9 seconds

What are entity integrity and referential integrity? Why are

This answer was rated:

What are entity integrity and referential integrity? Why are they important for relational databases? Please provide examples to support your answers.

2-3 paragraphs

Thank you for the question. Entity integrity is a database rule that states that 1) Every table should have a primary key, and 2) The value entered in the primary key must be unique, and not null. For example, in a database containing student information, the primary key in the "Student" table would likely be a student ID, or social security number. When inserting a new student in to this table, the student ID or social security number would be unique, and not null. If it were not unique, or not null, we would not have any good way to identify the new student.

Referential integrity is a property of a database that requires all properties of one particular table to be included in another. If we are not allowed to have duplicate student ID's in the Student table, we should also not have duplicate ID's in the StudentTranscript table. Using this example, we would also have all students in the StudentTranscript table that we have in the Student table. A foreign key is commonly defined in referential integrity as the value that indicates a relationship between a set of records across tables.

Please let me know if you have any questions and I will be happy to assist further. Thanks again!
Tech_Ben and other Programming Specialists are ready to help you