create table Employee
(
FirstName varchar(50),
LastName varchar(50),
salary money,
comm float,
AnualSal money,
TotalSalary money
)
drop table Employee
insert into Employee(FirstName,LastName,salary,comm)values('mithilesh','kumar',8000,0.5)
insert into Employee(FirstName,LastName,salary,comm)values('rakesh','kumar',5000,0.7)
insert into Employee(FirstName,LastName,salary,comm)values('mithilesh','kumar',9000,0.9)
insert into Employee(FirstName,LastName,salary)values('rohit','kumar',1100)
insert into Employee(FirstName,LastName,salary)values('sahil','kumar',13000)
select * from Employee
select FirstName,AnualalSalary=(salary*12)*ISNULL(comm,1),totalsalary=(salary*12)+ISNULL(comm,0) from Employee
Output:
No comments:
Post a Comment