Sobes.tech
Senior

SQL task 2: Find offices with available seats

sobes.tech AI

Answer from AI

To find offices with available seats, you need a table with information about offices and the number of occupied and maximum seats. For example, if there is a table offices with columns office_id, capacity (maximum capacity), and occupied (occupied seats), the query would be:

SELECT office_id, capacity, occupied, (capacity - occupied) AS free_spaces
FROM offices
WHERE capacity > occupied;

This query will return offices where the number of occupied seats is less than the capacity, meaning there are free seats. If the table structure is different, you need to adapt the query accordingly, the main thing is to compare capacity and occupancy.

SQL task 2: Find offices with available seats — QA /… - sobes.tech