Solutions

EspaƱol

P03.001- Execute the following:
create table T1(a int,b int,c int,
primary key(a)) engine=innodb;
create table T2(a int,d int,e int,
primary key(d),foreign key(a) references T1(a)) engine=innodb;
and check, looking for the reason it fails, the result of the following statements:
a)insert in T1(1,10,100)
b)insert in T1(NULL,20,NULL)
c)insert in T1(2,20,NULL)
d)insert in T1(3,NULL,300)
e)insert in T2(2,NULL,NULL)
f) Insert in T2(2,20,NULL)
g) Insert in T1(1,20,200)
h) Insert in T2(4,10,100)
i) Insert in T2(2,30,230)



P03.002- Continue the previous
j) update T1(1,10,10) to (2,10,100)
k) update T1(1,1,100) to (5,10,100)
l) update T2(2,2,NULL) to (2,20,220)
m) update T2(2,2,220) to (5,20,220)
n) update T2(5,0,220) to (2,10,100)
o) update T1(2,2,NULL) to (6,60,600)
p)update T1(3,NULL,300) to (7,70,700)
q) update T2(2,10,00) to (7,10,100)
r) update T2(2,3,230) to (7,30,230)
s) update T1(2,0,NULL) to (6,60,600)



P03.003- Continue the previous
t) delete T2(7,30,230)
u) delete T1(7,70,700)
v) delete T1(5,10,100)
w) delete T2(7,10,100)
x) delete T1(7,70,700)
y) delete T1(6,60,600)



P03.004-



P03.005-



P03.006-



P03.007-



P03.008-



P03.009-



P03.010-



P03.011-



P03.012-



P03.013-



P03.014-



P03.015-