I have three tables:
computers, which has columns for id, serial number, make, model, etc users, which has columns for id, real name computer_usage, which has columns id, computer_id, user_id, start_date, end_date
The database records all computers that we have, our users, and who used what computer when.
I want to run a query that selects all computers that do not have a current user.
This would be:
There is a computer_id that doesn't exist at all within computer_usage or There is a computer_id that does exist within computer_usage that has an end_date ofWhat is the best way of selecting those records?