Question

In: Computer Science

Consider a database containing information about all the car accidents between 1997 and 2005, including the...

Consider a database containing information about all the car accidents between 1997 and 2005, including the cars involved and their owners. The database has the following tables:

Car (license, year, make, model);

Accident (license, accident date, damage_amount zipcode);

Owner (SSN, license, name, address, zipcode);

// zipcode in Accident is the place where accident took place

// assume that the same car does not get into an accident twice in a day

// assume each owner has only one licensed car

Consider the following query:

SELECT O.name, A.damage_amount

FROM Car C, Accident A, Owner O

WHERE C.license = A.license AND C.licese = O. license AND A.zipcode = O.zipcode AND C.make = ‘Volvo’ AND

A.accident_date < ’07/01/2000’ AND A.damage_amount > 10000;

•Draw the initial tree for this query, and generate a range of query-evaluation plans from the given query by using the equivalence rules, and choose the one with the least cost.

Solutions

Expert Solution

Given Query:-

SELECT O.name, A.damage_amount

FROM Car C, Accident A, Owner O

WHERE C.license = A.license AND C.licese = O. license AND A.zipcode = O.zipcode AND C.make = ‘Volvo’ AND

A.accident_date < ’07/01/2000’ AND A.damage_amount > 10000;

The initial tree for this query:-

After applying Cost-based optimization, The best Query with least cost is as follows:-


Related Solutions

About 60% of the car accidents in a given highway road are due to exceed of...
About 60% of the car accidents in a given highway road are due to exceed of the limited high speed. If a study will investigate 10 cars accidents The probability that none is due to exceed of the limited high speed is The probability that 5 exact accidents are due to exceed of the limited high speed is The probability that at least 1 car accident is due to exceed of the limited high speed is The probability that at...
A finance company has a database of customer documentation, including application forms containing a substantial amount...
A finance company has a database of customer documentation, including application forms containing a substantial amount of personally identifiable information (PII). The database contains the records of over 10,000 customers. The database is only accessible from inside the network of the company – it is not directly exposed to the Internet. (15 marks total) Suggest a suitable data classification for this information held by this database and explain why this classification is appropriate. Suggest one threat actor, and why they...
A finance company has a database of customer documentation, including application forms containing a substantial amount...
A finance company has a database of customer documentation, including application forms containing a substantial amount of personally identifiable information (PII). The database contains the records of over 10,000 customers. The database is only accessible from inside the network of the company – it is not directly exposed to the Internet. i. Suggest a suitable data classification for this information held by this database and explain why this classification is appropriate.   ii. Suggest one threat actor, and why they might...
Explain the differences between data, Information, and a database. Describe the purpose of a database in...
Explain the differences between data, Information, and a database. Describe the purpose of a database in health care and provide an example of one utilized locally, statewide, and nationally.
2. In 2009 it was reported that 45% of all car accidents in Buffalo were alcohol...
2. In 2009 it was reported that 45% of all car accidents in Buffalo were alcohol related. Suppose we take a random sample of 200 car accidents in Buffalo and let X be the number which are alcohol related. a. Define the random variable X of the form ) Find the probability that fewer than half (less than 100) were alcohol related. Find the prob. that between 60 and 80, inclusive, were alcohol related. Find the probability at least 90...
In 2003, it was reported that 40% of all car accidents in Connecticut were alcohol related....
In 2003, it was reported that 40% of all car accidents in Connecticut were alcohol related. Suppose we take a random sample of 100 car accidents in Connecticut and let X be the number that are alcohol related. Find the probability that at least 40 were alcohol related and at least 40 were not alcohol related.
How to generate database diagram for a database that stores information about the downloads that users...
How to generate database diagram for a database that stores information about the downloads that users make. Each user must have an email address, first name, and last name. Each user can have one or more downloads. Each download must have a filename and download date/time. Note: I want steps on how to generate this diagram using oracle SQL developer Each product can be related to one or more downloads. Each product must have a name.
Among all the car accidents last year, 492 deaths were reported in the road of which...
Among all the car accidents last year, 492 deaths were reported in the road of which 240 wore belts and 252 wore no belts. Of the 2334 people involved in serious accidents 1945 wore seat belts and the rest no to. Calculate the probability of dying by not wearing a belt b. Calculate the probability of dying if you wear the belt c. If a person dies in a car accident; What is the probability of who will wear a...
Consider the database of a car rental company that contains three tables drivers, cars and reservation...
Consider the database of a car rental company that contains three tables drivers, cars and reservation tables. Drivers:                                           Reservation:                              Cars: Dno Dname age Dno Cno Day Cno Cmake Color 22 Dustin 45 22 101 10/10 101 BMW Blue 29 Brutus 33 22 102 10/10 102 VW Red 31 Lubber 55 22 103 10/8 103 OPEL Green 32 Andy 25 22 104 10/7 104 FIAT Red 58 Rusty 35 31 102 11/10 64 Horatio 35 31 103 11/6 71 Zorba...
Consider the following information to design a database for a catalogue of an online video service...
Consider the following information to design a database for a catalogue of an online video service that offers access to popular TV series. The following is the description of the application: Each series has a name and a description. Each series has many episodes. Each episode of a series has an episode number, the date it was first aired, and the length of the episode in minutes. The episode number uniquely identifies an episode with respect to the series, but...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT