Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create extension if not exists "uuid-ossp";
- create table engine
- (
- id uuid default uuid_generate_v4() not null
- constraint engine_pkey
- primary key,
- name varchar(150) not null,
- date_created timestamp not null,
- type varchar(20) not null
- );
- create table car
- (
- id uuid default uuid_generate_v4() not null
- constraint car_pkey
- primary key,
- brand varchar(50) not null,
- model varchar(100) not null,
- engine_id uuid not null
- constraint car_engine_id_fk
- references engine
- );
- create table truck
- (
- id uuid default uuid_generate_v4() not null
- constraint truck_pkey
- primary key,
- brand varchar(50) not null,
- model varchar(100) not null,
- cargo_max_weight smallint not null,
- truck_type varchar(100),
- engine_id uuid not null
- constraint truck_engine_id_fk
- references engine
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement