Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am having trouble figuring out #9. Any help would be greatly appreciated! CECS 535: Introduction to Database - Homework 2 Prof. Badia February 12,

image text in transcribedI am having trouble figuring out #9. Any help would be greatly appreciated!

CECS 535: Introduction to Database - Homework 2 Prof. Badia February 12, 2020 DUE DATE: one week from today Write the following questions as queries in SQL. Use only the operators discussed in class (in particular, no outer joins are allowed). Please use renaming consistently! The following database schema is given: RESEARCHER(rid, name, institution,city, country) PAPER (title, journal, volume, number, year) AUTHOR(resid, title) where rid is the identifier (primary key) of RESEARCHER, name is the researcher's name, institution is where the researcher works, and city and country the city and country where the institution is located; title is the paper identifier (primary key) of PAPER, journal is the journal where it was published in volume volume and number number), and year is the year it appeared. Finally, in AUTHOR resid is a foreign key for RESEARCHER and title is a foreign key for PAPER. A researcher may write several papers, and papers may be jointly written by several researchers; this means that the key of Author is (resid, title). 1. List the names of authors of any paper published in journal "Databases" in 2019 in volume 12. 2. List the names of authors who have published a paper in both "Nature and in "Science" (journals). 3. List the names of authors who have published two or more papers in "Nature" (journal). 4. List the names of authors who have published a paper in "Nature" but never in "Science" (journals). 5. List the names of authors who have published a paper in "Nature" (journal) alone (i.e. without co-authors). 6. List the title of papers where all authors are from the same institution. Note: this includes sole authors too. 7. Find out the average number of authors per paper. 8. Find out the number of papers per country (count each paper once, regardless of the number of authors). 9. List the number of papers per author (identified by author id) but count each paper in proportion to the number of authors. That is, if a paper has n authors, split the credit equally among them (1 units of credit). Example: if researcher Ullman has 3 papers, one alone, one with somebody else, and one with two other co-authors, he gets 1,.5 and .3 units of credit respectively, for a total of 1.8 papers. 10. List the journals that published more papers in 2019 than in 2018. CECS 535: Introduction to Database - Homework 2 Prof. Badia February 12, 2020 DUE DATE: one week from today Write the following questions as queries in SQL. Use only the operators discussed in class (in particular, no outer joins are allowed). Please use renaming consistently! The following database schema is given: RESEARCHER(rid, name, institution,city, country) PAPER (title, journal, volume, number, year) AUTHOR(resid, title) where rid is the identifier (primary key) of RESEARCHER, name is the researcher's name, institution is where the researcher works, and city and country the city and country where the institution is located; title is the paper identifier (primary key) of PAPER, journal is the journal where it was published in volume volume and number number), and year is the year it appeared. Finally, in AUTHOR resid is a foreign key for RESEARCHER and title is a foreign key for PAPER. A researcher may write several papers, and papers may be jointly written by several researchers; this means that the key of Author is (resid, title). 1. List the names of authors of any paper published in journal "Databases" in 2019 in volume 12. 2. List the names of authors who have published a paper in both "Nature and in "Science" (journals). 3. List the names of authors who have published two or more papers in "Nature" (journal). 4. List the names of authors who have published a paper in "Nature" but never in "Science" (journals). 5. List the names of authors who have published a paper in "Nature" (journal) alone (i.e. without co-authors). 6. List the title of papers where all authors are from the same institution. Note: this includes sole authors too. 7. Find out the average number of authors per paper. 8. Find out the number of papers per country (count each paper once, regardless of the number of authors). 9. List the number of papers per author (identified by author id) but count each paper in proportion to the number of authors. That is, if a paper has n authors, split the credit equally among them (1 units of credit). Example: if researcher Ullman has 3 papers, one alone, one with somebody else, and one with two other co-authors, he gets 1,.5 and .3 units of credit respectively, for a total of 1.8 papers. 10. List the journals that published more papers in 2019 than in 2018

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

25 Vba Macros For Data Analysis In Microsoft Excel

Authors: Klemens Nguyen

1st Edition

B0CNSXYMTC, 979-8868455629

More Books

Students also viewed these Databases questions

Question

5-8 What are the advantages and disadvantages of the BYOD movement?

Answered: 1 week ago