Question

Advance Challenge To perform this activity, refer to the tables in the JustLee Books database. Management...

Advance Challenge

To perform this activity, refer to the tables in the JustLee Books database.

Management is proposing to increase the price of each book. The amount of the increase will be based on each book’s category, according to the following scale: Computer books, 10%; Fitness books, 15%; Self-Help books, 25%; all other categories, 3%. Create a list that displays each book’s title, category, current retail price, and revised retail price. The prices should be displayed with two decimal places. The column headings for the output should be as follows: Title, Category, Current Price, and Revised Price. Sort the results by category. If there’s more than one book in a category, a secondary sort should be performed on the book’s title.

Create a document to show management the SELECT statement used to generate the results and the results of the statement.

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

Queries used in sequence......

create database mynew;

use mynew;

create table BOOK(ISBN int PRIMARY KEY, TITLE VARCHAR(50) NULL, PUBDATE DATE NULL, PUBID INT NULL, COST DOUBLE NULL, RETAIL DOUBLE NULL, CATEGORY VARCHAR(50) NULL);

select * from BOOK;

desc BOOK;

INSERT INTO BOOK VALUES(1059831198, "BODYBUILD IN 10 MINUTES A DAY", "21-01-01", 4, 18.75, 30.95, "FITNESS");

INSERT INTO BOOK VALUES(0401140733, "REVENGE OF MICKEY", "14-12-01", 1, 14.20, 22.00, "FAMILY LIFE");

INSERT INTO BOOK VALUES(1981341710, "BUILDING A CAR WITH TOOTHPICKS", "18-03-02", 2, 37.80, 59.95, "CHILDREN");

INSERT INTO BOOK VALUES(1843172113, "DATABASE IMPLEMENTATION", "04-06-09", 3, 31.40, 55.95, "COMPUTER");

INSERT INTO BOOK VALUES(1437212490, "COOKING WITH MUSHROOMS", "28-02-01", 4, 12.50, 19.95, "COOKING");

INSERT INTO BOOK VALUES (0132149871, "HOW TO GET FASTER PIZZA", "11-11-02", 4, 17.85, 29.95, "SELF HELP");

select * from BOOK;

ALTER TABLE BOOK ADD COLUMN REVISED DOUBLE;

select * from BOOK;

UPDATE BOOK SET REVISED=(COST+COST*0.1) WHERE CATEGORY="COMPUTER";

UPDATE BOOK SET REVISED=(COST+COST*0.15) WHERE CATEGORY="FITNESS";

UPDATE BOOK SET REVISED=(COST+COST*0.25) WHERE CATEGORY="SELF HELP";

UPDATE BOOK SET REVISED=(COST+COST*0.03) WHERE CATEGORY NOT IN ("COMPUTER", "FITNESS", "SELF HELP");

select * from BOOK;

SELECT TITLE AS "Title", CATEGORY AS "Category", ROUND(COST, 2) AS "Current Price", ROUND(COST, 2) AS "Revised Price" from BOOK;

Add a comment
Know the answer?
Add Answer to:
Advance Challenge To perform this activity, refer to the tables in the JustLee Books database. Management...
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
  • Oracle 12c Chapter 13 Advanced Challenge To perform the following activity, refer to the tables in...

    Oracle 12c Chapter 13 Advanced Challenge To perform the following activity, refer to the tables in the JustLee Books database about to begin an aggressive ma The Marketing Department of JustLee Books i campaign to generate sales to repeat customers. The strategy is to look at existing customers' past purchases,  which these customers have made purchases, JustLee Books will send promotional information about other books in the category that are highly profitable books for the company. The Marketing Department has requested...

  • Write the following SQL statements in Microsoft Access by using the Books database from Week 2...

    Write the following SQL statements in Microsoft Access by using the Books database from Week 2 Assignment 2. Once complete, copy and paste the SQL statements in a Microsoft Word document: Write SQL statements: To update the publisher name from READ WITH US to READ FOR US To verify the updated name field for the publisher with ID 6 To make the following updates to the Publisher table (be careful with WHERE): Make Contact="John Travolta" for publisher with ID number...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a...

    Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a database that stores information abhout Hotel Management System. Customer (C email, name, country) Payment (Invoice id. C email, payment method, date) Invoice (Invoice id, starus, invoice description) Has (Bill id, Invoice id) Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id., room id. C email, date, period, reservation id) Rooms(Hotel id, room id. price, category) lotel (Hotel id, H...

  • Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a...

    Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a database that stores information abhout Hotel Management System. Customer (C email, name, country) Payment (Invoice id. C email, payment method, date) Invoice (Invoice id, starus, invoice description) Has (Bill id, Invoice id) Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id., room id. C email, date, period, reservation id) Rooms(Hotel id, room id. price, category) lotel (Hotel id, H...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query because Northwind Traders has decided to increase their retail prices. Write a query that shows the product name, the current price, and the new price. Make sure the new price is listed to 2 decimal points. Follow below guidelines on new retail price: a.         If the category is beverages or dairy products, increase the price by...

  • This assignment consists of a series of SQL questions. For each question, you will need to...

    This assignment consists of a series of SQL questions. For each question, you will need to include: • SQL query. • An explanation of the query. Please include explanations as a comment AFTER your query, e.g., enclosed within a /* comments block */ ). See the first example in the SQL tutorial for a comment. You don’t need to explain straightforward code in comments. Only the parts that are interesting or different, so that we understand what you did. Question-1...

  • Oracle only database: DROP TABLE ORDERITEMS; DROP TABLE Orders; DROP TABLE BOOKAUTHOR; DRO...

    oracle only database: DROP TABLE ORDERITEMS; DROP TABLE Orders; DROP TABLE BOOKAUTHOR; DROP TABLE BOOKS; DROP TABLE PROMOTION; DROP TABLE AUTHOR; DROP TABLE CUSTOMERS; DROP TABLE PUBLISHER; CREATE TABLE Customers ( Customer# NUMBER(4), LastName VARCHAR2(10) NOT NULL, FirstName VARCHAR2(10) NOT NULL, Email VARCHAR(40), Address VARCHAR2(20), City VARCHAR2(12), State VARCHAR2(2), Zip VARCHAR2(5), Referred NUMBER(4), Region CHAR(2), CONSTRAINT customers_customer#_pk PRIMARY KEY(customer#) ); INSERT INTO CUSTOMERS VALUES (1001, 'MORALES', 'BONITA', 'bomor@gmail.com', 'P.O. BOX 651', 'EASTPOINT', 'FL', '32328', NULL, 'SE'); INSERT INTO CUSTOMERS VALUES...

  • Use the SQL statements provided to create your tables. Write one SQL statement for each of...

    Use the SQL statements provided to create your tables. Write one SQL statement for each of the following problems. You can only use the conditions listed in the tasks. E.g., in task 1, you cannot manually look up pid of Information Systems undergraduate program. Here is the given code: drop table textbook_schedule cascade constraints; drop table textbook_author cascade constraints; drop table schedule cascade constraints; drop table course cascade constraints; drop table textbook cascade constraints; drop table author cascade constraints; drop...

  • Can somebody help me with my accounting project, here are the instructions: Financial Analysis Project Project...

    Can somebody help me with my accounting project, here are the instructions: Financial Analysis Project Project Requirements and Instructions Sheet Objective In accordance with the Knowledge, Skills and Abilities objectives of the course, you are required to evaluate the financial performance of a publicly traded US Corporation and write a 10 page (excluding appendix and other supporting documents) report on your findings. This event will help participants develop the ability to understand, analyze, and make decisions based on financial information—these...

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