LU07c - SQL-DML: UPATE

Sources:

The UPDATE command is used to modify existing data in a table. It can be executed with or without a WHERE clause, depending on whether you want to update specific rows or all rows.

Using a WHERE clause allows you to target specific rows to update. This ensures that only rows meeting a certain condition are modified.

Syntax

UPDATE table_name 
SET column1 = value1, column2 = value2 
WHERE condition;

Example

UPDATE employees 
SET salary = 60000 
WHERE employee_id = 1;

If you omit the WHERE clause, the UPDATE command will modify every row in the table, which can lead to unintended changes, so it must be used with caution.

Syntax

UPDATE table_name 
SET column1 = value1;

Example

UPDATE employees 
SET salary = 70000;  
English Deutsch

Volkan Demir

  • modul/m290/learningunits/lu07/theorie/03.txt
  • Zuletzt geändert: 2024/09/30 15:57
  • von vdemir