Create a sql script that will produce the request

Assignment Help Database Management System
Reference no: EM132135879

SQL Assignment

In these exercises, you'll enter and run your own SELECT statements. You will use the MyGuitarShop database for these queries. If you do not already have the MyGuitarShop database, the SQL script and the instructions for creating the database are located in the Submitting Assignments module on Canvas.

Create a SQL script that will produce the requested information outlined below. After you have completed and tested the script, submit the script using the HW4 assignment link located in the Week 9 module. Include a comment at the top of the script with your name and assignment.

Also include a comment before each section of the script that identifies the exercise number. Here is an example of how the script should begin:

-- Sherry Albright (SQL Assignment)

-- Exercise 1

1. Write a SELECT statement that returns these columns from the Products table:
The ListPrice column
A column that uses the CAST function to return the ListPrice column with 1 digit to the right of the decimal point
A column that uses the CONVERT function to return the ListPrice column as an integer
A column that uses the CAST function to return the ListPrice column as an integer

2. Write a SELECT statement that returns these columns from the Products table:
The DateAdded column
A column that uses the CAST function to return the DateAdded column with its date only (year, month, and day)
A column that uses the CAST function to return the DateAdded column with its full time only (hour, minutes, seconds, and milliseconds)
A column that uses the CAST function to return the DateAdded column with just the month and day

3. Write a SELECT statement that returns these columns from the Products table:
The ListPrice column
The DiscountPercent column
A column named DiscountAmount that uses the previous two columns to calculate the discount amount and uses the ROUND function to round the result to 2 decimal places

4. Write a SELECT statement that returns these columns from the Orders table:
The OrderDate column
A column that returns the four-digit year that's stored in the OrderDate column
A column that returns only the day of the month that's stored in the OrderDate column.
A column that returns the result from adding thirty days to the OrderDate column.

Reference no: EM132135879

Questions Cloud

How strategic plan is communicated : DEVELOP AND IMPLEMENT STRATEGIC PLANS - How strategic plan is communicated effectively to team - How all required resources are organised and arranged
What is the probability that fewer : Assuming this trend continues, what is the probability that fewer than 125 bottles of beer in this particular sample are defective?
Prepare a program that asks the user to enter 10 golf scores : Design a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array.
What is the standard deviation of process distribution : A binomial process has 892 trials and a probability of success of .78 what is the standard deviation of this process distribution?
Create a sql script that will produce the request : Write a SELECT statement that returns these columns from the Products table.
Properties of the binomial distribution : Doctoral assistant ships of Ph.D students 50% have paid assistant ships. a random sample of n=200 students is chosen
What is the expected number of students : What is the expected number of students who have paid assistant ships in this sample?
Show your own very short and simple application : Show your own very short and simple application that is vulnerable to this attack. Provide another version that mitigates this issue.
What possible pairs of values a1 and a2 are returned : If transaction T2 executes with isolation level Serializable, what possible pairs of values a1 and a2 are returned by T2?

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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