drop table if exists core.fact_rental;

drop table if exists core.dim_staff;


create table dim_staff (

staff_pk serial primary key,

staff_id integer not null,

first_name varchar(45) not null,

last_name varchar(45) not null,

address varchar(50) not null,

district varchar(20) not null,

city_name varchar(50) not null

);



create table fact_rental (

rental_pk serial primary key,

inventory_fk integer not null references dim_inventory(inventory_pk),

staff_fk integer not null references dim_staff(staff_pk),

rental_date date not null,

return_date date,

amount numeric(7,2)

);


Последнее изменение: воскресенье, 24 июля 2022, 09:17