background image

1 / 9 

 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 

Dariusz Jankowski©

 

Databases 

Computer Laboratory 

  

DML 

background image

2 / 9 

1. Introduction 

  Składnia polecenia INSERT (tylko jeden wiersz może być wstawiony) 

 

 

 

 

 
 
- zwróć uwagę na sposób wstawiania danych liczbowych i tekstowych 
 
 

  Wstawianie wierszy z wartością NULL 

 

 

  Wstawianie specjalnych wartości 

 

 
 

background image

3 / 9 

The TO_DATE function 

 

 
 

  Tworzenie skryptu 

 

 
 

  Kopiowanie wierszy z innych tabel 

 
 

 

 

 
 

  Składnia polecenia UPDATE 

 
 

 

 
 

background image

4 / 9 

 
 
 
 
 

  Zmiana danych w tabeli (jeden i wiele wierszy) 

 
 

 

 
 
 
 

  Aktualizacja dwóch wierszy z zastosowaniem pod-zapytań 

 

 

 
 

background image

5 / 9 

  Aktualizacja wierszy – bazowanie na innej tabeli 

 

 

 

  Najczęstsze błędy polecenia UPDATE 

 
 

 

 

  Składnia polecenia DELETE 

 
 

 

 
 
 
 
 
 
 
 
 

background image

6 / 9 

  Usuwanie wierszy z tabeli 

 
 

 

  Usuwanie wierszy – bazowanie na innej tabeli 

 
 

 

 

  Najczęstsze błędy polecenia DELETE 

 
 

 

 
 
 

background image

7 / 9 

  Użycie pod-zapytań w poleceniu INSERT 

 

 

 

 
 
 
 
 
 
 
 

 

2. HR Schema 

 

 

 
 
 
 
 
 

background image

8 / 9 

3. Exercises 

 

Insert data into the EMPLOYEE_NRINDEKSU table.

 

 
1. Run the statement in the sql script to build the EMPLOYEE_NRINDEKSU table that will be 
used for the lab. 

 

2. 

Describe the structure of EMPLOYEE_NRINDEKSU the table to identify the column names. 

 

 

 
 
 
 
3.

 Add the first row of data to the EMPLOYEE_NRINDEKSU table from the following sample data. 

Do not list the columns in the INSERT clause.

 

 

 

4. Populate the EMPLOYEE_ NRINDEKSU table with the rows (of sample data) from the preceding 
list. This time, list the columns explicitly in the INSERT clause.

 

 

5. Confirm your addition to the table.

 

 

Update and delete data in the EMPLOYEE_NRINDEKSU table. 
 
1. Change the last name of employee 3 to Drexler. 
 
2. Change the salary to 1000 for all employees with a salary less than 900. 
 

background image

9 / 9 

3. Verify your changes to the table. 

 

 
4. Delete Betty Dancs from the EMPLOYEE_NRINDEKSU table. 
 
5. Confirm your changes to the table.

 

 

 

 

6. Commit all pending changes. 
 

COMMIT; 
 
 

7.Create the DEPT_ NRINDEKSU table based on the following table instance chart.

 

 

8. 

Populate the DEPT_ NRINDEKSU table with data from the DEPARTMENTS table. Include only 

columns that you need.