Construct sql for an accident management database

person(ss#, name, address)

car(license, year, model)

accident(date,driver,damage-amount)

owns(ss#,license)

log(license, date, driver)


Consider the above database, where the primary keys are underlined. Construct the following sql queries for this relational database.

(a) Find the total number of people whose cars were involved in accidents in 2016
(b) Find the number of accidents in which the cars belonging to "Torin" were involved
(c) Add a new customer to the database
(d) Delete the Mazda belonging to "Torin"
(e) Add a new accident record for the Toyota  belonging to "Tutum"

No comments:

Post a Comment

Popular Posts