TASK #130 · Medium · GlowByteNumber of contracts per company
Your brief
Given a database with information about companies and their contracts.
The Company table stores company information,
the Contract table stores contract information,
the Company_contract table stores relations between companies and their contracts.
Show the number of contracts per each company, including companies without contracts (0 for them). The result should contain company name (company_name) and contract count (contract_count).
Show the number of contracts per each company, including companies without contracts (0 for them). The result should contain company name (company_name) and contract count (contract_count).
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
Companycompany_id, company_nameContractcontract_id, contract_numberCompany_contractcompany_id, contract_id