--Task 4.1
SELECT 
   17 - COUNT(DISTINCT PortfolioPositionsId) AS NrOfPositionsNotActive
FROM PortfolioAmounts;
-- Answer: 1 of the portfolio position ID is not active

--Task 4.2 Answer 85
SELECT 
	COUNT(DISTINCT customerid)
FROM PortfolioAmounts;

--Task 4.3 Ans: 46
SELECT 
	COUNT(DISTINCT customerid)
FROM PortfolioAmounts
WHERE portfoliopositionsid = 15;

--Task 4.4 Ans: Mellow
--What is the first result in this new column 'Managers'?
-- did you notice a small inconsistence here?
SELECT
AccountManagerID, CustomerAge,
CASE WHEN accountmanagerid = 2 THEN "Mellow" ELSE 'OTHER' END AS Managers
FROM Customers 
ORDER BY customerage ASC;

