I don’t have much experience with SQL and I’m pretty much lost when it comes to anything more advanced than simple INSERT/SELECT statements.
My scenario is this, I have the following two tables:
Games
{
int id, int finished
}
Submissions
{
int game_id,int user_id
}
And I want to query any id from Games where finished=0 and a specific user_id is not tied together with the id in mind in the Submissions table.
So in other words, I want to find a game that isn’t finished and a specific user haven’t played.
I know I can do this with multiple queries and logic (in java and jdbc if it matters), but I rather learn how to do it with pure SQL!
Thanks!
Or (If your RDBMS supports it)