File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ Create table #temp_employee2 (
2+ EmployeeID int,
3+ JobTitle varchar(100),
4+ Salary int
5+ )
6+
7+ Select * From #temp_employee2
8+
9+ Insert into #temp_employee2 values (
10+ '1001', 'HR', '45000'
11+ )
12+
13+ Insert into #temp_employee2
14+ SELECT * From SQLTutorial..EmployeeSalary
15+
16+ Select * From #temp_employee2
17+
18+
19+
20+
21+ DROP TABLE IF EXISTS #temp_employee3
22+ Create table #temp_employee3 (
23+ JobTitle varchar(100),
24+ EmployeesPerJob int ,
25+ AvgAge int,
26+ AvgSalary int
27+ )
28+
29+
30+ Insert into #temp_employee3
31+ SELECT JobTitle, Count(JobTitle), Avg(Age), AVG(salary)
32+ FROM SQLTutorial..EmployeeDemographics emp
33+ JOIN SQLTutorial..EmployeeSalary sal
34+ ON emp.EmployeeID = sal.EmployeeID
35+ group by JobTitle
36+
37+ Select *
38+ From #temp_employee3
39+
40+ SELECT AvgAge * AvgSalary
41+ from #temp_employee3
42+
43+
44+
You can’t perform that action at this time.
0 commit comments