Advertisement
Maks140888

Untitled

Jun 7th, 2022
1,250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table lesson (
  2.     id numeric not null,
  3.     numeric_lesson numeric,
  4.     time_start varchar(100),
  5.     time_end varchar(200),
  6.     name varchar (50),
  7.     constraint lesson_pk primary key (id)
  8. );
  9.  
  10. create table day_week (
  11.     id numeric not null,
  12.     day_week varchar (50),
  13.     constraint day_pk primary key (id)
  14. );
  15.  
  16. create table study_group (
  17.     id numeric not null,
  18.     name varchar (50),
  19.     constraint group_pk primary key (id)
  20. );
  21.  
  22. create table cind_lesson (
  23.     id numeric not null,
  24.     name varchar (50),
  25.     constraint cind_pk primary key (id)
  26. );
  27.  
  28. create table subject (
  29.     id numeric not null,
  30.     name varchar (50),
  31.     constraint subject_pk primary key (id)
  32. );
  33.  
  34. create table audience (
  35.     id numeric not null,
  36.     name varchar (50),
  37.     constraint audience_pk primary key (id)
  38. );
  39.  
  40. create table sheldule (
  41.     id numeric not null,
  42.     day_week numeric not null,
  43.     lesson numeric not null,
  44.     study_group numeric not null,
  45.     subject numeric not null,
  46.     cind_lesson numeric not null,
  47.     audience numeric not null,
  48.     CONSTRAINT sheldule_pk PRIMARY KEY (id),
  49.     CONSTRAINT fk_day_week_id
  50.         FOREIGN key (day_week)
  51.         references day_week (id),
  52.     CONSTRAINT fk_lesson_id
  53.         FOREIGN key (lesson)
  54.         references lesson (id),
  55.     CONSTRAINT fk_group_id
  56.         FOREIGN key (study_group)
  57.         references study_group (id),
  58.     CONSTRAINT fk_subject_id
  59.         FOREIGN key (subject)
  60.         references subject (id),
  61.     CONSTRAINT fk_cind_id
  62.         FOREIGN key (cind_lesson)
  63.         references cind_lesson (id),
  64.     CONSTRAINT fk_audience_id
  65.         FOREIGN key (audience)
  66.         references audience (id)
  67. );
  68.  
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement