Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For Problems 3 and 4 you will work with a very small Olympics database (Olympics & Medals) below. the Olympics.sql file that already created

image

For Problems 3 and 4 you will work with a very small Olympics database (Olympics & Medals) below. the "Olympics.sql file that already created the table and populated data is provided for your utilization. Olympics (year, host, kind) Medals (country, sport, year, event, medal) host kind country sport year event medal 2012 100m freestyle 2012 100m butterfly 2012 200m butterfly 2010 ice dancing 2010 ladies' singles year 2012 UK 2010 Canada 2008 China 2006 Italy 2004 Greece 2002 USA Summer Winter Summer Winter Summer Winter USA USA USA Canada Canada swimming swimming swimming figure skating figure skating figure skating swimming swimming swimming figure skating figure skating figure skating China China Problem 3 (25 points) USA USA USA China Refer to the Olympics database. Brazil In each of following questions, write a Relational Algebra expression, and then translate it to the corresponding SQL implementation, finally show the retrieved results (in a table form or the screenshot of the returned Oracle result) when your expression is executed with the given instances. Some Relational Algebra operation symbol that you might need to copy if it's difficult for you to type: TT,, o Russia Russia 2002 ladies' singles 4 figure skating figure skating 2010 pair skating 2008 400m freestyle 2008 200m freestyle 2008 50m freestyle gold gold silver gold bronze 2002 men's singles 2002 ladies' singles 2002 pair skating 2002 men's singles gold silver gold gold bronze gold bronze gold silver (3a) (10 points) List all countries that have ever hosted Olympics and also won a gold medal. (3b) (15 points) List the country name, year, and medal type of the countries who won Olympic medals (no matter which type of medals) in the year when they also hosted the Olympic game. Problem 4 (25 points) Refer to the Olympics database defined on previous page. In each question, write a SQL query, and then show its result (the screenshot of the returned Oracle result), when the query is executed with the given instances. The Oracle outcome should be in desired layout. (4a) (10 points) List sports where Team USA has earned a gold medal.List each sport only once. (4b) (15 points) For each country, list the number of all medals (no matter which type of medals) that won by the countries in the year that they also hosted the Olympic game. Sort results by the number of medals, higher to lower.

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

Business Law and the Legal Environment

Authors: Jeffrey F. Beatty, Susan S. Samuelson, Dean A. Bredeson

6th Edition

1285143310, 1111530602, 978-1285143316, 9781111530600, 978-1111530600

More Books

Students also viewed these Computer Network questions

Question

What is a brand community, and why is it of interest to marketers?

Answered: 1 week ago

Question

List some common reasons for redesigning layouts.

Answered: 1 week ago