You are here: Home >Posts Tagged ‘Constraint

SQL DEFAULT Constraint

SQL DEFAULT Constraint เป็นการกำหนดค่าเริ่มต้นเวลาเพิ่มข้อมูล แล้วไม่ได้มีค่าตัวแปรในคอลัมน์นี้ ก็จะมีการนำเอาค่าเริ่มต้นมาเพิ่มลงในคอลัมน์ The DEFAULT constraint is used to insert a default value into a column. The default value will be added to all new records, if no other value is specified.

Tags: , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

SQL FOREIGN KEY Constraint

FOREIGN KEY เป็นค่าในเทเบิลที่เป็นค่าของ PRIMARY KEY อีกเทเบิลหนึ่ง A FOREIGN KEY in one table points to a PRIMARY KEY in another table.

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

SQL UNIQUE Constraint

คำสั่ง SQL UNIQUE Constraint ใช้สำหรับกำหนดค่าห้ามซ้ำของข้อมูลในคอลัมน์ของดาต้าเบส คำสั่ง UNIQUE and PRIMARY KEY ค่าห้ามซ้ำของข้อมูลในคอลัมน์ของดาต้าเบส คำสั่ง PRIMARY KEY constraint automatically แบบเพิ่มอัติโนมัติจะกำหนดให้เป็นค่าไม่ซ้ำอยู่แล้ว หมายเหตุ : คุณสามารถกำหนดค่า UNIQUE ได้หลายคอลัมน์ในหนึ่งตาราง แต่ค่า PRIMARY KEY จะกำให้ได้เพียงค่าเดียวเท่านั้นในหนึ่งตาราง

Tags: , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

SQL NOT NULL Constraint

คำสั่ง SQL NOT NULL constraint เป็นคำสั่งที่ใช้สำหรับจำกัดค่าในคอลัมน์นั้นห้ามเป็นค่าว่าง หากมีการเพิ่มข้อมูลแล้วคอลัมน์ดังกล่าวว่างหรือไม่มีข้อมูลก็จะไม่สามารถเพิ่มหรือแก้ไขให้เป็นว่างได้ The NOT NULL constraint enforces a column to NOT accept NULL values. The NOT NULL constraint enforces a field to always contain a value. This means that you cannot insert a new record, or update a record without adding a value to this field. The following SQL enforces [...]

Tags: , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS