Question
  • (#3a){Screenshot.} Create a VIEW named ProductProfit that displays the Category Description, Product Description, and the Profit (SalePrice - Cost). Name the Category description column ‘Category’ and the Product description ‘Item’. The screenshot should show the SQL code to create the view and a SELECT statement displaying the records returned in descending order of the Profit column.
  • (#3b){Screenshot.} Using the ProductProfit VIEW, display the records that are in the TOP 10 Percent of Profit. The screenshot should show the SELECT statement and the records returned.
  • (#4a){Screen shot.} Create a VIEW named FamilyRide that displays the Category description, the Product Description, the Cost and the SalePrice. Name the Category description column ‘Category’ and the Product description ‘Item’. The screenshot should show the SQL code to create the view and a SELECT statement displaying the records returned in ascending order of the Item column.

Category CID Description Product PID Description CID (fk) Cost SalePrice AvailableOnline (Y, N)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

-- #3a

CREATE VIEW ProductProfit AS

SELECT C.Description AS Category, P.Description AS Item, (SalePrice - Cost) AS Profit

FROM Category C, Product P

WHERE C.CID = P.CID;


-- #3b

SELECT *

FROM ProductProfit

ORDER BY Profit DESC

LIMIT 10;

-- #4a

CREATE VIEW FamilyRide AS

SELECT C.Description AS Category, P.Description AS Item, Cost, SalePrice

FROM Category C, Product P

WHERE C.CID = P.CID;

SELECT *

FROM FamilyRide

ORDER BY Item ASC;

Add a comment
Know the answer?
Add Answer to:
(#3a){Screenshot.} Create a VIEW named ProductProfit that displays the Category Description, Product Description, and the Profit (SalePrice - Cost). Name the Category description column ‘Category’ an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using MYSQL please help (#7){Screen shot} Write a script that removes the view, the two tables, and the database, with one click of the execute button. In the screen shot, display all the SQL code, an...

    Using MYSQL please help (#7){Screen shot} Write a script that removes the view, the two tables, and the database, with one click of the execute button. In the screen shot, display all the SQL code, and show the Object Explorer after the script executes. Add records to the Category table and the Products table. One screenshot should show the SQL code and the output of a SELECT statement showing the records in the table (two screenshots, one for each table)...

  • need help Create or edit the SQL statements required to accomplish the following tasks. All columns...

    need help Create or edit the SQL statements required to accomplish the following tasks. All columns should have a column name, feel free to create appropriate aliases Use screen shots to ca evidence that each task is completed; include the SQL records before and after statements are executed, as appropriate. Include all work, even if you get errors. Paste your screen shots into a single PowerPoint file pture statements output from the statements, and views of the object explorer when...

  • Using the OrderItemProducts View, create a new View named ProductSummary. This View should return some summary...

    Using the OrderItemProducts View, create a new View named ProductSummary. This View should return some summary information about each product. We want the name of the product, the number of times the product has been ordered and the total sales for the product. Use appropriate column names. Write a SELECT statement that uses the view that you created in exercise 3 to get total sales for the five best selling products.

  • Customer Transaction Table – CUSTOMER_TXNS Column Name Description Type Account_id Account identifier Integer Txn_timestamp Time of...

    Customer Transaction Table – CUSTOMER_TXNS Column Name Description Type Account_id Account identifier Integer Txn_timestamp Time of transaction (UTC) Timestamp Product_id The id of the product purchased Integer Txn_Amt The revenue amount of the transaction Float Txn_Qty The number of items purchased Integer NOTE: Customer Transaction table has multiple records per account_id. Customer Master Table – CUSTOMER_MSTR Column Name Description Type Account_id Account identifier Integer Country Country Code Character(3) Address Address of the customer Character(64) Registerd_Dt Date the account id was...

  • Must be done in C# please! Thanks! In this assignment you will create a program named...

    Must be done in C# please! Thanks! In this assignment you will create a program named Test Scores that displays the average of all tests; average midterm score; average final score; and displays the midterm or final score of a particular student. Create a class level two dimensional integer array named Grades initialized with the following data: 897 242 301 987 116 450 865 128 992 109 88 75 94 70 90 87 81 79 97 79 78 80 92...

  • --* BUSIT 103                   Assignment   #3                       DUE DATE...

    --* BUSIT 103                   Assignment   #3                       DUE DATE : Consult course calendar                            /* You are to develop SQL statements for each task listed. You should type your SQL statements    under each task. You should always create an alias for any derived fields. Add a sort that makes    sense for each query. */ USE AdventureWorksLT2012; --1.   Build a single column of data in which...

  • Chapter 2 How to use the Management Studio Before you start the exercises... Before you start...

    Chapter 2 How to use the Management Studio Before you start the exercises... Before you start these exercises, you need to install SQL Server and the SQL Server Management Studio. The procedures for doing both of these tasks are provided in appendix A of the book. In addition, you'll need to get the Exercise Starts directory from your instructor. This directory contains some script files that you need to do these exercises. Exercises In these exercises, you'll use SQL Server...

  • If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top o...

    If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top of each page. Also, using a 12-point font, include the SQL statement and then provide a screen shot of each query. The screen shots must include both the SQL statement and the results for each item below based on the data entered in...

  • PL/SQL Auction Program 1. Create a user xyz, who is the owner of the auction. Create...

    PL/SQL Auction Program 1. Create a user xyz, who is the owner of the auction. Create the schema, and package. 2. Create users x1 and x2 who are the participants in the auction. They will need acces to the package. 3. Bid on the same item and record your observations. Verify all scenarios. Upload the files with the missing code and a detailed sample run. AUCTION OWNER.TXT SQL> conn / as sysdba Connected. SQL> drop user xyz cascade; User dropped....

  • The lab for this week addresses taking a logical database design (data model) and transforming it...

    The lab for this week addresses taking a logical database design (data model) and transforming it into a physical model (tables, constraints, and relationships). As part of the lab, you will need to download the zip file titled CIS336Lab3Files from Doc Sharing. This zip file contains the ERD, Data Dictionary, and test data for the tables you create as you complete this exercise. Your job will be to use the ERD Diagram found below as a guide to define the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT