Back to posts Edit this post
Copy content

16 Dec 13:14

SELECT '' AS ZADANIE16 FROM DUAL; CREATE SEQUENCE PRAC_SEQ START WITH 300 INCREMENT BY 10; SELECT '' AS ZADANIE17 FROM DUAL; INSERT INTO PRACOWNICY (ID_PRAC, ETAT, NAZWISKO, PLACA_POD) VALUES (PRAC_SEQ.NEXTVAL, 'STAZYSTA', 'TRĄBCZYŃSKI', '1000'); SELECT * FROM PRACOWNICY WHERE NAZWISKO = 'TRĄBCZYŃSKI'; SELECT '' AS ZADANIE18 FROM DUAL; UPDATE PRACOWNICY SET PLACA_DOD = PRAC_SEQ.CURRVAL WHERE NAZWISKO = 'TRĄBCZYŃSKI'; SELECT * FROM PRACOWNICY WHERE NAZWISKO = 'TRĄBCZYŃSKI'; SELECT '' AS ZADANIE19 FROM DUAL; DELETE FROM PRACOWNICY WHERE NAZWISKO = 'TRĄBCZYŃSKI'; CREATE SEQUENCE MALA_SEQ START WITH 9 INCREMENT BY 1 MAXVALUE 10; SELECT '' AS ZADANIE20 FROM DUAL; UPDATE PRACOWNICY SET PLACA_DOD = MALA_SEQ.NEXTVAL WHERE NAZWISKO = 'SLOWINSKI'; UPDATE PRACOWNICY SET PLACA_DOD = MALA_SEQ.NEXTVAL WHERE NAZWISKO = 'SLOWINSKI'; UPDATE PRACOWNICY SET PLACA_DOD = MALA_SEQ.NEXTVAL WHERE NAZWISKO = 'SLOWINSKI'; SELECT * FROM MALA_SEQ; SELECT '' AS ZADANIE21 FROM DUAL; DROP SEQUENCE MALA_SEQ; DROP SEQUENCE PRAC_SEQ; ROLLBACK

No files