List the sales for each customer

Assignment Help Database Management System
Reference no: EM13327466

SQL (DML)

Provide SQL queries and the result tables for the following:

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 sphinx 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.

These queries are based on the View Ridge Gallery database you have been using in the Lab sessions. Please see Chapters 6 and 7 of Kroenke for background to the case and table structures.

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

a. List the details of any works of art (including the Artist who created the work) that have more than one copy recorded in the database.

b. List the details of any work of art (including the Artist who created the work) that has an Expressionist style.

c. 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).

d. List the sales for each customer (i.e., when a customer purchases a work of art from the Gallery, a transaction line is created. 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 purchased.

e. 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).

f. 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 2007, and one work of art purchased for $500 in 2008, then the sums would be $2500 and $500, for 2007 and 2008 respectively).

g. 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).

h. Which artist has had the most works of art sold, and how many of the artist's works have been sold?

i. Sales of which artist's works have resulted in the highest average profit (i.e., the average of the profits made on each sale of works by an artist), and what is that amount?

j. Customer name of any customers who have an interest in ALL artists.

Reference no: EM13327466

Questions Cloud

How would you change the current design : How would you change the current design and how does your new design address the problems you have identified with the current design.
What is the range of the baseball : A baseball thrown off a pedestrian pathway, 36 m above the Erie Canal, What is the range of the baseball
Provide the sql to amend the original table design : You have been given the following specifications of a simple database for a netball association that keeps record of players, teams and matches.
What is its recoil speed : A .30-06 rifle fires a bullet with a mass of 10 g at a velocity of 800 m/s. If the rifle has a mass of 4 kg, what is its recoil speed
List the sales for each customer : Each query is worth 2 marks. These tables exist in sphinx 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 dtoohe..
Problem on relational algebra : The database used for this question is a very simple one with the following schema: (Primary keys are bold, foreign keys are underlined)
Define relational database design : List the details of any works of art (including the Artist who created the work) that have more than one copy recorded in the database.
What is the volume of the liquid water : A cube of ice, 27 cm on each side, is melted into a measuring cup. What is the volume of the liquid water
Determine what is x at the end of 10 years : The present value of a payment of 60 at the end of 10 years and 40 at the end of 20 years is equal to 40. The present value of a perpetuity with payments of x at the end of each year is also 40.

Reviews

Write a Review

Database Management System Questions & Answers

  Physical schema created for a database

At this point in the design process, you would have a detailed physical schema created for a database. How would you approach converting your schema into a database, complete with sample data? Explain your approach in two to three paragraphs.

  Discuss the costs involved in implementing the database

Using the SafeAssign link in Blackboard to submit your report. Download and print out the FULL report and attach to the appendix at the back of your report. Assignments without the full SafeAssign report will NOT be marked.

  Create a set of dependency diagrams for the abs database

Consider a case that is not described above, but could happen in the business of the ABS. Please explain the case and why it might occur and based on the case you proposed, modify your design of the ABS database accordingly.

  Expressions in tuple relational calculus and domain relation

Consider the relational database described in Problem Give expressions in tuple relational calculus and domain relational calculus for each of the following queries: Find all the companies that have offices in all the cities in which company C2..

  Which is not a factor to consider in software evaluation

Peer reviewers are the key participants in which activity?

  Various kinds of keys to form or define relationships

Relational database is based on fact that data in one table can be tied, or related to data in another table. To do this, database utilizes various types of keys to form or define these relationships.

  How protocol ensures serializability and deadlock freedom

To lock any other vertex, the transaction must have visited all the parents of that vertex and must be having a lock on one of the parents of the vertex. Show that the protocol ensures serializability and deadlock freedom.

  Translation from erd to the relational model

Complete (i.e., reverse engineering) ER diagram below such that 4 relation schemas above are exactly result of a translation from the ERD to the relational model.

  Discuss the serious data redundancy problems

Identify and discuss the serious data redundancy problems exhibited by the file structure shown in Figure and looking at the EMP_NAME and EMP_PHONE contents in Figure, what change(s) would you recommend?

  Drawing active directory hierarchy in terms of forests

Draw Active Directory hierarchy in terms of forests, trees, domains, organizational units, and sites which are most suitable for this company and their security concerns.

  Explain the security mechanisms available for a database

Use technology and information resources to research issues in database systems. Write clearly and concisely about relational database management systems using proper writing mechanics and technical style conventions.

  Explaining weak relationship and weak entity

What is meant by a weak relationship? Provide an example. What is meant by weak entity? What do you understand by relationship degree?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd