Professional Documents
Culture Documents
– Second level
• Third level
– Fourth level ISYS6465
» Fifth levelDatabase System
Week 4 – Session 4
SQL: Data Manipulation (1)
Learning Outcomes
• INSERT
• Click to edit Master text styles
• UPDATE
– Second level
• DELETE• Third level
– Fourth level
• SELECT »
Fifth level
PREPARATIONS
UPDATE TableName
• columnName1
SET Click to edit Master text
= dataValue1 styles
–[, columnName2
Second level= dataValue2...]
[WHERE searchCondition]
• Third level
• TableName can–beFourth
namelevel
of a base table or an updatable view.
» Fifth
• SET clause specifies names levelof one or more columns that are to be
updated.
• WHERE clause is optional:
– if omitted, named columns are updated for all rows in table;
– if specified, only those rows that satisfy searchCondition are updated.
• New dataValue(s) must be compatible with data type for
corresponding column.
UPDATE
• Select Between
• Click to edit Master text styles
SELECT { * | field_name [, …] } SELECT { * | field_name [, …] }
FROM table_name [, …] FROM table_name [, …]
– Second level WHERE field_name BETWEEN
• Distinct value1AND value2
• Third level
SELECT DISTINCT { * | field_name [,
– Fourth level Like
…] }
FROM table_name [,»…]Fifth level SELECT { * | field_name [, …] }
FROM table_name [, …]
WHERE field_name LIKE {PATTERN}
• Where
SELECT { * | field_name [, …] }
FROM table_name [, …]
WHERE {condition}
SELECT