Question: Need help with this coding problem Suppose you have created tables in assignment 1. Please write one SQL statement for each the following problems. You
Need help with this coding problem




Suppose you have created tables in assignment 1. Please write one SQL statement for each the following problems. You can use the attached SQL statements to create the tables. Problem 1. Please write ONE SQL statement for each of the following tasks using tables created in Problem 1. Note that you can only use conditions specified in the task description and cannot manually look up data and add conditions. E.g., in task 1, you cannot manually look up category ID for carpet cleaner. You want to make sure your code will work regardless of what data are in the database (c.g., whether carpet cleaner has a category ID of 1 or 100). [100 points, 20 points each] Task 1: Return names and emails of authors of the paper titled 'A novel approach of mining EHR data' Task 2: Return reviewer ID, review decision, and review comments of the paper titled "Comparing big data systems Task 3: Return paper title and number of authors for each paper. Task 4: Return names of authors who have at least two papers. Task 5: List names of authors who have co-authored with Dr. Chen. Hint: use self join Sample code to create the tables. drop table paper review cascade constraints; drop table reviewer cascade constraints; drop table paper.author cascade constraints; drop table paper cascade constraints; drop table editor cascade constraints; drop table author cascade constraints; create table author ( aid int. -- author id aname varchar(50), --- author name aemail varchar(50), --- author email affliation varchar(50), primary key (aid)); insert into author values(1,'Dr. Chen','chen@umbc.edu','UMBC"); insert into author values(2,'Susan''susan@umbc.edu', 'UMBC"); insert into author values(3,'Steve 'steve@umb.edu','UMB'); insert into author values(4,'Carole','carole @umb.edu','UMB'); create table Editor ( eid int, --- editor ID ename varchar(50), --- editor name eemail varchar(50), --- email primary key (eid); insert into editor values(1, Claire', 'claire@gmail.com'); insert into editor values(2, 'David david@gmail.com'); create table paper pid int, -- paper id title varchar(50), eid int. -- assigned editor id submit.date, date, --- date of submission status int, --status: 1 accept, 2 under review, 3 revision, 4 reject primary key(pid. foreign key(eid) references editor); --- accept insert into paper values(1, Comparing big data systems",2,date "2020-1-10,3); -- under review insert into paper values(2, 'A novel approach of mining EHR data",2, date "2020-2-10',2); --- revision, insert into paper values(3, 'A new SQL Benchmark', 1, date '2020-1-1',1); create table paper.author ( pid int, -- paper id aid, -- author id primary key(pidaid), foreign key(pid) references paper, foreign key(aid) references author); insert into paper, author values(1,1); insert into paper author values(1,2); insert into paperauthor values(2,3); insert into paperautboc values(2.4); insert into paper author values(3.1); insert into paperautboc values(3.2); create table Reviewer rid int, --- reviewer id mams varchar(50), --- reviewer name remail varchar(50), --- reviewer email raffiliation varchar(50) primary key(rid)); insert into reviewer values(1, Ellenellen@gmail.com Johns Hopkins'); insert into reviewer values(2, Cathy cathy@gmail.com. Johns Hopkins'); insert into reviewer values(3, 'Grace''grace@gmail.com Stanford'); insert into reviewer values(4, 'Eric'eric@gmail.com. Stanford": insert into reviewer values(5, 'Ethan 'ethan@umbe.edu','UMBC"); create table paperseview prid int, -- paper review id pid int, -- paper id rid int, -- rexiwer id due date date, -- review due date receivedate date, -- review received date round int, -- round of review, 1 means first round, 2 means second round, most paper will go through 2 rounds of review decision int, -- 1 accept, 2 minor revision, 3 major revision, 4 reject rcomment varchar(200), -- comments of review primary keys foreign key(pid) references paper, foreign key(rid) references reviewer); -paper 1, first round, -- 2 major, 1 minor insert into paper review. values(1, 1, 1, date '2020-2-10',date 2020-2-9, 1,3, 'Good paper but needs to improve writing); insert into paper review values(2, 1, 3, date '2020-2-10',date 2020-2-10', 1,2, Good paper fix a few typo'); insert into paper review values(3, 1, 4, date '2020-2-10',date '2020-2-12', 1,3,"Please add more experiments'); --- paper 2 is under review and no review provided. insert into paper.ssview values(4, 2, 2, date '2020-3-10',null, Lnull, null); insert into paper review values(5, 2, 1, date '2020-3-10',null, 1.null,null); insert into paper review values(6, 2, 3, date '2020-3-10',null, Lnull,null); -- paper 3 has two rounds of reviews, rl: 1 major, 1 minor - 12: 2 accept insert into paper review values(7, 3, 4, date '2020-2-1',date "2020-1-15, 1,2,'good paper, fix a few typo'); insert into paper review. values(8, 3, 2, date '2020-2-1',date '2020-1-11', 1,3,'good paper, but please add more related work'); insert into papel.seview. values(9, 3, 4, date '2020-3-1',date "2020-2-15, 2,1,'all comments addressed'); insert into paper review values(10, 3, 2, date '2020-3-1', date 2020-2-18', 2,1, 'all comments addressed'); commit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
