I have a database with a player, tournament, and registration table. I need to query all players that played in 2 types (attributes) of tournaments
0
votes
2
answers
76
views
I currently have two tournaments that have matches. Wimbledon and Atlanta open which I have one as a grand slam and the other as a masters 1000, and I want to get the players who played in both
This is my code
Select distinct (first_name)
from player, player_registration, tournament
where tournament.tournament_id = player_registration.tournament_id
and player.player_id = player_registration.player_id
and player.player_id in
(Select player.player_id from tournament
where tourn_cat = "Masters 1000" and
tourn_cat ="Grand Slam" );
It works when it's just masters 1000 or grand slam but i can't figure out how to get them together. With this query, nothing shows up
I attached a photo of part of the database

Asked by zaria palmer
(1 rep)
Jan 1, 2023, 09:41 PM
Last activity: Jan 2, 2023, 08:50 PM
Last activity: Jan 2, 2023, 08:50 PM