Q1:-> Consider the insurance database where the primary keys are underlined.Construct the following SQL queries for this relational database.(a)Find the total number of people who owned cars that were involved inaccidents in 1989.(b) add new accident to the database ; assume any values for required attributes(c) Delete the mazla belonging to “john smith”Insurance databasePerson ( driverid, name, address)Car (license, model, year)Accident (reportnumber, date, location)Owns (driverid, license)Participated (driverid, car, reportno, damageamount)ANSWER:a.
This is not the same as the total number of accidents in 1989. We must countpeople with several accidents only once.
We assume the driver was “Jones,” although it could be someone else. Also, weassume “Jones” owns one Toyota. First we must find the license of the given car.Then the
relations must be updated in order to both recordthe accident and tie it to the given car. We assume values “Berkeley” for
,’2001-09-01’ for date and
, 4007 for
and 3000 for damage amount.