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...
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.
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?
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...
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...
Select a specific real-world firm or market that we have not discussed in class or the...
Select a specific real-world firm or market that we have not discussed in class or the textbook and discuss which model of market structure you think would be most appropriate to describe that market. (ie. Perfect competition, monopolistic competition, oligopoly, monopoly.) Real world markets never exactly meet the assumptions of the models, so you can also talk about what aspects of the real-world market may not fit the model what aspects are not well described by the model selected. You...
Select one disability that was discussed in class. Focusing on this one disability, please comment on...
Select one disability that was discussed in class. Focusing on this one disability, please comment on the disadvantages faced by persons with this disability, and the extent to which you believe that the current public policies that are in force are enough to overcome these disadvantages. What types of additional public policies or laws might be more effective in overcoming these disadvantages? answer is a short answer way. 5 sentences please.
Use the following class for the following problem. The only purpose of the class is to...
Use the following class for the following problem. The only purpose of the class is to display a message both when the constructor is invoked and when the destructor is executed. class Trace { public: Trace(string n); ~Trace(); private: string name; }; Trace::Trace(string n) : name(n) { cout << "Entering " << name << "\n"; } Trace::~Trace() { cout << "Exiting " << name << "\n"; } Requirement: Extend the class Trace with a copy constructor and an assignment operator,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT