Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Submitted To:
Shaila Sharmeen
Assistant Professor
Department of CSE
Submitted by:
Kazi Saymatul Jannat
ID: 2013-2-60-018
Introduction:
For Dept:
create table Deptt
(
dept_id int not null,
dept_name varchar(20),
primary key (dept_id),
)
insert into Deptt values (60,'CSE')
insert into Deptt values (10,'BBA')
insert into Deptt values (80,'EEE')
insert into Deptt values (40,'ETE')
insert into Deptt values (50,'ECE')
select *from Deptt
For instructor:
create table Instructor
(
idint not null,
ins_name varchar(20),
salary int,
primary key(id),
)
insert
insert
insert
insert
insert
insert
insert
insert
insert
insert
insert
into
into
into
into
into
into
into
into
into
into
into
Instructor
Instructor
Instructor
Instructor
Instructor
Instructor
Instructor
Instructor
Instructor
Instructor
Instructor
values
values
values
values
values
values
values
values
values
values
values
(101,'ABC',44000)
(102,'XYZ',66000)
(103,'ASD',101871)
(201,'EFG',40000)
(202,'MNO',60000)
(301,'HIJ',88000)
(302,'LMN',44000)
(401,'PQR',60000)
(402,'FGH',50000)
(501,'GHL',40000)
(502,'XCV',60000)
Output:
Answer:
declare @salary int
select @salary =dbo.getSalary1(103)
if @salary >=50000
begin
update Instructor set salary= @salary *1.05 where id =103
end
else
begin
update Instructor set salary =@salary*1.1 where id=103
end
Output:
Discussion: