Question
Database: Consider the Insurance Database Q1: Write SQL expressions for the following query (7 pts), and show the result of your query over the given
Database:
Consider theInsurance Database
Q1: Write SQL expressions for the following query (7 pts), and show the result of your query over the given database instance (3 pts):
Find the average damage amount for each accident location. Display the location and the average amount in alphabetical order of locations.
My Answer:
SELECT Location, avg(Damage_amount)
FROM Accident, Participated
WHERE Accident.report_number = Participated.report_number
GROUP BY Location
ORDER BY Location;
---------------------------------------------------------------------------
locationavg(Damage_amount)
----------------------------------------
Please help me with the result... according to the data....
Q2: ELECT DISTINCT Name
FROM Person, Participated
WHERE Person.Driver_id = Participated.Driver_id AND Person.Driver_id < 3
ORDER BY Name;
Your Answer:
Name
--------
Please help me with the result... according to the data...
SELECT License
FROM Car
WHERE Year = 2019 AND
License IN (SELECT License
FROM Accident, Participated
WHERE Accident.Report_number = Participated.Report_number AND
ADate < to_date('01-MAY-19', 'DD-Mon-YY'));
Your Answer:
License
---------
AAA
BBB
EEE
FFF
is it right?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started