Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* Query 5. A few products in [MyGuitarShop] database have the same discount percent as others. Write a SELECT statement that returns the name and

/* Query 5. A few products in [MyGuitarShop] database have the same discount percent as others. Write a SELECT statement that returns the name and discount percent of each product that has a unique discount percent. In other words, dont include products that have the same discount percent as another product. Sort the results by the ProductName column in ascending sequence. Hint 1: a subquery that uses GROUP BY and HAVING Hint 2: 6 rows */

image text in transcribed

image text in transcribed

+ o - External Tables dbo.Addresses o Columns AddressID (PK, int, not null) CCustomerID (FK, int, null) Line1 (varchar(60), not null) Line2 (varchar(60), null) City (varchar(40), not null) State (varchar(2), not null) Zip Code (varchar(10), not null) Phone (varchar(12), not null) Disabled (int, not null) Keys + Constraints # Triggers # Indexes Statistics dbo.Administrators Columns AdminlD (PK, int, not null) EmailAddress (varchar(255), not null) Password (varchar(255), not null) FirstName (varchar(255), not null) LastName (varchar(255), not null) # Keys + Constraints # Triggers Indexes Statistics dbo.Categories o Columns CategoryID (PK, int, not null) CategoryName (varchar(255), not null) # Keys + Constraints # Triggers Indexes Statistics dbo.Customers Columns CustomerlD (PK, int, not null) EmailAddress (varchar(255), not null) Password (varchar(60), not null) FirstName (varchar(60), not null) LastName (varchar(60), not null) ShippingAddressID (int, null) BillingAddressID (int, null) # # - dbo.Orderltems Columns ItemID (PK, int, not null) - OrderID (FK, int, null) - ProductID (FK, int, null) ItemPrice (money, not null) DiscountAmount (money, not null) Quantity (int, not null) Keys Constraints Triggers Indexes Statistics dbo.Orders Columns OrderID (PK, int, not null) 6 CustomerlD (FK, int, null) OrderDate (datetime, not null) ShipAmount ( money, not null) TaxAmount (money, not null) ShipDate (datetime, null) ShipAddressID (int, not null) CardType (varchar(50), not null) CardNumber(char(16), not null) CardExpires (char(7), not null) BillingAddressID (int, not null) Keys Constraints Triggers Indexes Statistics dbo.Products Columns To ProductID (PK, int, not null) - CategoryID (FK, int, null) Product Code (varchar(10), not null) ProductName (varchar(255), not null) Description (text, not null) ListPrice (money, not null) DiscountPercent (money, not null) DateAdded (datetime, null) Keys Constraints Triggers Indexes Statistics # #

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What is the effect of word war second?

Answered: 1 week ago