Question

In: Computer Science

Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference...

Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming). Type your answers.

The following database schema is given:

ATHLETE(name,age,height,weight,country)

RACE(id,location,date,time-start,distance)

COMPETES(aname,rid,time,position)

where ATHLETE has information about runners (their name, age, height, weight, and nationality); RACE has information about races (id, location, date when it’s held, time it starts, and distance ran); and COMPETES keeps track of which runners run on with race, the time it took them to complete the race, and their position on it (winner = ’1’, second = ’2’, third = ’3’, and so on).

(a) List the names of athletes under 30 years old from Norway that have ran a marathon (distance=26.2).

(b) List the names of athletes who have finished a race in 1st position and another race in second position.

(c) List the names of athletes who have never won a race (win=1st position).

(d) (*) List the races (id) where all the athletes were under 30 years old.

Solutions

Expert Solution


Related Solutions

Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference...
Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming). Type your answers. Consider the following database schema: INGREDIENT(ingredient-id,name,price-ounce) RECIPE(recipe-id,name,country,time) USES(rid,iid,quantity) where INGREDIENT lists ingredient information (id, name, and the price per ounce); RECIPE lists recipe information (id, name, country of origin, and time it takes to cook it); and USES tells us which ingredients (and how much of each) a recipe uses. The primary key of each table is underlined; rid...
Write the following questions as queries in SQL. Use only the operators discussed in class (no...
Write the following questions as queries in SQL. Use only the operators discussed in class (no outer joins) Consider the following database schema: INGREDIENT(ingredient-id,name,price-ounce) RECIPE(recipe-id,name,country,time) USES(rid,iid,quantity) where INGREDIENT lists ingredient information (id, name, and the price per ounce); RECIPE lists recipe information (id, name, country of origin, and time it takes to cook it); and USES tells us which ingredients (and how much of each) a recipe uses. The primary key of each table is underlined; rid is a foreign...
Write the following questions as queries in RELATIONAL ALGEBRA. Use only the operators discussed in class...
Write the following questions as queries in RELATIONAL ALGEBRA. Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming). The following database schema is given: ATHLETE(name,age,height,weight,country) RACE(id,location,date,time-start,distance) COMPETES(aname,rid,time,position) where ATHLETE has information about runners (their name, age, height, weight, and nationality); RACE has information about races (id, location, date when it’s held, time it starts, and distance ran); and COMPETES keeps track of which runners run on with race, the time it...
1. Implement the union set function using the prototype. 2. Implement the intersection set function using...
1. Implement the union set function using the prototype. 2. Implement the intersection set function using the prototype. 3. Implement the set difference function using the prototype. 4. Implement the subset function using the prototype.
Show that a set is convex if and only if its intersection with any line is...
Show that a set is convex if and only if its intersection with any line is convex. Show that a set is affine if and only if its intersection with any line is affine.
Given the set A = {‘ab’,22)} we know the Cartesian product A x A consists of...
Given the set A = {‘ab’,22)} we know the Cartesian product A x A consists of 4 tuples (=2 x 2) and any subset of the Cartesian product is a relation. There are 16 possible subsets ( = 24 ) HINT: The documents: Sets in python and mathematics and RelationPascalTriangleExamples Display the Cartesian product (4 tuples)                                                                                 ANS   {                         } Display one relation with 3 tuples   ANS {                          } Using the formula nCr, how many relations are there with 2...
Which were the first fifteen countries to join the European Union? Which do not use the...
Which were the first fifteen countries to join the European Union? Which do not use the Euro as their official currency? Did any of the fifteen members drop out of the European Union. If yes, which country?
This question is about the class Set, as discussed in the lectures. It represents a finite...
This question is about the class Set, as discussed in the lectures. It represents a finite set of int’s. Relevant parts of Set are shown below. The integer count holds the number of elements in the Set. The array elements holds the elements themselves. The class Set also has public methods addElement, equals, isIn, and toString. They are defined as in the lectures, and you can use them if you need to. class Set   {     private int count;     private int...
Overloading the insertion (<<) and extraction (>>) operators for class use requires creating operator functions that...
Overloading the insertion (<<) and extraction (>>) operators for class use requires creating operator functions that use these symbols but have a parameter list that includes a class ____. object address reference data type Flag this Question Question 210 pts When overloading the insertion operator to process a Complex object, it’s important to understand that you’re overloading an operator in the ____ class. istream operator Complex ostream Flag this Question Question 310 pts ____ class variables are allocated memory locations...
Please Select a Product and Make it on that product Project Description: Student groups will select...
Please Select a Product and Make it on that product Project Description: Student groups will select an industrial project to be developed throughout the semester. Students groups will select an appropriate project and define measurable project objectives and requirements. A project plan and schedule will be generated as well as resources allocated to accomplish project objectives. Prepare a group project for the class. Use as your model one of the following 1. Construction project 2. Software development project 3. Events...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT