SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE clients ( id number(10) primary key, name varchar2(1000), place_of_birth varchar2(1000), date_of_birth date, address varchar2(1000), passport varchar2(100) ); CREATE TABLE products ( id number(10) primary key, product_type_id number(10), name varchar2(100), client_ref number(10), open_date date, close_date date, CONSTRAINT prod_cl_fk FOREIGN KEY (client_ref) REFERENCES clients(id), CONSTRAINT prod_prodtype_fk FOREIGN KEY (product_type_id) REFERENCES product_type(id) ); CREATE TABLE product_type ( id number(10) primary key, name varchar2(100) begin_date date, end_date date, tarif_ref number(10), CONSTRAINT product_type_fk FOREIGN KEY (tarif_ref) REFERENCES tarifs(id) ); CREATE TABLE accounts ( id number(10) primary key, name varchar2(100), saldo number(10,2), client_ref number(10), open_date date, close_date date, product_ref number(10), acc_num varchar2(25), CONSTRAINT acc_cl_fk FOREIGN KEY (client_ref) REFERENCES clients(id), CONSTRAINT acc_prod_fk FOREIGN KEY (product_ref) REFERENCES products(id) ); CREATE TABLE records ( id number(10) primary key, dt number(1), sum(number(10,2), acc_ref number(10), oper_date date, CONSTRAINT rec_acc_fk FOREIGN KEY (acc_ref) REFERENCES accounts(id) ); CREATE TABLE tarifs ( id number(10) primary key, name varchar2(100), cost number (10,2) );

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear