14_yl
CREATE TABLE laenatud (
isikukood char(15) NOT NULL,
shiffer char(8) NOT NULL,
algus DATE DEFAULT SYSDATE,
lpp DATE,
CONSTRAINT andmed_fk FOREIGN KEY(isikukood) REFERENCES andmed(isikukood)
ON DELETE CASCADE,
CONSTRAINT raamatu_fk FOREIGN KEY(shiffer) REFERENCES raamatud(shiffer) ON
DELETE CASCADE);
select
table_name
from
tabs;
insert into andmed values (
'stanislav',
'tsvetajev',
'38609140224',
'kivila 46 - 38',
'55606991',
'[email protected]'
);
insert into raamatud values (
'00000001',
'php tutorial',
400,
10
);
insert into raamatud values (
'00000002',
'mysql tutorial',
450,
10
);
insert into raamatud values (
'00000003',
'html tutorial',
300,
10
);
insert into laenatud values (
'38609140224',
'00000003',
SYSDATE, to_date(
'2008/12/18:12:00:00AM',
'yyyy/mm/dd:hh:mi:ssam'));
SELECT
a.eesnimi,
a