Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
modul:m290:learningunits:lu08:aufgaben:01 [2024/10/30 13:43] – angelegt vdemir | modul:m290:learningunits:lu08:aufgaben:01 [2024/11/20 11:40] (aktuell) – cbolzern | ||
---|---|---|---|
Zeile 3: | Zeile 3: | ||
===== Requirements | ===== Requirements | ||
* Work type: Individual | * Work type: Individual | ||
- | * Timeframe: | + | * Timeframe: |
* Means of aid: | * Means of aid: | ||
* Only teaching materials, no websearch, no use of ai. | * Only teaching materials, no websearch, no use of ai. | ||
+ | * Webstorm Codeeditor | ||
* Expected result: | * Expected result: | ||
- | * Conduct | + | * A JavaScript program, that displays a greeting on the terminal |
- | * Establishment | + | |
===== Assignments ===== | ===== Assignments ===== | ||
+ | As always, our first program on the server is a small script designed to greet the world with the infamous “Hello World”. | ||
- | ==== A: DATA SCHEMA ==== | + | - Open your Webstorm editor and establish |
- | First of all we need a database schema | + | - Write in this script your helloWorld statement, using the JS command // |
+ | - Generate more terminal outputs by using arrays, for iterations and console.log() function. e.g. // | ||
+ | - Open a terminal window by clicking | ||
+ | - Install all missing JS packages, that Webstorm requires from you. | ||
+ | - Start your server by using the node command, e.g. //node helloWorld.js// | ||
+ | - If everything is correct, you will see the helloWorld statement as an output from your server in the bottom terminal window of Webstorm. | ||
- | CREATE DATABASE hr_database; | ||
- | SHOW DATABASES; | ||
- | USE hr_database; | ||
- | |||
- | ==== B: CREATE TABLE ==== | ||
- | To exercise the DML commands, we need a suitable table including a reasonable amout of data. The following SQL statement will create a table **employee** regarding all necessary attributes of an " | ||
- | |||
- | CREATE TABLE EMPLOYEES ( | ||
- | employee_ID INT PRIMARY KEY, -- Employee ID as the primary key | ||
- | name VARCHAR(50) NOT NULL, -- Name of the employee (max length 50 characters) | ||
- | surname VARCHAR(50) NOT NULL, -- Surname of the employee (max length 50 characters) | ||
- | birthdate DATE NOT NULL, -- Birthdate of the employee | ||
- | sex CHAR(1), | ||
- | pronomen VARCHAR(10), | ||
- | employment_date DATE NOT NULL, -- Date when the employee was hired | ||
- | salary DECIMAL(10, 2) NOT NULL, -- Salary of the employee (up to 10 digits, 2 decimal places) | ||
- | department VARCHAR(50) NOT NULL -- Department where the employee works | ||
- | ); | ||
- | |||
- | **Explanation** | ||
- | - **employee_ID** is the primary key and ensures that each employee has a unique ID. | ||
- | - **name** and **surname** are ' | ||
- | - **birthdate** and **employment_date** use the ' | ||
- | - **sex** is stored as a ' | ||
- | - **pronomen** stores the employee' | ||
- | - **salary** is stored as a ' | ||
- | - **department** is a VARCHAR(50) field that stores the name of the department the employee is associated with. It has a NOT NULL constraint to ensure that every employee is assigned to a department. | ||
===== Solution ===== | ===== Solution ===== | ||
- | [[modul: | + | [[modul: |
===== Vocabulary ===== | ===== Vocabulary ===== | ||
^ English ^ German ^ | ^ English ^ German ^ | ||
- | | preparatary | + | | preparatory |
+ | | infamous | berühmt-berüchtigt | ||
---- | ---- | ||
[[https:// | [[https:// |