The first link is the problems.

I am very inexperienced in SQLite and needed some help.

Thanks in advance!

https://imgur.com/v7BdVe3

These are all the tables displayed open

https://imgur.com/a/VMOxAuc

https://imgur.com/a/LrDcCBQ

The schema

https://imgur.com/a/bv5KTHN

This is as far as I could get which is close but I couldn't figure out how to sort it also by marina 1.

SELECT BOAT_NAME, OWNER.OWNER_NUM, LAST_NAME, FIRST_NAME from OWNER inner join MARINA_SLIP on OWNER.OWNER_NUM = MARINA_SLIP.OWNER_NUM;

If you know anything else bout the other questions feel free to help me with those too, Thanks!

1 Answers

0
MikeT On

I believe that you want

SELECT BOAT_NAME, OWNER.OWNER_NUM, LAST_NAME, FIRST_NAME 
FROM OWNER INNER JOIN MARINA_SLIP ON OWNER.OWNER_NUM = MARINA_SLIP.OWNER_NUM 
WHERE MARINA_NUM = 1 
ORDER BY BOAT_NAME;

The second question involves multiple joins.

The third question asks you to use the count(*) function, noting that this is an aggregate function and will result in the number of rows for the GROUP as per the GROUP BY clause (if no GROUP BY clause then there is just the one GROUP i.e. all resultant rows).

The fourth question progresses a little further asking you to extend the GROUP BY clause with the HAVING clause (see link above for GROUP BY).