Create a query to calculate the number of days

Assignment Help Database Management System
Reference no: EM131918582

Shipping Efficiency Query

You will create a query to calculate the number of days between the date an order was placed and the date the order was shipped for each order.

The result of your work will be a list of orders that took more than 30 days to ship. The salespeople will be required to review the records and report the source of the delay for each order. The CEO feels there may be issues with one of the shipping companies, and would like data to back that up.

a.Create a query using Query Design. From the Customers table, include the fields CompanyName, ContactName, ContactTitle, and Phone. From the Orders table, include the fields OrderID, OrderDate, and ShippedDate.

b.Run the query and examine the records. Save the query as Shipping Efficiency.

c.Add a calculated field named DaysToShip to calculate the number of days taken to fill each order. (Hint: The expression will include the OrderDate and the ShippedDate; the results will not contain negative numbers.)

d.Run the query and examine the results. Does the data in the DaysToShip field look accurate? Save the query.

e.Add criteria to limit the query results to include only orders that took more than 30 days to ship.

f.Add the Quantity field from the Order Details table and the ProductName field from the Products table to the query. Sort the query by ascending OrderID. When the sales reps contact these customers, these two fields will provide useful information about the orders.

g.Add the caption Days to Ship to the DaysToShip field. Switch to Datasheet view to view the results. Adjust column widths as necessary.
h.Save and close the query.

Order Summary Query

The CEO is considering the financial impact of discounts. She asked for a query showing the employee name, number of orders they have taken, and the total discount amount they have given customers. She hopes to see if there is a correlation between the discount offered and the number of sales.

a.Create a query using Query Design and add the Orders, Order Details, Products, and Customers tables. Add the fields OrderID and OrderDate from the Orders table. Set both fields' Total row to Group By.

b.Add a calculated field in the third column. Name the field ExtendedAmount. This field should multiply the quantity ordered (from the Order Details table) by the unit price for that item (from the Products table). This will calculate the total amount for each order. Format the calculated field as Currency and change the caption to Total Dollars. Change the Total row to Sum.

c.Add a calculated field in the fourth column. Name the field DiscountAmount. The field should multiply the quantity ordered, the unit price for that item, and the discount field (from the Customers table). This will calculate the total discount for each order. Format the calculated field as Currency and add a caption of Discount Amt. Change the Total row to Sum.

d.Run the query. Examine the results. Most customers should have a discount of 10% of the total dollars, but some customers will have no discount. Save the query as Order Summary. Return to Design view.

e.Add criteria to the OrderDate field so only orders made between 1/1/2016 and 12/31/2016 are displayed. Change the Total row to Where.

This expression will display only orders that were placed in 2016.

f.Run the query and view the results. Adjust column widths as necessary. Save and close the query.

Order Financing Query

The CEO would like the salespeople to discuss financing with customers. In order to do so, she would like you to create a query showing the impact on price for prior orders. This way, the reps can give customers a comparison with an order they have already placed. For the moment, she is considering a 5% interest rate, paid over 12 months. She would like you to leave the results as negative numbers.

a.Create a copy of the Order Summary query named Order Financing.

b.Open the Order Financing query in Design view and remove the DiscountAmount field.

c.Add a new field using the Expression Builder named SamplePayment. Insert the Pmt function with the following parameters:

•Use .05/12 for the rate argument (5% interest, paid monthly).

•Use the number 12 for the num_periods argument (12 months).

•Use the calculated field [ExtendedAmount] for the present_value.

•Use the value 0 for both future_value and type.

d.Change the Total row to Expression for the SamplePayment field.

e.Change the Format for the SamplePayment field to Currency.

f.Run the query and examine the results. Adjust column widths as necessary. The results appear as negative numbers, as requested. Save and close the query.

Order Summary by Country Query

The company is planning on opening up some shipping centers internationally. The previous CEO had been considering Brazil, Denmark, and Germany as potential shipping center locations, but he was working from older data. You will provide a list of total shipment value by country for the year before the current CEO started to best inform her decision making.

a.Create a copy of the Order Summary query named Order Summary by Country.

b.Open the query in Design view. Replace the OrderID field with the Country field from the Customers table.

c.Run the query and examine the summary records; there should be 21 countries listed.

d.Switch to Design view and change the sort order so that the country with the highest ExtendedAmount is first and the country with the lowest ExtendedAmount is last.

e.Run the query and verify the results. Note the ExtendedAmount field has a caption of Total Dollars, so this is the field the query will be sorted by.

f.Save and close the query.

Attachment:- Food-LastFirst.rar

Reference no: EM131918582

Questions Cloud

Develop a simple battleship game : For your CSCI 2312 Project, you will develop a simple battleship game. Battleship is a guessing game for two players. It is played on four grids
Transportation cost change with reduction in lead time : How else may lead time be reduced? Will transportation cost change with reduction in lead time? Discuss with examples?
Super? fun manufacturing plant : Note that all times are in minutes. Super? Fun's manufacturing plant is open 18 hours a? day, 5 days a? week, 7 hours on Saturday.
What associations exist between the use of informatics : What associations exist between the use of informatics and the access to, cost of, quality of, and coverage of health care?
Create a query to calculate the number of days : Create a query to calculate the number of days between the date an order was placed and the date the order was shipped for each order.
Percentage change in productivity over the past two years : What was the percentage change in productivity over the past two years?
Cost-effective health care : We are challenged to provide access to high-quality, cost-effective health care.
What would you suggest the university do to expand revenue : What would you suggest the university do to expand revenue? If you were the president of NSU, how would you tackle this problem based on what you have learned
Complete the financial statements using given information : Perform the calculations necessary to complete the following financial statements using the information provided in the given and the Excel templates provided

Reviews

Write a Review

Database Management System Questions & Answers

  Search and set up the national parks database

create a table named Park. Accept the default ID primary key field with the AutoNumber data type, renaming it as Park ID. Enter at least five additional fields, such as Name, State, Fee, Hours

  What is the value proposition that would work

How does a campaign get someone like an overweight friend of yours to exercise? What is the value proposition that would work? How would you figure out.

  Describe how indexing fields could be beneficial

The current TAL Distributors database only has a few customers; however, in reality, such a database would likely have records for thousands or hundreds of thousands of customers and their order information. Describe how indexing fields could be b..

  Create a notes and handouts header and footer with the date

Create a Notes and Handouts header and footer with the date to update automatically, Janice Compton in the header, and Dr. T. Nichols in the footer.

  Create a tree that models of the scenario

Create a tree that models the following scenario. A player decides to play a maximum of 4 times, betting on red each time. The player will quit after losing twice. In the tree, any possible last plays will be an ending point of the tree.

  Analyze the database environment

Analyze the database environment. An appropriate database environment within your workplace. Describe the objectives of the database environment.

  Schema for a customer sale database scenario

Database schema for a customer sale database scenario: customer(cust_id,cust_name) primary key(cust_id). Item(item_id,item_name,price) primary key(item_id)

  Create a database schema that supports companys processes

Prepare a database schema that supports the company's business and processes. Explain and support the database schema with relevant arguments.

  How much usage it might receive and where to set the price

YOF EWS10 H1 - Extreme H20 1. In a nearby community, there is a small river that can be used for tubing. The management is trying to figure out how much usage it might receive and where to set the price in order to make a profit.2:

  Identify and discuss the required technology stack

COIT 20253 Assignment - Creating a Big Data Strategy. Identify and discuss the required Technology Stack. Discussion on Big Data Value creation process

  Create a new connection to the oracle database

Review the text files provided for this assignment. Use NotePad++ to view each file and make any edits to the data or files.

  Explain your experiences related to your setup of mysql

Explain your experiences related to your setup of MySQL. Include any difficulties or issues that you had encountered during the installation.

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