Introduction To Structured Query Language (SQL) : Ms. Kielly Chrizza Mae T. Lara
Introduction To Structured Query Language (SQL) : Ms. Kielly Chrizza Mae T. Lara
Structured Query
Language (SQL)
• SQL Example
Numeric
• NUMBER(L,D) or NUMERIC(L,D)
Character
• CHAR(L)
• VARCHAR(L) or VARCHAR2(L)
Date
• DATE
Creating Table Structures
NOT NULL
• Ensures that column does not accept nulls
UNIQUE
• Ensures that all values in column are unique
DEFAULT
• Assigns value to attribute when a new row is added to table
CHECK
• Validates data when attribute value is entered
SQL Indexes
WHERE condition
• Specifies the rows to be selected
ROLLBACK: Command to restore the database
• Syntax - ROLLBACK;
• Undoes the changes since last COMMIT
command
DELETE: Command to delete
• Syntax - DELETE FROM tablename
• [WHERE conditionlist];
Review Questions
• https://www.guru99.com/introduction-to-
mysql-workbench.html