The day of the great tidy-up has come, @name. A new crate of books has arrived, a few prices need correcting, and damaged scrolls must be taken off the shelves. This is your final project - in it you will combine everything you have learned at the Scribe's Desk.
Imagine you must carry out the following sequence of operations on the
biblioteka database:1INSERT INTO ksiazki (tytul, autor_id, rok_wydania, cena, dostepna)
2VALUES
3 ('Almagest', 5, 150, 89.90, 1),
4 ('Stozkowe', 6, -200, 64.50, 1);1INSERT INTO czytelnicy (imie, nazwisko, email, miasto, data_zapisu)
2VALUES ('Hypatia', 'z Aleksandrii', 'hypatia@biblioteka.aleksandria', 'Aleksandria', '2024-04-01');1UPDATE ksiazki
2SET cena = 99.90
3WHERE id = 5;1UPDATE ksiazki
2SET dostepna = 0
3WHERE cena > 100;1DELETE FROM ksiazki
2WHERE dostepna = 0;Notice that every
UPDATE and DELETE has its own WHERE clause. That is no accident - it is the scribe's discipline. Before each command, ask yourself: which exact rows do I want to change? - and write the matching condition.>, AND, OR.id counter.UPDATE and DELETE always with WHERE!Congratulations, @name! You have mastered the Scribe's Desk. The Library is now in your hands - treat this power with respect.