Please ensure that you include

Please ensure that you include the result table as well as your SQL; you can copy and paste this from either your ssh client or SQL Developer. Each query is worth 2 marks. These tables exist in arion and are owned by the user dtoohey. You may, if you wish, create your own copies of the tables under your own account. If you do so, you should ensure that you copy the sample data in dtoohey’s tables.

The database used for this question is based upon the following relational schema that represents a very simplified medical billing database (Primary Key, Foreign Key,alternate key):

ARTIST(ArtistID,LastName,Nationality,DateOfBirth,DateDeceased)

WORK(WorkID,Title,Copy,Medium,Description,ArtistID)

TRANS(TransactionID,DateAcquired,AcquisitionPrice,AskingPrice,DateSold,SalesPrice,CustomerID,WorkID)

CUSTOMER(CustomerID,LastName,FirstName,EmailAddress,EncryptedPassword,Street,City,State, ZIPorPostalCode, Country, AreaCode, PhoneNumber)

CUSTOMER_ARTIST_INT(ArtistID, CustomerID)

Marks are allocated not only for correct answers, but also for best practice in the creation of the queries.

  1. List the details of any works of art (including the Artist who created the work) that have more than three copies recorded in the database.
  1. List the details of any work of art (including the Artist who created the work) that has a Surrealist style.
  2. List the details of the works of art (including the Artist who created the work, and the acquisition and asking price details) currently held in the gallery (i.e., works of art that have not been sold).
  3. List the sales for each customer (i.e., when a customer purchases a work of art from the Gallery, a transaction line is create For a purchase, there will be values in the DateSold and SalesPrice columns). The query should include the details of the customer, the transaction and the work of art purchase
  4. 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).
  5. 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).
  6. Calculate the profit made on works of art that have been sold (i.e., the profit/loss on an individual work of art is the difference between the acquisition price and the sales price).
  7. Which artist has had the most works of art sold, and how many of the artist’s works have been sold?
  8. 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?
  9. Customer name of any customers who have an interest in ALL artists.

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount

Posted in Uncategorized