Commit 8036eed2 authored by Alexander Kuhn's avatar Alexander Kuhn

Upload New File

parent ecfb244f
create table employees (
employee_id smallint not Null primary key,
last_name character varying(20) not Null,
first_name character varying(30) not Null,
title character varying(30),
title_of_courtesy character varying(25),
birth_date date,
hire_date date,
address character varying(60),
city character varying(15),
region character varying(15),
postal_code character varying(10),
country character varying(15),
home_phone character varying(24),
extension character varying(4),
photo bytea,
notes text,
reports_to smallint,
photo_path character varying(255),
constraint fk_employees foreign key (reports_to) references employees(employee_id)
);
create table regions (
region_id integer primary key,
region_headquarter_city character varying(40) not Null
);
create table employee_regions (
employee_id smallint not Null references employees (employee_id),
region_id integer not Null references regions (region_id),
constraint pk_employee_regions primary key (employee_id, region_id)
);
--Aufgabe 2
insert into regions values (1, 'Mainz');
insert into regions values (2, 'Madrid');
insert into regions values (3, 'Miami');
insert into regions values (4, 'Rio de Janeiro');
alter table employees add constraint fk_employees foreign key (reports_to) references employees(employee_id);
*/
insert into employee_regions (employee_id,region_id) values
(1,1),
(2,2),
(3,3),
(4,4),
(5,2),
(6,1),
(7,4),
(8,2),
(9,1);
alter table orders add constraint fk_orders_employee_id foreign key (employee_id) references employees(employee_id);
alter table employees add column MobilePhoneNumber varchar(24);
update employees set MobilePhoneNumber = '0123456789';
create index idx_employees_last_names on employees (last_name);
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment