Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This project is designed to touch all aspects of the fundamental concepts of database design and logical/physical data modeling covered in chapters 5 and 6.

This project is designed to touch all aspects of the fundamental concepts of database design and logical/physical data modeling covered in chapters 5 and 6. You are responsible for designing, developing, and demonstrating the functionality of a database created based on a set of business specifications that you create.

This MS SQL project will introduce the various aspects of the SQL SELECT statement and the methods of retrieving data from the database tables. This project will also introduce the fundamentals of updating and deleting records. The project will utilize a set of tables that are represented by the ERD and are created and populated by the script file.

Introduction. This is where you need to outline the underlying concepts needed to discuss the project. Introduction should provide a brief summary of your report. The reader should be able to pick up from the introduction what was found out and should act as a sampler of the contents of the report.

Project description: A well written description of any project makes it possible for the indented audience (e.g. the sponsor, the executive, and the professor) to understand the concept and context of the proposed project and to realize whether to approve and finance the project or not.

Results and discussion: Explain and present your queries, diagrams, results in a logical sequence, highlighting what is important and how the data you obtained have been analyzed to provide the results you discuss. Identify major challenges, and sources of error and explain how they were dealt with.

Conclusion. This is the section in which you need to put it all together. It differs from the abstract in that, it should be more informative, something that can easily be accomplished because you may devote more words to it. You should include a concise version of your discussion, highlighting what you found out, what problems you had, and what might be done in the future to remedy them. You should also indicate how the investigation could usefully be continued. Pages, diagrams, references and tables must all be numbered

Each question is based on a single SQL statement, and the single SQL statement might contain sub-queries (additional SELECT statements) within the statement. Complete each of the exercises below.

  1. Write a query that displays a list of all customers showing the customer first name, last name, and phone number. Sort the results by customer last name, then first name.
  2. Write a query that displays each customer name as a single field in the format firstname lastname with a heading of Customer, along with their phone number with a heading of Phone. Use the IN operator to only display customers in New York, New Jersey, or Washington D.C. Sort the results by phone number.
  3. Write a query that will list all the cities that have customers with a heading of Cities. Only list each city once (no duplicates) and sort in descending alphabetical order.
  4. Write a query that displays the title of each item along with the price (with a heading of Original) and a calculated field reflecting the price with a 25% discount (with a heading of Sale). Display the sale price with two decimal places using the ROUND function. Sort by price from lowest to highest.
  5. Write a query that displays the customer_first_name, customer_last_name, and customer_city from the customers table. Use the LIKE operator to only display customers that reside in any zipcode beginning with 4.
  6. Write a query that displays the order id and order date for any orders placed from March 1, 2014 through April 30, 2014. Do this WITHOUT using the BETWEEN clauses. Format the date field as Month dd, yyyy and use a heading of Ordered.
  7. Write a query that displays the order id and order date for any orders placed during the month of May 2014. Do this using the BETWEEN clauses. Format the date field as mm/dd/yy and use a heading of Ordered.
  8. Write a query which displays the order id, customer id, and the number of days between the order date and the ship date (use the DATEDIFF function). Name this column Days and sort by highest to lowest number of days. Only display orders where this result is 15 days or more.
  9. Write a query which displays the order id, customer id and order date for all orders that have NOT been shipped, sorted by order date with the most recent order at the top.
  10. The Marketing Department has requested a new report of shipped orders for which the order was placed on either a Saturday or a Sunday. Write a query which displays the order id, order date, shipped date, along with a calculated column labeled Order_Day showing the day of the week the order was placed (use the DAYNAME function). Only display orders that have shipped and were placed on a Saturday or Sunday. Sort by order date with most recent orders at the top.
  11. Write a query to display the customers last name, phone number, and fax number but only display those customers that have a fax number.
  12. Create a statement to insert a new record into the items table with the following values:

item_id:

11

title:

Ode To My ERD

Artist_id:

15

unit_price:

15.19

Show your INSERT statement along with the results of the following SELECT query to verify that the insert worked correctly.

select * from items where item_id > 10;

  1. Create a statement to update the record inserted in the previous step to change the unit price of this item to 8.99.

item_id:

11

title:

Ode To My ERD

artist:

15

unit_price:

8.99

Show your UPDATE statement along with the results of the following SELECT query to verify that the insert worked correctly.

select * from items where item_id > 10;

  1. Create a statement to delete the entire record that was inserted and then updated in the previous steps.

Show your DELETE statement along with the results of the following SELECT query to verify that the insert worked correctly.

select * from items where item_id > 10;

  1. Using the SUBSTRING and CONCAT functions, write a query to display each customer name as a single field in the format Jones, Tom with a heading of Customer along with the customer_phone field in a nicely formatted calculated column named Phone. For example, a record containing the customer_phone value 6145535443 would be output with parentheses, spaces, and hyphens, like this: (614) 555-5443. Sort by last name.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Accounting Chapters 1-29

Authors: John J. Wild, Vernon J. Richardson, Ken W. Shaw

2nd Edition

0077398173, 978-0077398170

More Books

Students also viewed these Accounting questions