User cannot see his own reserved seats
What can the user see?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am working on Bus Seat Booking System. This is the table where I am storing the reserved seats data.
SELECT `id`, `SeatNumber`, `UserID`, `PlateNumber` FROM `seating`
//id is Primary Key
//UserID foreign key
//PlateNumber foreign key
I want an SQL Query that picks up results such that
Currently I have thought of a following query but it doesn't work fully on above conditions. Suggest some ideas.
SELECT SeatNumber from seating where UserID not in(1) or PlateNumber in('B6551');
Please or to participate in this conversation.