Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Financial Accounting

Authors: Charles T Horngren, John A Elliott

9th Edition

0131479725, 978-0131479722

More Books

Students also viewed these Accounting questions

Question

What is the opportunity cost of the economics profession?

Answered: 1 week ago

Question

1. Build trust and share information with others.

Answered: 1 week ago