Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

SQL Help13

Statements and query

For the final project, you will be working with a Guitar Shop.  You will need the MySQL server and MySQL workbench installed, just as it has been throughout the class. You will also need the following file:

Project Requirements:

1. Execute the attached create_my_guitar_shop.sql to create the database you will use for this project.

2. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise2_JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise2_ JAM2334209csv

· Display the product name, list price, discount_percent, discount_amount, and discount_price of all products from the Products Table, ordered by the product name.

· The discount amount can be calculated from the discount percent and the list price.  Round this to 2 decimal places.

· The discount price can be calculated from the discount amount, the discount percent, and the list price.  Round this to 2 decimal place.

· Sort the results from highest to lowest price and only show the 5 highest priced products in the results.

3. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise3_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise3_ JAM2334209.csv

· Display the customers name, from the Customers table, as lastname, firstname separated by a comma and a space.  (Ex.  Doe, John).  Sort the results by last name alphabetically, but only return the names that begin with the letters M through Z.

4. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise4_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise4_ JAM2334209.csv

· Display the lastname, firstname, orderdate, productname, itemprice, discountamount, and quantity as one result set from the Customers, Orders, Order_Items, and Products tables, using aliases for the tables. Sort the results by the last name, order date, and product name, in that order.

5. Write an SQL script that does the following. 

· Add the following product to the Products table:

· product_id: The next automatically generated ID

· category_id: 4

· product_code: dgx_640

· product_name: Yamaha DGX 640 88-Key Digital Piano

· description: Long description to come.

· list_price: 799.99

· discount_percent: 0

· date_added: Today’s date/time.

· Save this script as CIS276DA_FinalExercise5a_MEID.sql

· Save the output of this script as CIS276DA_FinalExercise5a_MEID.csv

· Update the previous record to change the discount percent to 35% instead of 0

· Save this script as CIS276DA_FinalExercise5b_ JAM2334209.sql

· Save the output of this script as CIS276DA_FinalExercise5b_ JAM2334209.csv

6. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise6_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise6_ JAM2334209.csv

· Your results should display one row for each customer that does the following:

· Display the email address from the Customers table, a count of the number of orders for each customer, and the total amount for each order (HINT:  Don’t forget about the discounts when calculating the total amount for the order!)

· Only show results for customers that have more than 1 order.

· Sort the results in descending order by the sum of the line item amounts.

7. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise7_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise7_ JAM2334209.csv

· Use an aggregate window function to display the order id from the Order_Items table along with the total amount for each order 
item in the Order_Items table. (HINT:  Don’t forget the discount!)

· Also display the total amount for each order

· Use an aggregate window function to get the average item amount for each order and display that as a column in the results.

· Use a named window for the two aggregate functions.

· Sort the results in ascending order by the order_id column

8. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise8_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise8_ JAM2334209.csv

· Use a correlated subquery to return one row per customer, representing the customer’s oldest order (the one with the earliest date). Each row should include these three columns:  email_address, order_id, and order_date.

· Sort the results by the order date and order id columns.

9. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise9_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise9_ JAM2334209.csv

· Write a SELECT statement that uses the analytic functions to get the highest and
lowest sales by product within each category. Return these columns:

· The category_name column from the Categories table

· The product_name column from the Products table

· A column named total_sales that shows the sum of the sales for each
product with sales in the Order_Items table

· A column named highest_sales that uses the FIRST_VALUE function to
show the name of the product with the highest sales within each category

· A column named lowest_sales that uses the LAST_VALUE function to
show the name of the product with the lowest sales within each category

10. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise10_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise10_ JAM2334209.csv

· add three new columns to the Products table

· Add one column for the name of the product supplier 

· Add one column for the product markup percentage that provides for three digits to the left of the decimal point and two to the right.  This column should have a default value of 50.00

· Add one column for the date and time that the product was added to the database

· Display the new structure of the table and save that to the csv file.

11. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise11_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise11_ JAM2334209.csv

· Create a view named order_item_products that returns columns from the Orders,
Order_Items, and Products tables.

· This view should return these columns from the Orders table: order_id, order_date,
tax_amount, and ship_date.

· This view should return the product_name column from the Products table.

· This view should return these columns from the Order_Items table: item_price,
discount_amount, final_price (the discount amount subtracted from the item price),
quantity, and item_total (the calculated total for the item).

12. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise12_ JAM2334209.sql . Save the output of this script as CIS276DA_FinalExercise12_ JAM2334209.csv

· Write and execute a script that creates a user with a username and password of yourchoosing. This user should be able to connect to MySQL from any computer. This user should have SELECT, INSERT, UPDATE, and DELETE privileges for the Customers, Addresses, Orders, and Order_Items tables of the My Guitar Shop database. However, this user should only have SELECT privileges for the Products and Categories tables. Also, this user should not have the right to grant privileges to other users.

· Check the privileges for the user by using the SHOW GRANTS statement

Project Submission

1. Place all your script files (12) and CSV files (12) in a folder labeled “Final Project”.

2. Replace “MEID” in the file names with your actual MEID.

3. Zip the entire “Final Project” folder as described in the Syllabus.

4. Submit the zipped assignment folder using the link below.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

computering part 7

The goal of this project is to integrate your various components into polished, professional products. Follow the instructions below to ensure a successful submission: Apply Feedback: Review and incorporate all feedback received from previous submissions (Parts 2-6). Enhance and Improve: Refine any of the three required items (cover letter with

Discussion and Replies

Please see attachment for instructions     Discussion   In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Based on the readings this week, 1. Discuss some common strategies and pitfalls you have seen with business continuity. 2. Discuss some common strategies and

sociology

The goal of this project is to integrate your various components into polished, professional products. Follow the instructions below to ensure a successful submission: Apply Feedback: Review and incorporate all feedback received from previous submissions (Parts 2-6). Enhance and Improve: Refine any of the three required items (cover letter with

Python

  Instructions Create a simple Python application (Save as w5_firstname_lastname.py) . Create a Python script that takes two parameters to do the following:- 1) List all files names, size, date created in the given folder 2) Parameter1 = Root Folder name Parameter2= File size >>> to filter file size (

Python

  Instructions:  Describe methods for securing Python code. Pick at least ONE of the methods for securing node and deep dive into what it means and how it is used to secure code.   

Discussion 8 of 459

Follow the attach instruction to complete the work. 1. What is one specific technology you found the most intriguing throughout the course? 2. If you were to be a hacker, which building block vector would you choose to attack your selected technology and why?

WK 4 Discussion and Replies

Please see attachment for instructions     Discussion   In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Discussion on access control and physical security. These areas found to be one or more points of weakness in audit 1. Discuss some common points of

Node.js

  Instructions Create a simple Node.js server (Save as w4_firstname_lastname.js) . Create a restful application similar to the one in lesson 4 (ReSTFul Web Services). Document the routing table, and the application you created. Submit your week 4 work in w4_firstname_lastname.txt (Please save the file as a text file and

Computer Science- Python Gurobi assignment

I need the output following these steps: Put all of these files into the same folder, Open the python file, If there is any error, check if any file is missing, It has 105 counties and 4 districts, so it will take a while to finish running. I need it

Research Project

Please follow the instructions attached below:  I have choose the topic from the list is:   PROJECT TITLE Firm RTOS – Balancing Real-Time Performance and Flexibility Please check the abstract from my file and write the research project. 

provide me java based interview question.

Core Java Interview Questions (Basic Level) 1. What is Java? Java is a high-level, object-oriented, platform-independent programming language developed by Sun Microsystems. 2. What are the features of Java?  Object-Oriented  Platform Independent (via JVM)  Secure and Robust  Multithreaded  Architecture Neutral  High Performance (via JIT

Dynamons world Mod APK

 What are the best tips for playing RPG games like Dynamons World? I recently found a great resource at that offers a lot of insights and even MOD APKs for Dynamons World, but I’d love to hear personal strategies and gameplay advice from the community too! ???????? 

459 w7

Follow the attach instructions to complete this work. Questions: 1. What is Generative AI and how is it similar/different to Traditional AI? 2. Do you believe that work created by Generative AI (e.g. ChatGPT) is comparable in quality to human created content?  What challenges and opportunities  does Generative AI pose

Computer Science WK3 Assignment

Please see attachment for instructions ISSC680 Week 3 Homework Assignment Instructions: Please provide a one-page response to the following topic utilizing supporting documentation obtained from the attach books and the Internet. APA format and reference. Topic: Differentiate between the different types of cryptographic algorithms.

Discussion and Replies

Please see attachment for instructions     Discussion   In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Based on this weeks readings, 1. Discuss some effective strategies for Security Awareness in your organization or 2. What you would like to see implemented