SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE DEPARTMENT ( id number not null, name varchar2(100) not null ); create unique index department_pk on department(id); alter table department add constraint department_pk primary key(id); CREATE TABLE EMPLOYEE ( id number not null, department_id number, chief_id number, name varchar2(100) not null, salary number ); create unique index employee_pk on employee(id); create index employee_fk1 on street(department_id); create index employee_fk2 on street(id); alter table EMPLOYEE add constraint EMPLOYEE_pk primary key(id); alter table EMPLOYEE add constraint fk_EMPLOYEE foreign key (department_id) references department(id); select * from DEPARTMENT; select * from EMPLOYEE;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear