-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclass5.sql
More file actions
61 lines (47 loc) · 1.08 KB
/
class5.sql
File metadata and controls
61 lines (47 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
select count(*) from student
select * from student
create proc proc2 @reg int, @name nvarchar(50),@address nvarchar(50),@num int output
as
begin
declare @n int
insert into student values(@reg,@name,@address)
set @num=(select count(*) from student)
set @n=(select count(*) from student)
if(@n>10)
begin
select * from student
end
else
begin
select * from marks
end
select * from student
end
create proc proc3
as
begin
select * from student
end
exec proc3
declare @n int
exec proc2 10,'adil','mednipur',@num=@n output
select @n
alter proc proc4
as
begin
declare @num int
set @num=1
while(@num<10)
begin
insert into student values(@num,'abc','xyz')
set @num=@num+1
end
end
exec proc4
select * from student
create database dbna
drop database dbna
select * from student where regno is not null
select * from student where regno is null
insert into student(name,address) values('wadil','xyz')
select ROW_NUMBER() over(order by regno) as 'SI NO', regno,name, address from student