Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
EmployeeDetails
create table EmployeeDetails ( empid int, fullname varchar(25), mngrid int, dateofjoining date ) insert into EmployeeDetails values(101,'Ankush Taneja',321,'01/31/2014') insert into EmployeeDetails values(121,'Eksha Jain',986,'01/06/2015') insert into EmployeeDetails values(421,'Shubham Dabra',876,'09/07/2018') select * from EmployeeDetails create table EmployeeSalary( empid int, project varchar(10), salary int ) insert into EmployeeSalary values(101,'P1',8000) insert into EmployeeSalary values(121,'P2',10000) insert into EmployeeSalary values(421,'P1',12000) select * from EmployeeSalary select count(empid) Employee_Count , project from EmployeeSalary where project = 'P1' group by project select fullname from EmployeeDetails ED join EmployeeSalary ES on ED.empid=ES.empid where salary between 5000 and 10000 select count(*) Employee_Count , project from EmployeeSalary group by project order by Employee_Count asc select SUBSTRING(fullname,0,charindex(' ',fullname)) FIRSTNAME from EmployeeDetails
run
|
edit
|
history
|
help
0
SqlServer1282018
Create Date Batches from Date Range - SQL Server
Chaudhary
Practice
Alquileres
Using varaible
Demo
PIVOT AND UNPIVOT USING XML PARSING
Select empID whose salary is greater than their managers
TSQL - Unique string generator