MySQL Workbench
MySQL Workbench for hotel_db
Workbench is a visual client for modeling (EER), writing SQL, and administration. For hotel_db you will use SQL Editor for scripts and EER diagrams before implementation.
SQL Editor supports multiple tabs — e.g. hotel_schema.sql and join_vezbe.sql. Query results appear in a grid; EXPLAIN runs in the same window. In hotel_db reception, finance, and housekeeping share gosti, sobe, rezervacije, placanja, and zaposleni — every change must stay consistent for all app modules.
In depth
EER Diagram lets you draw gosti, sobe, rezervacije with FK links before CREATE TABLE. Forward Engineer generates SQL — review before executing. In Workbench run the sample SQL on test data before production, check EXPLAIN as tables grow, and document expected results for teammates.
Key points
- SQL Editor for queries. — hotel_db example.
- EER model before SQL. — hotel_db example.
- Server Administration. — hotel_db example.
- Import/Export schema. — hotel_db example.
- EXPLAIN in same tool. — hotel_db example.
Common mistake
Clicking in GUI only without versioned .sql files — hard to reproduce hotel_db elsewhere. Typical fallout: mismatched reception vs finance data, lost reservations, or blocked check-ins at peak season — always backup before production DDL/DML.
Summary
Workbench is the main tool to design and test hotel_db in this course. Practice again on hotel_db until you can explain every result row and tie it to hotel workflows (check-in, billing, reporting).
Note: Tip: keep versioned .sql scripts (hotel_schema.sql, seed.sql) in Git — reproducibility matters when several people work on the same hotel_db model.
Demo database hotel_db
Download the ready-made SQL dump hotel_db_demo.sql with schema and sample data (guests, rooms, reservations, payments, staff). Import it in MySQL Workbench (Server → Data Import) or phpMyAdmin (Import), or run: mysql -u root -p < hotel_db_demo.sql.
Vežba u Workbench-u
Prepišite SQL primer iz lekcije u novi query tab, prilagodite imena tabela i pokrenite. Posmatrajte plan u EXPLAIN kad upit koristi JOIN.
