1 echo CREATE TABLE t1
(f1 int
,f2 int
,primary key
(f1
));
3 echo CREATE TABLE t2
(f3 int
,f4 int
,primary key
(f4
),foreign key
(f3
) references t1
(f1
));
5 echo CREATE TABLE t3
(f5 int
,f6 int
,foreign key
(f5
) references t2
(f4
));
7 echo INSERT INTO t1 values
(1,10);
8 Statement Executed
: Rows Affected
= 1
9 echo INSERT INTO t1 values
(2,20);
10 Statement Executed
: Rows Affected
= 1
11 echo INSERT INTO t2 values
(1,100);
12 Statement Executed
: Rows Affected
= 1
13 echo INSERT INTO t2 values
(1,200);
14 Statement Executed
: Rows Affected
= 1
15 echo INSERT INTO t2 values
(2,300);
16 Statement Executed
: Rows Affected
= 1
17 echo INSERT INTO t3 values
(100,1000);
18 Statement Executed
: Rows Affected
= 1
19 echo INSERT INTO t3 values
(100,1000);
20 Statement Executed
: Rows Affected
= 1
21 echo INSERT INTO t3 values
(200,1000);
22 Statement Executed
: Rows Affected
= 1
23 echo INSERT INTO t3 values
(200,1000);
24 Statement Executed
: Rows Affected
= 1
25 echo SELECT
* FROM t1
;
26 ---------------------------------------------------------
28 ---------------------------------------------------------
32 echo SELECT
* FROM t2
;
33 ---------------------------------------------------------
35 ---------------------------------------------------------
40 echo SELECT
* FROM t3
;
41 ---------------------------------------------------------
43 ---------------------------------------------------------
49 echo INSERT INTO t2 values
(3,100);
50 Statement execute failed with error
-34
51 echo INSERT INTO t3 values
(400,1000);
52 Statement execute failed with error
-34
53 echo SELECT
* FROM t1
;
54 ---------------------------------------------------------
56 ---------------------------------------------------------
60 echo SELECT
* FROM t2
;
61 ---------------------------------------------------------
63 ---------------------------------------------------------
68 echo SELECT
* FROM t3
;
69 ---------------------------------------------------------
71 ---------------------------------------------------------
77 echo UPDATE t3 SET f5
=400 where f5
=200;
78 Statement execute failed with error
-34
79 echo UPDATE t1 SET f1
=3 where f1
=2;
80 Statement prepare failed with error
-21
81 echo UPDATE t2 SET f4
=400 where f5
=200;
82 Statement prepare failed with error
-21
83 echo UPDATE t3 SET f5
=300 where f5
=200;
84 Statement Executed
: Rows Affected
= 2
85 echo SELECT
* FROM t1
;
86 ---------------------------------------------------------
88 ---------------------------------------------------------
92 echo SELECT
* FROM t2
;
93 ---------------------------------------------------------
95 ---------------------------------------------------------
100 echo SELECT
* FROM t3
;
101 ---------------------------------------------------------
103 ---------------------------------------------------------
109 echo DELETE FROM t1 WHERE f1
=2;
110 Statement execute failed with error
-35
111 echo DELETE FROM t2 where f4
=200;
112 Statement Executed
: Rows Affected
= 1
113 echo DELETE FROM t3 WHERE f5
=300;
114 Statement Executed
: Rows Affected
= 2
115 echo SELECT
* FROM t1
;
116 ---------------------------------------------------------
118 ---------------------------------------------------------
122 echo SELECT
* FROM t2
;
123 ---------------------------------------------------------
125 ---------------------------------------------------------
129 echo SELECT
* FROM t3
;
130 ---------------------------------------------------------
132 ---------------------------------------------------------
136 echo DELETE FROM t2 where f4 IN
(200,300,400);
137 Statement Executed
: Rows Affected
= 1
138 echo DELETE FROM t1 WHERE f1
=2;
139 Statement Executed
: Rows Affected
= 1
140 echo SELECT
* FROM t1
;
141 ---------------------------------------------------------
143 ---------------------------------------------------------
146 echo SELECT
* FROM t2
;
147 ---------------------------------------------------------
149 ---------------------------------------------------------
152 echo SELECT
* FROM t3
;
153 ---------------------------------------------------------
155 ---------------------------------------------------------