3,087 views
2 votes
2 votes

Find SQL :-

(Q17) Compute increments for the ratings of persons who have sailed two different boats on the same day.

(Q18) Find the ages of sailors whose name begins and ends with B and has at least three characters.

2 Answers

Best answer
2 votes
2 votes

For first question....

1.SELECT rating+1 FROM Sailor WHERE sid IN (SELECT sid FROM R2 GROUP BY date,sid HAVING COUNT(*)=2)

and for second....

 @akash.dinkar12 comments

selected by
1 votes
1 votes
Q18> select S.age from sailors S where sname LIKE 'b_%b';

NOTE: if asked atleast 2 characters = 'b%b'  , if asked exactly 3 characters, 'b_b'

Related questions

5 votes
5 votes
2 answers
1
Rishi yadav asked Sep 7, 2017
5,080 views
Find the names of sailors who have reserved a red or a green boat.???& Find the names of sailors who have reserved at least two boats?
1 votes
1 votes
0 answers
2
Prince Sindhiya asked Oct 27, 2018
581 views
SELECT sname FROM s WHERE NOT EXISTS ( SELECT * FROM b WHERE NOT EXISTS ( SELECT * FROM r WHERE r.sid=s.sid AND r.bid=b.bid))how to understand these query please explain
1 votes
1 votes
3 answers
3
aditi19 asked May 18, 2019
1,260 views
Class(name, meets_at, room, fid)Faculty(fid, fname, deptid)Find the names of faculty members who teach in every room in which some class is taught