ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 09.12.2023

Просмотров: 45

Скачиваний: 1

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

сгенерированный DDL-скрипт

-- predefined type, no DDL - MDSYS.SDO_GEOMETRY

-- predefined type, no DDL - XMLTYPE

CREATE TABLE predmet

(

kod_predmeta NUMBER(4) NOT NULL,

nazvanie VARCHAR2(30),

"Ob" yem_lektsiy" CHAR (10) ,

"Ob"yem_praktik" CHAR (10) ,

"Ob "yem_laboratornykh_rabot" CHAR(10) );

ALTER TABLE predmet ADD CONSTRAINT predmet_pk PRIMARY KEY ( kod_predmeta );

CREATE TABLE razvitie_postanoki (

razvitie_postanoki_id NUMBER NOT NULL,

chasy_rabot CHAR(10) NOT NULL,

-- ERROR: Column name length exceeds maximum allowed length(30)

"Fakul'tety_dlyashchiyesya_boleye_odnogo_semestra" VARCHAR2(30) NOT NULL

);

ALTER TABLE razvitie_postanoki ADD CONSTRAINT razvitie_postanoki_pk PRIMARY KEY ( razvitie_postanoki_id );

CREATE TABLE relation_2 (

student_kod_student NUMBER(4) NOT NULL,

-- ERROR: Column name length exceeds maximum allowed length(30)

ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id NUMBER NOT NULL

);

ALTER TABLE relation_2 ADD CONSTRAINT relation_2_pk PRIMARY KEY ( student_kod_student,

ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id );

CREATE TABLE relation_3 (

-- ERROR: Column name length exceeds maximum allowed length(30)

ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id NUMBER NOT NULL,

predmet_kod_predmeta NUMBER(4) NOT NULL

);

ALTER TABLE relation_3 ADD CONSTRAINT relation_3_pk PRIMARY KEY ( ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id,

predmet_kod_predmeta );

CREATE TABLE student (

kod_student NUMBER(4) NOT NULL,

fam VARCHAR2(30) NOT NULL,

ima VARCHAR2(30) NOT NULL,

otch VARCHAR2(30) NOT NULL,

adress VARCHAR2(50) NOT NULL,

tel VARCHAR2(10) NOT NULL

);

ALTER TABLE student ADD CONSTRAINT student_pk PRIMARY KEY ( kod_student );

CREATE TABLE ychebniy_plan (

-- ERROR: Column name length exceeds maximum allowed length(30)

razvitie_postanoki_razvitie_postanoki_id NUMBER NOT NULL,

kod_student NUMBER(4) NOT NULL,

kod_predmeta NUMBER(4) NOT NULL,

ochenka CHAR(10)

);

ALTER TABLE ychebniy_plan ADD CONSTRAINT ychebniy_plan_pk PRIMARY KEY ( razvitie_postanoki_razvitie_postanoki_id );

-- ERROR: UK name length exceeds maximum allowed length(30)

ALTER TABLE ychebniy_plan

ADD CONSTRAINT ychebniy_plan_kod_student_kod_predmeta_un UNIQUE ( kod_student,

kod_predmeta );

ALTER TABLE relation_2

ADD CONSTRAINT relation_2_student_fk FOREIGN KEY ( student_kod_student )

REFERENCES student ( kod_student );

ALTER TABLE relation_2

ADD CONSTRAINT relation_2_ychebniy_plan_fk FOREIGN KEY ( ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id )

REFERENCES ychebniy_plan ( razvitie_postanoki_razvitie_postanoki_id );

ALTER TABLE relation_3

ADD CONSTRAINT relation_3_predmet_fk FOREIGN KEY ( predmet_kod_predmeta )

REFERENCES predmet ( kod_predmeta );

ALTER TABLE relation_3

ADD CONSTRAINT relation_3_ychebniy_plan_fk FOREIGN KEY ( ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id )

REFERENCES ychebniy_plan ( razvitie_postanoki_razvitie_postanoki_id );

-- ERROR: FK name length exceeds maximum allowed length(30)

ALTER TABLE ychebniy_plan

ADD CONSTRAINT ychebniy_plan_razvitie_postanoki_fk FOREIGN KEY ( razvitie_postanoki_razvitie_postanoki_id )

REFERENCES razvitie_postanoki ( razvitie_postanoki_id );

CREATE SEQUENCE razvitie_postanoki_razvitie_po START WITH 1 NOCACHE ORDER;

CREATE OR REPLACE TRIGGER razvitie_postanoki_razvitie_po BEFORE

INSERT ON razvitie_postanoki

FOR EACH ROW

WHEN ( new.razvitie_postanoki_id IS NULL )

BEGIN

:new.razvitie_postanoki_id := razvitie_postanoki_razvitie_po.nextval;

END;

/

-- Oracle SQL Developer Data Modeler Summary Report:

--

-- CREATE TABLE 6

-- CREATE INDEX 0

-- ALTER TABLE 12

-- CREATE VIEW 0


-- ALTER VIEW 0

-- CREATE PACKAGE 0

-- CREATE PACKAGE BODY 0

-- CREATE PROCEDURE 0

-- CREATE FUNCTION 0

-- CREATE TRIGGER 1

-- ALTER TRIGGER 0

-- CREATE COLLECTION TYPE 0

-- CREATE STRUCTURED TYPE 0

-- CREATE STRUCTURED TYPE BODY 0

-- CREATE CLUSTER 0

-- CREATE CONTEXT 0

-- CREATE DATABASE 0

-- CREATE DIMENSION 0

-- CREATE DIRECTORY 0

-- CREATE DISK GROUP 0

-- CREATE ROLE 0

-- CREATE ROLLBACK SEGMENT 0

-- CREATE SEQUENCE 1

-- CREATE MATERIALIZED VIEW 0

-- CREATE MATERIALIZED VIEW LOG 0

-- CREATE SYNONYM 0

-- CREATE TABLESPACE 0

-- CREATE USER 0

--

-- DROP TABLESPACE 0

-- DROP DATABASE 0

--

-- REDACTION POLICY 0

--

-- ORDS DROP SCHEMA 0

-- ORDS ENABLE SCHEMA 0

-- ORDS ENABLE OBJECT 0

--

-- ERRORS 6

-- WARNINGS 0

Приложение Б

Отредактированный под My SQL DDL-скрипт

-- Generated by Oracle SQL Developer Data Modeler 20.2.0.167.1538
-- at: 2022-12-16 12:35:34 MSK
-- site: Oracle Database 11g
-- type: Oracle Database 11g

-- predefined type, no DDL - MDSYS.SDO_GEOMETRY

-- predefined type, no DDL - XMLTYPE

CREATE TABLE predmet
(
kod_predmeta integer(4) NOT NULL,
nazvanie VARCHAR(30),
Ob_yem_lektsiy CHAR (10) ,
Obyem_praktik CHAR (10) ,
Obyem_laboratornykh_rabot CHAR(10) );

ALTER TABLE predmet ADD CONSTRAINT predmet_pk PRIMARY KEY ( kod_predmeta );

CREATE TABLE razvitie_postanoki (
razvitie_postanoki_id integer NOT NULL,
chasy_rabot CHAR(10) NOT NULL,
-- ERROR: Column name length exceeds maximum allowed length(30)
Fakultety_dlyashchiyesya_boleye_odnogo_semestra VARCHAR(30) NOT NULL
);

ALTER TABLE razvitie_postanoki ADD CONSTRAINT razvitie_postanoki_pk PRIMARY KEY ( razvitie_postanoki_id );

CREATE TABLE relation_2 (
student_kod_student integer(4) NOT NULL,
-- ERROR: Column name length exceeds maximum allowed length(30)
ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id integer NOT NULL
);

ALTER TABLE relation_2 ADD CONSTRAINT relation_2_pk PRIMARY KEY ( student_kod_student,
ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id );

CREATE TABLE relation_3 (
-- ERROR: Column name length exceeds maximum allowed length(30)
ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id integer NOT NULL,
predmet_kod_predmeta integer(4) NOT NULL
);

ALTER TABLE relation_3 ADD CONSTRAINT relation_3_pk PRIMARY KEY ( ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id,
predmet_kod_predmeta );

CREATE TABLE student (
kod_student integer(4) NOT NULL,
fam VARCHAR(30) NOT NULL,
ima VARCHAR(30) NOT NULL,
otch VARCHAR(30) NOT NULL,
adress VARCHAR(50) NOT NULL,
tel VARCHAR(10) NOT NULL
);

ALTER TABLE student ADD CONSTRAINT student_pk PRIMARY KEY ( kod_student );

CREATE TABLE ychebniy_plan (
-- ERROR: Column name length exceeds maximum allowed length(30)
razvitie_postanoki_razvitie_postanoki_id integer NOT NULL,
kod_student integer(4) NOT NULL,
kod_predmeta integer(4) NOT NULL,
ochenka CHAR(10)
);

ALTER TABLE ychebniy_plan ADD CONSTRAINT ychebniy_plan_pk PRIMARY KEY ( razvitie_postanoki_razvitie_postanoki_id );


-- ERROR: UK name length exceeds maximum allowed length(30)
ALTER TABLE ychebniy_plan
ADD CONSTRAINT ychebniy_plan_kod_student_kod_predmeta_un UNIQUE ( kod_student,
kod_predmeta );

ALTER TABLE relation_2
ADD CONSTRAINT relation_2_student_fk FOREIGN KEY ( student_kod_student )
REFERENCES student ( kod_student );



ALTER TABLE relation_2
ADD CONSTRAINT relation_2_ychebniy_plan_fk FOREIGN KEY ( ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id )
REFERENCES ychebniy_plan ( razvitie_postanoki_razvitie_postanoki_id );

ALTER TABLE relation_3
ADD CONSTRAINT relation_3_predmet_fk FOREIGN KEY ( predmet_kod_predmeta )
REFERENCES predmet ( kod_predmeta );

ALTER TABLE relation_3
ADD CONSTRAINT relation_3_ychebniy_plan_fk FOREIGN KEY ( ychebniy_plan_razvitie_postanoki_razvitie_postanoki_id )
REFERENCES ychebniy_plan ( razvitie_postanoki_razvitie_postanoki_id );

-- ERROR: FK name length exceeds maximum allowed length(30)
ALTER TABLE ychebniy_plan
ADD CONSTRAINT ychebniy_plan_razvitie_postanoki_fk FOREIGN KEY ( razvitie_postanoki_razvitie_postanoki_id )
REFERENCES razvitie_postanoki ( razvitie_postanoki_id );

-- CREATE SEQUENCE razvitie_postanoki_razvitie_po START WITH 1 NOCACHE ORDER;

-- CREATE OR REPLACE TRIGGER razvitie_postanoki_razvitie_po BEFORE
-- INSERT ON razvitie_postanoki
-- FOR EACH ROW
-- WHEN ( new.razvitie_postanoki_id IS NULL )
BEGIN
-- :new.razvitie_postanoki_id := razvitie_postanoki_razvitie_po.nextval;
-- END;
-- /

-- Oracle SQL Developer Data Modeler Summary Report:
--
-- CREATE TABLE 6
-- CREATE INDEX 0
-- ALTER TABLE 12
-- CREATE VIEW 0
-- ALTER VIEW 0
-- CREATE PACKAGE 0
-- CREATE PACKAGE BODY 0
-- CREATE PROCEDURE 0
-- CREATE FUNCTION 0
-- CREATE TRIGGER 1
-- ALTER TRIGGER 0
-- CREATE COLLECTION TYPE 0
-- CREATE STRUCTURED TYPE 0
-- CREATE STRUCTURED TYPE BODY 0
-- CREATE CLUSTER 0
-- CREATE CONTEXT 0
-- CREATE DATABASE 0
-- CREATE DIMENSION 0
-- CREATE DIRECTORY 0
-- CREATE DISK GROUP 0
-- CREATE ROLE 0
-- CREATE ROLLBACK SEGMENT 0
-- CREATE SEQUENCE 1
-- CREATE MATERIALIZED VIEW 0
-- CREATE MATERIALIZED VIEW LOG 0
-- CREATE SYNONYM 0
-- CREATE TABLESPACE 0
-- CREATE USER 0
--
-- DROP TABLESPACE 0
-- DROP DATABASE 0
--
-- REDACTION POLICY 0
--
-- ORDS DROP SCHEMA 0
-- ORDS ENABLE SCHEMA 0
-- ORDS ENABLE OBJECT 0
--
-- ERRORS 6
-- WARNINGS 0