QuestionQ100
Prepare dataYou have a Fabric workspace containing a warehouse named Warehouse1. Warehouse1 contains the following data.

Create a T-SQL statement that denormalizes the tables and includes the ContractType and StartDate attributes in the results. The solution must:
- Include attributes from matching Contract-table rows.
- Preserve every row from the Employee table.
- Return the total employee count per contract type for all contract types with more than two employees.
How should you complete the statement?
Select
WITH result AS( SELECT e.EmployeeID , e.EmployeeName , e.EmployeePosition , c.ContractType FROM Employee AS e Contract AS c on c.EmployeeID = e.EmployeeID) SELECT COUNT(DISTINCT EmployeeID) AS TotalEmployees, ContractType FROM result GROUP BY ContractType COUNT(DISTINCT EmployeeID) > 2
Community Discussion