SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE client_p (client_id number (20) primary key, name_client varchar2 (32), surname_client varchar2 (64), patronymic varchar2 (32), date_of_birth date, phone_number varchar2 (32), email varchar2 (64), address varchar2 (64) ); CREATE TABLE vehicle_m (car_number_v varchar2 (16) primary key, car_make varchar2 (32), car_model varchar2 (64), year_of_production number, mileage number, price_v number,city varchar2 (64), body_type varchar2 (32), transmission varchar2 (16), body_color varchar2 (32) ); CREATE TABLE contract (contract_id number primary key, date_con date, term_con number, advance_amount number, monthly_payment number, first_payment number, vechile_con varchar2 (16) NOT NULL, client_con number, last_payment_amount number, last_payment_date date, CONSTRAINT contract_vehicle_m_fk FOREIGN KEY (vechile_con) REFERENCES vehicle_m(car_number_v), CONSTRAINT contract_client_p_fk FOREIGN KEY (client_con) REFERENCES client_p(client_id) ); CREATE TABLE bought_vehicles (bought_vehicle_id number primary key, car_number_b varchar2(16) NOT NULL, ransom_amount number, date_bou date, CONSTRAINT bought_vehicles_vehicle_m_fk FOREIGN KEY (car_number_b) REFERENCES vehicle_m(car_number_v) ); CREATE TABLE crashes (crash_id number primary key, date_cr date, description_cr varchar2 (255), car_number_cr varchar2 (16), CONSTRAINT crashes_vehicle_m_fk FOREIGN KEY (car_number_cr) REFERENCES vehicle_m(car_number_v) ); CREATE TABLE repairs (repair_id number primary key, date_rep date, price number, car_number_rep varchar2 (16) NOT NULL, discription_rep varchar2 (255), CONSTRAINT repairs_vehicle_m_fk FOREIGN KEY (car_number_rep) REFERENCES vehicle_m(car_number_v) );

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear