Im having help running a query correctly in ssh. Im new to SQL so im only running basic queries.
I need to list each branc name, book type, and total number of books in stock by each branch and book type.
So im confused as to how to do a join, and to what the statement would look like. Since there are no relation between the two tables, should I create a join in the WHERE clause with a different table that doesn't relate to the statement?
Here is the table output with the Tables that relate to this question
BRANCH (Branch_number, Branch_name, branch_location, number_employees)
BOOK (Book_code, book_title, publisher_code, book_type, book_price, paperback)
INVENT (book_code, branch_number, units_on_hand)
How do I join two tables that have no relation? Should I use the invent table's foriegn keys?
MY statement so far is
SELECT COUNT(b. book_code) AS Total, br. branch_name, b. book_type
FROM book b, branch br
WHERE ?
ORDER BY ?
I need to list each branc name, book type, and total number of books in stock by each branch and book type.
So im confused as to how to do a join, and to what the statement would look like. Since there are no relation between the two tables, should I create a join in the WHERE clause with a different table that doesn't relate to the statement?
Here is the table output with the Tables that relate to this question
BRANCH (Branch_number, Branch_name, branch_location, number_employees)
BOOK (Book_code, book_title, publisher_code, book_type, book_price, paperback)
INVENT (book_code, branch_number, units_on_hand)
How do I join two tables that have no relation? Should I use the invent table's foriegn keys?
MY statement so far is
SELECT COUNT(b. book_code) AS Total, br. branch_name, b. book_type
FROM book b, branch br
WHERE ?
ORDER BY ?