خرید بک لینک

Vote count: 0

Writing a SQL statement to create a list of countries with the number of normal customers and corporate customers. So it should have 3 columns named, Country, Normal customer, and corporate customer. Country column includes all countries from the customer table. The Normal and corporate customer display the number of normal and the number of corporate customers respectively in each country. A corporate customer distinct by the existence of a company name in the Customer Table. If a country does not have any associated corporate customers, 0 will be displayed in the column corporate customer for that row.

The customer table contains – CustomerID, company, country 

Should look like 

Country | Normal Customer | Corporate Customer 
----------------------------------------------------------------

Japan     | 25                             | 2
Korea     | 23                             | 0

so far I have only got this but I just need to know If I'm sort of going in the right track, it's not complete yet.

SELECT  Country , company
 COUNT 
FROM Customer WHERE Company IS NOT NULL

asked 43 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 27 ارديبهشت 1395 ساعت: 15:10

صفحه بندی