Define relational database design

Assignment Help Database Management System
Reference no: EM13327464

Question 1  - 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)

CUSTOMER (CustID, FirstName, LastName, City, Phone, Email)
INVOICE (InvoiceNumber, CustID, Date)
INVOICE_ITEM(InvoiceNumber, ItemNumber, Quantity)
ITEM (ItemNumber, ItemName, UnitPrice)

When a customer makes a purchase, an invoice is created. The invoice may be for many items. For example, in a single purchase, a customer might buy 10 Back Scratchers, 4 Hair Removers and a Dog Lead.

Provide relational algebra (NOT SQL) queries for the following:

a. List the first and last names of Customers who come from the City named Perth.
b. List the first and last names of customers who had transactions on 1st August 2012.
c. List the price of the item called "Back Scratcher"
d. List the first and last names of any customer who has purchased more than 10 "Back Scratchers" in a single transaction.
e. List the names and quantities of items purchased on 1st August 2012 by the customer Peter Griffin.
f. List the dates on which Peter Griffin made purchases.
g. List the first and last names of customers who have bought "Back Scratcher" or "Hair Remover"
h. List the first and last names of customers who have bought "Back Scratcher" but have not bought "Hair Remover"
i. List the first and last names of customers who have bought "Back Scratcher" and "Hair Remover"
j. List the first and last names of any customers who have bought all of the items. (This does not need to be as part of a single purchase).


Question 2  - 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.

Question 3  - SQL (DDL)

a. Provide ALL of the SQL statements required to insert the details of the following: A customer, John Smith, of 47 Moodle Street, Highwater, WA, 6709, Australia (email: [email protected]) has sold a work of art called "Gorillas in the Mist" by the renowned French artist, Gallic Symbol (b. 1973) to the Gallery (i.e., the Gallery purchased it from him). It is a unique Watercolour on Paper and is 45 * 30cm signed by the Artist. The purchase price was $4500 and the transaction took place on 27th July 2013.

b. You have been given the following specifications of a simple database for a netball association that keeps record of players, teams and matches.

1907_assign.png



Give the SQL to create the Match table. You may assume that the Player and Team tables have already been created, and that the MatchID, PlayerID and TeamID colums are of the data type VARCHAR2(5). The result of the match refers to the result for the HomeTeam and can be only W, L or D (win, lose or draw).

c. Your match table must also include a column that records the scores of both teams in the match. Provide the SQL to amend the original table design to allow for this change in requirement. It is most unlikely (impossible) that a team would ever score more than 999 goals in a
match.

Question 4 - Relational Database Design

The following question is based upon the Patient-Treatment relation which records the details of transactions occurring in a medical surgery. You may assume the data are representative.

2063_diagram 1.png


You have been asked to design a relational database for this system. You know that there are problems with the current design and that it will need to be modified in order to work effectively.

You need to write a 1-2 page report that addresses the following:
1. What are the specific problems associated with the current design and why do they arise?
2. How would you change the current design and how does your new design address the problems you have identified with the current design.
In order to receive high marks for this question, you will need to demonstrate an understanding of the theories discussed in Topics 1, 2 and 3, how they apply to this problem, and justify the changes you are making to the system. Simply providing the amended design (even if it is correct) will only attract a small percentage of the marks for this question.

Question 5 - Conceptual Design

You have been asked to develop a data model for the Drip Drip Water Company (DDWC). DDWC is the sole supplier of water to the citizens and businesses of the town of Drip Drip.

Each of DDWC's customers is classified as being either residential or non-residential. Each customer may have a water meter that measures the water consumed by the customer at a particular service address. Customers may have more than one service address.

Water meters must be replaced when they have been in use for 5 years. We can assume that a meter will never be damaged or become unserviceable and will not be re-assigned to another service address.

Reference no: EM13327464

Questions Cloud

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.
If apple ipod only played itunes, and itunes only could be : If Apple iPod only played iTunes, and iTunes only could be heard on the Apple iPod, could Apple price the technologically integrated bundle any way they wanted? If other electronic music can play on an iPod, what determines whether there are any limi..
Calculate the average force on a bumper : federal statute requires that a car's bumper be designed to withstand a 2.50 mph (1.12m/s) collision with an immovable object without damage to the body of the car. Calculate the average force on a bumper

Reviews

Write a Review

Database Management System Questions & Answers

  Explain thoughts on database design process

Explain thoughts on database design process this far. You have learned about first three phases of process: defining mission statement and mission objectives, analyzing current database, and creating data structures.

  Determine the commissions paid to specific employees

Design a query that will allow the finance department to determine the commissions paid to specific employees of the sales department for the month of December.

  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.

  Explain use of sequential file over database

Explain these situations. When would the database be more beneficial than sequential file? Is it possible for two kinds of permanent storage to be used interchangeably?

  Role of metadata in data acquisition process

You are a vice president of marketing for a nation-wide appliance manufacturer with three production plants. Explain different ways you would tend to analyze your sales. What are the business dimensions for your analysis?

  Why triggers are significant in database systems

What are triggers used for, and why are they significant in database systems? Give an example of situation where a trigger would be appropriate. What would implementation of this trigger look like?

  Create a sql statement and execute the same in sqlplus

Statistics can be created on tables, indexes columns and as well as on the individual columns. But, if for some reason table or index statistics have not been updated, then this may result in a full table scan.

  Use three-sphere model for systems management

Use the three-sphere model for systems management and brainstorm issues related to the change based on the business, technology, and organization spheres.

  Create a new table named sportinggoods in database

Create a new table named SportingGoods to contain the columns PartNum, Description, OhHand, Warehouse, and Priced for all rows in which the item class is SG.

  Write methods for outlier detection

Exceptions in credit card transactions can aid us fraudulent use of credit card. Suggest two methods for outlier detection.

  Create a function

Create a function that returns the day of the week for a specified date. Create a trigger that displays the message "Emp table updated" when an update to the employee table increases the employee's basic salary.

  Pharmacy designating database

Pharmacy systems today are more efficient and user friendly when compared to the systems 20 years ago.

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