Assignment 4: DISTINCT , CASE
1. Please extract how many unique Portfolio Positions have funds assigned in the database, compare it to the total possible Portfolio Positions in Portfolio Positions table. How many portfolio positions are not “active”?
2. How many customers have at least 1 active Portfolio Position?
3. How many customers have funds on Portfolio Position: Cash Remaining (hint: check the ID of this position in Portfolio Positions table)? Use WHERE clause to filter the PortfolioPosition.
4. Please extract column Account ManagerID and CustomerAge and produce new column where in case Account ManagerID is 2, show Mellow, and if someone else show OTHER. Rename the new column as ‘Managers’. Sort the output by Age ascending order. What is the first result in this new column 'Managers'? (use Customers table)
>>Please format the SQL query using the best practices.
>>Input the answers of 1, 2,3,4 in https://forms.gle/BpCr8tBhX6Xx7Bow6
2. How many customers have at least 1 active Portfolio Position?
3. How many customers have funds on Portfolio Position: Cash Remaining (hint: check the ID of this position in Portfolio Positions table)? Use WHERE clause to filter the PortfolioPosition.
4. Please extract column Account ManagerID and CustomerAge and produce new column where in case Account ManagerID is 2, show Mellow, and if someone else show OTHER. Rename the new column as ‘Managers’. Sort the output by Age ascending order. What is the first result in this new column 'Managers'? (use Customers table)
>>Please format the SQL query using the best practices.
>>Input the answers of 1, 2,3,4 in https://forms.gle/BpCr8tBhX6Xx7Bow6
Last modified: Wednesday, 23 March 2022, 12:29 PM