Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In SQL, running on an Oracle database, write a query for each problem that solve

ID: 3586487 • Letter: I

Question

In SQL, running on an Oracle database, write a query for each problem that solves the task.

1) Find the total damage amount from all accidents in which the cars manufactured by BMW were involved -- note: the answer should include the damage produced to other cars involved in the same accidents with the BMW cars.

2) Find the average damage amount from all accidents in which the cars owned by Rubens Barrichello were not involved.

Table 1: Person Driver id Name Jenson Button Rubens Barrichello1st Ave Sebastin Vettel Mark Webber Lewis Hamilton Felipe Massa Unirersity St 8 Unirersity St Tabe 3: Owns Driver id License Report nAccident dateLocation 04-13-2008 Highland Heights Highland Heights Report nr License Driver id Damage amt

Explanation / Answer

a)

Select Sum(participated.damage_amt)

From participated,Car

Where (Car.model=’BMW’) AND (Car.Lisence=Paticipated.License);

b)

Select Average(participated.damage_amt)

From participated,Person

Where (Person.Name<> ’Rubens Barrichello’) AND (Person.driver_id=Paticipated. .driver_id);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote