Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In our Canvas Shell, go to CSD - 1 3 8 Resources Book Resources ( including scripts to setup our databases etc. ) to
In our Canvas Shell, go to CSD ResourcesBook Resources including
scripts to setup our databases etc. to download and the file
createmyguitarshop.sql
Then to run the file
o Copy and paste the content of the file into MySQL Workbench and run it
o Or open the file in MySQL Workbench and run it
o This will create the schema ie database titled myguitarshop
Then use the schema, myguitarshop to answer each problem in this
Assignment
Create a text file
o with a sql file extension
o At the top of the script have
use myguitarshop;
o In your sql file, for each problem
In a commented section, write
The problem number
The problem statement
followed next by your sql statement submission for the problem
Note I only want to see your last version of your sql
statement for the problem
o No listing of previous intermediate sql work
Select all data from the customers table
Select First Name and Email Address
Order result by First Name in Ascending order
Show only first rows of the result
Write query that will produce the following result for the people who have name Allan
Allan email address is allan.sherwood@yahoo.com
Select all data from OrderItems table such that itemprice discountamount
Find products that have product name starting with "Gibson" and product code is
sg
Find products with the following product codes : strat, sg washburn
Find all product that don't have following product code: strat, sgwashburn
Find all orders that have no ship date set
Write a SQL statement that selects from Products table the following information
productname The productname column
listprice The listprice column
The two columns should be joined into column and result should looks like
Find all the products that contain word Gibson
Write a SQL statement that selects these columns from the Orders table:
orderid The orderid column
shipamount The shipamount column
taxamount The taxamount column
Round the shipamount and taxamount columns rounded to decimal places.
Return only the rows with a shipamount that is greater than and taxamount is
less than
Write a SQL statement that selects these columns from the Products table:
productname The productname column
listprice The listprice column
discountpercent The discountpercent column
discountamount A column thats calculated from the previous two
columns
discountprice A column thats calculated from the previous three
columns
Only return products with listprice greater than and less than
Sort it by productname in descending sequence.
Write a SQL statement that selects these columns from the OrderItems table:
itemid The itemid column
itemprice The itemprice column
discountamount The discountamount column
quantity The quantity column
pricetotal A column thats calculated by multiplying the item
price by the quantity
discounttotal A column thats calculated by multiplying the
discount amount by the quantity
itemtotal A column thats calculated by subtracting the
discount amount from the item price and then
multiplying by the quantity
Only return rows where the itemtotal is greater than
Sort the result set by item total in descending sequence.
Write a SQL statement that selects these columns from the Orders table:
orderid The orderid column
orderdate The orderdate column
shipamount The shipamount column
shipdate The shipdate column
Round the shipamount to decimal place.
Only return data where shipdate doesnt contain null.
Limit results to rows.
Write a SQL statement without a FROM clause that uses the NOW function to create
a row with these columns:
todayunformatted The NOW function unformatted
todayformatted The NOW function in this format:
MMDDYYYY
This displays a digit number for the month, digit number of the day, and a four
digit year.
Write a SQL SELECT statement without a FROM clause that creates a row with
these columns:
Itemprice dollars
Discountpercent percent
Discountamount Itemprice multiplied by Discountpercent
Finalprice Itemprice minus Itemprice multiplied by
Discountpercent
To calculate the third column, add the expressions you used for the first and third
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started