72. List sailors who have sailed on boats that have been sailed on by sailors with a rating above 8 and age above 30:
SELECTs.snameFROM Sailors sINNER JOIN Boats b ONs.sid=b.bidWHEREb.bidIN (SELECT bid FROM Sailors WHERE rating >8AND age >30);
73. Display boat names and the total count of sailors who are older than the average sailor age and have a rating above 7, ordered by count:
SELECTb.bname, COUNT(s.sid) AS sailor_countFROM Boats bLEFT JOIN Sailors s ONb.bid=s.sidWHEREs.age> (SELECTAVG(age) FROM Sailors) ANDs.rating>7GROUP BYb.bnameORDER BY sailor_count;
74. Retrieve sailors who have sailed on boats that have been sailed on by sailors with an age below 20 and rating above 6:
SELECTs.snameFROM Sailors sINNER JOIN Boats b ONs.sid=b.bidWHEREb.bidIN (SELECT bid FROM Sailors WHERE age <20AND rating >6);
75. List sailors who have sailed on boats that have been sailed on by sailors with a name starting with the letter “A”:
SELECTs.snameFROM Sailors sINNER JOIN Boats b ONs.sid=b.bidWHEREb.bidIN (SELECT bid FROM Sailors WHERE sname LIKE'A%');
76.Display boat names and the total count of sailors who are older than the average sailor age and have a rating above 6, ordered by count:
SELECTb.bname, COUNT(s.sid) AS sailor_countFROM Boats bLEFT JOIN Sailors s ONb.bid=s.sidWHEREs.age> (SELECTAVG(age) FROM Sailors) ANDs.rating>6GROUP BYb.bnameORDER BY sailor_count;
77. Retrieve sailors who have sailed on boats that have been sailed on by sailors with a name ending with the letter “y”:
SELECTs.snameFROM Sailors sINNER JOIN Boats b ONs.sid=b.bidWHEREb.bidIN (SELECT bid FROM Sailors WHERE sname LIKE'%y');
78. List sailors who have sailed on boats that have been sailed on by sailors with a name containing the substring “an”:
SELECTs.snameFROM Sailors sINNER JOIN Boats b ONs.sid=b.bidWHEREb.bidIN (SELECT bid FROM Sailors WHERE sname LIKE'%an%');
79. Display boat names and the total count of sailors who are younger than the average sailor age and have a rating above 5, ordered by count:
SELECTb.bname, COUNT(s.sid) AS sailor_countFROM Boats bLEFT JOIN Sailors s ONb.bid=s.sidWHEREs.age< (SELECTAVG(age) FROM Sailors) ANDs.rating>5GROUP BYb.bnameORDER BY sailor_count;
80. Retrieve sailors who have sailed on boats that have been sailed on by sailors with a name containing the substring “tho”:
SELECTs.snameFROM Sailors sINNER JOIN Boats b ONs.sid=b.bidWHEREb.bidIN (SELECT bid FROM Sailors WHERE sname LIKE'%tho%');