The Consignment relation records instances of a contractor

142 views 11:06 am 0 Comments June 22, 2023

Question 1:

A construction company works with a database that stores information about contractors, materials, and sites. The Consignment relation records instances of a contractor delivering materials for a construction site.

Question 2

Provide SQL queries and the result tables for the following:

  1. Find the details of any works of art along with the full name of the Artist who created the work that have at least two copies recorded in the database.
  2. List the details of any work of art that has an Expressionist style.
  3. List the details of the works of art currently held in the gallery.
  4. List the sales for each customer made in the year 2007. The query should include the details of the customer, the transaction, and the work of art purchased.
  5. List the names of the deceased artists and the number of years of age they were when they died (for example, an artist born in 1950 and deceased in 2001 has an age of 51).
  6. The sum of the acquisition price of works of art for each year (for example, if there were two works of art purchased for $1500 and $1000 in 2019, and one work of art purchased for $500 in 2020, then the sums would be $2500 and $500, for 2019 and 2020 respectively).
  7. Calculate the profit made on works of art that have been sold in the year 2010.
  8. Which artist has had the most works of art sold, and how many of the artist’s works have been sold?
  9. Sales of which artist’s works have resulted in the highest average profit (e., the average of the profits made on each sale of works by an artist), and what is that amount?
  10. Customer name of any customers who have an interest in ALL artists.
Tags: , , , , , , , , , ,