Beyond numbers and text, the Library needs a few drawers with a special purpose. Get to know them so your shelves describe the world precisely.
2024-03-15. Ideal for data_wypozyczenia or data_zwrotu.2024-03-15 14:30:00. Use it when the exact moment matters, e.g. data_logowania.Remember: if the day alone is enough - DATE. If you also need the clock - DATETIME.
dostepna:1dostepna BOOLEAN DEFAULT TRUEIn MySQL
TRUE is 1 and FALSE is 0 - but you can write it in human terms.1stan ENUM('nowy', 'uzywany', 'zniszczony')A copy can only be new, used or destroyed - MySQL will accept nothing else. It is a guard that lets no random values in.
1CREATE TABLE egzemplarze (
2 id INT AUTO_INCREMENT PRIMARY KEY,
3 data_zakupu DATE,
4 dostepna BOOLEAN DEFAULT TRUE,
5 stan ENUM('nowy', 'uzywany', 'zniszczony')
6);The purchase date, availability and state - each drawer matched to its content.