Dies ist eine alte Version des Dokuments!
LU07.A03 - INSERT INTO
Requirements
- Work type: Individual
- Timeframe: 15 Minutes
- Means of aid:
- Only teaching materials, no websearch, no use of ai.
- Expected Result: eployee's data are updated according to the requirements below
Assignments
In assignment A2 you imported 30 lines of date to the table 'employees'. In this assignment your task is to perform some DML update commands.
A: Update with OR
As a company policy the attribute 'sex' is not required anymore and is to be emptied. Formulate the corresponding SQL statement that deletes all content from that column.
UPDATE employees SET sex = '' WHERE sex = 'M' OR sex = 'F';
After performing the update statement, the select on the table 'employee' shows that the column 'sex' is now empty.
B: One single INSERT statement
After inserting 10 lines of data with 10 separate SQL commands, the next step is to do the import with one single SQL commands, which is basicly more compact and more efficient, that the first approach. Insert the following 20 lines of data into the table „employees“.