Answer the question
In order to leave comments, you need to log in
Why is Create table not compatible with alter?
CREATE TABLE EMPLOYEES (
EMPLOYEE_ID NUMBER,
FIRSTNAME VARCHAR(20),
LASTNAME VARCHAR(20),
PATRONYMIC VARCHAR(20),
BIRTHDATE DATE,
MOBILENUM NUMBER(8) NOT NULL UNIQUE,
HOMENUM NUMBER(8) NOT NULL UNIQUE,
CONSTRAINT FIO_BITH UNIQUE(FIRSTNAME,LASTNAME,PATRONYMIC,BIRTHDATE)
);
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMPLOYEES_PK PRIMARY KEY(EMPLOYEE_ID);
ALTER TABLE EMPLOYEES
ADD CONSTRAINT FK_OBJECT
FOREIGN KEY(OBJECT_ID)
REFERENCES OBJECTS(OBJECT_ID);
CREATE TABLE OBJECTS (
OBJECT_ID NUMBER,
OBJECT_NAME VARCHAR(20),
OBJECT_SQUARE NUMBER(4),
OBJECT_COST NUMBER(6),
CONSTRAINT CHECK_COST_SQUARE
CHECK (OBJECT_COST > 0 AND OBJECT_SQUARE > 0)
);
ALTER TABLE OBJECTS
ADD CONSTRAINT OBECTS_PK PRIMARY KEY(OBJECT_ID);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question