Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table task (
- id number not null,
- title varchar (50),
- constraint tasks_pk primary key (id)
- );
- create table user_web (
- id number not null,
- name varchar(50),
- constraint user_id primary key (id)
- );
- create table solution (
- id number not null,
- student_id number not null,
- task_id number not null,
- sent_date date,
- CONSTRAINT solutions_pk PRIMARY KEY (id),
- CONSTRAINT fk_studentt_id
- FOREIGN key (student_id)
- references user_web (id),
- CONSTRAINT fk_taskk_id
- FOREIGN key (task_id)
- references task (id)
- );
- create table grades (
- solution_id number not null,
- tutor_id number not null,
- grade number,
- grade_date date,
- CONSTRAINT fk_solutions_id
- FOREIGN key (solution_id)
- references solution (id),
- CONSTRAINT fk_tutor_id
- FOREIGN key (tutor_id)
- references user_web (id)
- );
- INSERT INTO user_web (ID, NAME) VALUES (1, 'Danil');
- INSERT INTO user_web (ID, NAME) VALUES (2, 'Kiril');
- INSERT INTO user_web (ID, NAME) VALUES (3, 'Maxim');
- insert into task (id, title) values (0, 'Rp_01');
- insert into task (id, title) values (1, 'Rp_02');
- insert into task (id, title) values (2, 'Rp_03');
- insert into task (id, title) values (3, 'Rp_04');
- insert into task (id, title) values (4, 'Rp_05');
- insert into user_web (id, name) VALUES (4, 'Olga Kovalenko');
- insert into user_web (id, name) VALUES (5, 'Oleg Kuzikov');
- insert into solution (id, student_id, task_id, sent_date)
- VALUES (1, 3, 0, to_date('2022-04-23','YYYY-MM-DD'));
- insert into solution (id, student_id, task_id, sent_date)
- VALUES (2, 3, 1, to_date('2022-04-25','YYYY-MM-DD'));
- insert into solution (id, student_id, task_id, sent_date)
- VALUES (3, 1, 0, to_date('2022-04-26','YYYY-MM-DD'));
- insert into solution (id, student_id, task_id, sent_date)
- VALUES (4, 1, 1, to_date('2022-04-27','YYYY-MM-DD'));
- insert into grades (solution_id, tutor_id, grade, grade_date)
- VALUES (1, 4, 50, to_date('2022-04-27','YYYY-MM-DD'));
- insert into grades (solution_id, tutor_id, grade, grade_date)
- VALUES (2, 4, 80, to_date('2022-04-29','YYYY-MM-DD'));
- insert into grades (solution_id, tutor_id, grade, grade_date)
- VALUES (3, 5, 40, to_date('2022-04-28','YYYY-MM-DD'));
- insert into grades (solution_id, tutor_id, grade, grade_date)
- VALUES (4, 5, 90, to_date('2022-04-30','YYYY-MM-DD'));
- insert into grades (solution_id, tutor_id, grade, grade_date)
- VALUES (0, 4, 60, to_date('2022-04-25','YYYY-MM-DD'));
Advertisement
Add Comment
Please, Sign In to add comment