Answers for "how to count foreign keys in sql table"

SQL
0

sql count total by foreign key

SELECT books.*, count(orders.book_id) as number_of_orders        
from books
left join orders
on (books.book_id = orders.book_id)
group by
    books.book_id
Posted by: Guest on August-18-2021

Code answers related to "how to count foreign keys in sql table"

Code answers related to "SQL"

Browse Popular Code Answers by Language