SQL query: how to get the names of the sailors who have the same number of reservations

by Carl   Last Updated November 08, 2018 23:26 PM

For the following database schema, I want to get the names of the sailors who have the same amount of reservations.

create table Sailors 
    (id integer primary key, 
     name text, 
     rating integer, 
     age integer)

create table Boats
    (id integer primary key, 
     name text, 
     color text)

create table Reserves 
    (sid integer, 
     bid integer, 
     day date, 
     primary key (sid, day) 
     foreign key (sid) references Sailors(id)
     foreign key (bid) references Boats(id))
Tags : sql


Related Questions