-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExecFunc.sql
77 lines (51 loc) · 1.14 KB
/
ExecFunc.sql
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use DRIVER_SERVICE
select * from person
delete from person where person.ssn = '087472489'
select * from account where account.ssn = '087472489'
create TABLE test(
num int,
numx int identity(1,1)
);
alter table test
alter column num int not null;
ALTER TABLE test
alter table test add constraint PK_Test primary key(num);
insert into test
values (1)
insert into test
values (2)
insert into test
values (3)
create table test2 (
t2num int
foreign key (t2num) references test(num)
on delete cascade
on update cascade
);
alter table test2 add constraint FK_t2num2
foreign key (t2num) references test(num)
on delete cascade
on update cascade
select * from test2
insert into test2
values (3)
drop table test2
delete from test where num = 3
update test set num = 100 where num = 3
drop table test2
drop table test
/*
SELECT * FROM
(SELECT CUSTOMER_SEND.SSN, PRICE_RATIO.RATIO
FROM CUSTOMER_SEND
JOIN PRICE_RATIO ON CUSTOMER_SEND.SERVICE = PRICE_RATIO.SERVICE_CUSTOMER)
AS TEMP WHERE TEMP.SSN = 182835988;
create TABLE test(
num int,
numx int identity(1,1)
);
drop table test
insert into test
values (2)
select * from test
*/