What is a DBMS
What a DBMS is and why you need one
A DBMS is the software layer between your application and physical storage. Instead of writing files from PHP, the app sends SQL to a server that enforces structure, concurrency, and data integrity.
In hotel_db the DBMS holds gosti, sobe, rezervacije, and placanja. Reception checks availability while finance records payments. MySQL is popular; PostgreSQL and Oracle solve similar problems. 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
The DBMS does not replace PHP business logic — it is where state stays consistent. Transactions, indexes, privileges, and backups are built in. In Workbench run the sample SQL on test data before production, check EXPLAIN as tables grow, and document expected results for teammates.
Key points
- Data lives in tables with rows and columns. — hotel_db example.
- The DBMS manages concurrent access. — hotel_db example.
- SQL is the standard query language. — hotel_db example.
- Examples: MySQL, MariaDB, PostgreSQL. — hotel_db example.
- Apps talk through the DBMS. — hotel_db example.
Practical example
Returns active guests.
SELECT ime, email FROM gosti WHERE aktivan = 1;Common mistake
Treating Workbench or phpMyAdmin as the database — they are clients. Typical fallout: mismatched reception vs finance data, lost reservations, or blocked check-ins at peak season — always backup before production DDL/DML.
Summary
The DBMS mediates: learn SQL to work reliably with hotel_db. 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.
