create table peoples
(
tz bigint not null,
name varchar (20) not null
,familt varchar (20) not null
,country_id int not null
,city varchar (20) not null
,street varchar (20) not null
,house_number varchar (20) not null
, phone_number varchar(9) not null
,Cell_phone varchar(10) null
,year_born int not null)
alter table peoples
add constraint PK_people primary key (tz)
alter table peoples
add constraint fk_country_people foreign key (country_id) references countries(country_id)
--------לבדוק איך עושים מפתח זר-------
-----ארצות----
create table countries
(country_id int identity not null
,country_name varchar(30) not null
,constraint pk_countries primary key (country_id))
insert into countries(country_name)
values ('ישראל'),('צרפת'),('מקסיקו'),('ניו יורק'),('קנדה'),('אוסטרליה'),('וינה'),('בלגיה')
--select * from countries
תודה רבה!