• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/8

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

8 Cards in this Set

  • Front
  • Back

Data Integrity

Entity Integrity


Refferencial Integrity


Domain Integrity

Entity integrity

Every table needs primary key


Unique


Not null (NN)


Never change

Primary key

Surrogot - computed generated no meaning


Natural - username, email, other unique values



Unique


Not null


Never changes

Referential integrity

Foreign keys referencing other columns


Gotta tell database it's a foreign key


FK


When reference can be trusted!

Domain integrity

Proper data in column.


Ensure data is what is expected.


Domain expreses what is allowed and what is not allowed.


Fit within the rules.



Data type, string, number


Not null


Unique

1NF

Make sure everything is atomic



Singular names in columns


Every column describes table name

2NF

In conjoined table, dont have information that is not relevant or is only relevant to 1 of the columns



It should reference both columns


User_items should have


user_id


Item_id



If everyone has the same number of the item, then item_number is a partial dependent because it refers only to the item_id, and should be in the items table


If everyone has different numbers of an different items then it can be in the same table, because it matter WHICH user HAS 3 of THIS CERTAIN item

3NF

Transitive dependency is like


Listing_id | $ | Catagory | Catag Des



The category description can change with the listing ID, unlike something like most popular item of the day, but it is solely dependent upon category in reality



Break it off into it's own table


Catagory_id | Cat.. | Cat.. description



Now it has it's own ID. Replace the catagory up above with catagory_ID reference and remove the catagory description from the table