Wednesday, February 27, 2013

Programming (week 4)

Bismillahirrahmanirrahim~

We started the class with several questions to refresh the previous lesson on last week (which was about DATABASE)


"Relationship"


*related to each other

Why?

  • To combine/relate the tables after we normalize it

How we relate one to another tables?

  • Conditions (primary key, foreign key & type of relationship)

  1. Primary key- a field (column) that uniquely identifies each record in the table [eg: matric numbers]
  2. Foreign key- a field added to a table in order to relate record to another table [when a primary key goes to another table, it becomes a foreign key]-just like a foreign student, we call them foreign when they study at another country
  3. Types of relationship:

  • One-to-one relationship-only have one related record [for confidential & general information]
  • One to many
  • Many to many





No comments:

Post a Comment