SQL Queries Submission requirements:

advertisement

SQL Queries

Submission requirements: Paper submission of SQL statements. Due date Wednesday, April 5

2006 before class.

Write the following queries in SQL. I expect to see correct syntax of SQL. MySQL version currently installed on the computers does not support full SQL capabilities (does not support subqueries), so you might be unable to run some of your queries. Best solution is to run them in

Microsoft SQL Server using SQL Query Analyzer.

The queries will refer to the following tables:

 Reviewer(REmail, RName, Institution)

 Presenter(PEmail, PName, PInstitution, Rating)

 Session(Title, Summary, Abstract, PEmail)

 Session_Reviewer(Title, REmail, NumberPoints)

These tables are part of the NCLCA application you are building for the project. NCLCA organizes conferences, and for each conference there are many session proposals.

Information about sessions is stored in Session table. Each session has a contact presenter specified by PEmail. Each session has a rating, which is a number from 1 to 100 representing the estimated percentage of attendees interested in that session. The presenter information is stored in Presenter table. Each proposal is evaluated by one or many reviewers, and each reviewer assigns a number of points for each proposal he/she is reviewing. The Session_Reviewer table maintains that information.

1.

List session title, reviewer email, reviewer name and number points for each session-reviewer pair with a session with rating higher that 50.

2.

Find session title and average number of points received for each session.

3.

Find reviewer email for most generous reviewer: the reviewer that gave the most points.

4.

Find session title and number of reviewers reviewing the session, for sessions with at least two reviewers.

5.

Find session title for sessions with rating higher than the rating of all sessions with a contact presenter (PEmail) from USNA.

6.

Find Session titles for sessions reviewed both by a reviewer from USNA and one from Cornell University.

7.

Find titles of sessions reviewed by all the existing reviewers. Hint: Use correlated subqueries.

Download