SQL Statement and ER Diagram for Insurance Company

SQL Statement and ER Diagram for Insurance Company Assume User A created a sells (bar, beer, and price) table and granted SELECT and INSERT privileges with GRANT option to User B.

SQL Statement and ER Diagram for Insurance Company
SQL Statement and ER Diagram for Insurance Company

User B then granted SELECT privilege on attributes bar and beer to User C. Can User C create a view as follows and can User C insert a new tuple into the view? Explain your answer.

CREATE VIEW v AS SELECT bar, beer FROM sells

SQL Statement and ER Diagram for Insurance Company

  1. Consider the following relations about auto parts and their suppliers.

Part (pid, name, color)

Supplier (sid, name, city)

Supplies (sid, pid, price)

Express the following queries in SQL. (Only standard SQL syntax is allowed. Each query should be answered in a single SQL statement.)

Find the names of suppliers and the names of parts they sell. List result in descending order of suppliers’ names.

Find the names of suppliers that are located in NewYork.

Find the names of parts that are sold by exactly two suppliers.

SQL Statement and ER Diagram for Insurance Company

Find the names of parts that are sold by all suppliers.

Find the name of a supplier who sells the cheapest wheel and lists their price of wheels.

  1. Find the average price of wheels sold in each city.
  2. Find the name of the part that is sold by the most number of suppliers.
  3. Find the names of suppliers whose average price for the parts they sell is over $100.
  4. Find the name of a supplier who sells the most number of different colors of parts and lists the colors of parts that this supplier sells.
  5. For the suppliers who are located in a city that the city has the lowest average price of wheels, list the names of suppliers, their price of wheels, and the city they are located in.
SQL Statement and ER Diagram for Insurance Company

Construct an E-R diagram for an insurance company. A person may own one or more vehicles. A vehicle may have one or more owners. The types of vehicles are motorcycles, passenger cars, trucks, vans, and buses. Owners are the only drivers of motorcycles and passenger cars; trucks, vans, and buses may have drivers who are not the owner of the vehicle. Vehicles may be involved in accidents. If there is an accident, the information of the vehicle and the driver will be recorded as well as time, place, and description of the accident. All vehicles must be insured. Each insurance policy covers one or more vehicles and has one premium payment associated with the policy. Each payment is for a particular period of time and has an associated due date, and the date when the payment was received. If a policy is terminated, payments associated with it should be stopped.

  1. Construct an E-R diagram to capture this information.
  2. Translate the E-R diagram into relations. Indicate the Primary Key of each table.

Unlike most other websites we deliver what we promise;

  • Our Support Staff are online 24/7
  • Our Writers are available 24/7
  • Most Urgent order is delivered with 6 Hrs
  • 100% Original Assignment Plagiarism report can be sent to you upon request.

GET 15 % DISCOUNT TODAY use the discount code PAPER15 at the order form.

Type of paper Academic level Subject area
Number of pages Paper urgency Cost per page:
 Total: