Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
modul:m290:learningunits:lu07:loesungen:l02 [2024/10/01 08:55] – angelegt vdemirmodul:m290:learningunits:lu07:loesungen:l02 [2024/10/17 12:44] (aktuell) vdemir
Zeile 1: Zeile 1:
-====== LU07.A02 - INSERT INTO ======+====== LU08.S02 - INSERT INTO ======
  
-===== Requirements  ===== +===== A: Separate INSERT statements ===== 
-  * Work type: Individual +Below you will find ten lines with employee data that you should insert into the ‘employees’ table, but with 10 separate INSERT commands.
-  * Timeframe: 15 Minutes +
-  * Means of aid:  +
-      * Only teaching materials, no websearch, no use of ai. +
-  * Expected Result:  +
-    * At least 30 rows of employees data, inserted into the **table employees**. +
-    * 10 of the 30 rows are inserted with 10 separate insert statements.  +
-    * 20 of the 30 rows are inserted with one single SQL statement.+
  
-===== Assignments ===== +  INSERT INTO EMPLOYEES (employee_id, name, surname, birthdate, sex, pronomen, employment_date, salary, department)
- +
-==== A: Separate INSERT statements ==== +
-Below you will find ten lines with employee data that you should insert into the ‘Employees’ table, but with 10 separate INSERT commands. +
- +
- INSERT INTO EMPLOYEES (employee_id, name, surname, birthdate, sex, pronomen, employment_date, salary, department)+
   VALUES (1, 'John', 'Doe', '1985-03-25', 'M', 'He/Him', '2015-01-15', 55000.00, 'Finance');   VALUES (1, 'John', 'Doe', '1985-03-25', 'M', 'He/Him', '2015-01-15', 55000.00, 'Finance');
   INSERT INTO EMPLOYEES (employee_id, name, surname, birthdate, sex, pronomen, employment_date, salary, department)   INSERT INTO EMPLOYEES (employee_id, name, surname, birthdate, sex, pronomen, employment_date, salary, department)
Zeile 39: Zeile 27:
   VALUES (11, 'Ryan', 'Turner', '1991-05-21', 'M', 'He/Him', '2017-07-19', 70000.00, 'Marketing');   VALUES (11, 'Ryan', 'Turner', '1991-05-21', 'M', 'He/Him', '2017-07-19', 70000.00, 'Marketing');
  
-==== B: One single INSERT statement ==== +===== 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"  +... Insert the following 20 lines of data into the table "employees"
- INSERT INTO EMPLOYEES (employee_ID, name, surname, birthdate, sex, pronomen, employment_date, salary, department)+ 
 +  INSERT INTO EMPLOYEES (employee_ID, name, surname, birthdate, sex, pronomen, employment_date, salary, department)
   VALUES    VALUES 
     (11, 'Ryan', 'Turner', '1991-05-21', 'M', 'He/Him', '2017-07-19', 70000.00, 'Marketing'),     (11, 'Ryan', 'Turner', '1991-05-21', 'M', 'He/Him', '2017-07-19', 70000.00, 'Marketing'),
Zeile 63: Zeile 52:
     (29, 'Oliver', 'Nelson', '1993-07-21', 'M', 'He/Him', '2018-11-19', 64000.00, 'Finance'),     (29, 'Oliver', 'Nelson', '1993-07-21', 'M', 'He/Him', '2018-11-19', 64000.00, 'Finance'),
     (30, 'Ava', 'Walker', '1958-02-11', 'F', 'She/Her', '2021-05-30', 52000.00, 'Marketing');     (30, 'Ava', 'Walker', '1958-02-11', 'F', 'She/Her', '2021-05-30', 52000.00, 'Marketing');
-===== Solution ===== +     
-[[modul:m290:learningunits:lu07:loesungen:l02|Lösung]]+ The result after the import of all 30 rows should look like in Webstorm the image below. As you can see, the select on the table "employees" returns 30 rows of data. 
 + 
 +{{:modul:m290:learningunits:lu07:loesungen:m290.lu07.s01c.png?800|}} 
  
 ===== Vocabulary ===== ===== Vocabulary =====
  • modul/m290/learningunits/lu07/loesungen/l02.1727765738.txt.gz
  • Zuletzt geändert: 2024/10/01 08:55
  • von vdemir