Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use SQL Developer to execute the query below. This needs to be done in SQL . Please post the code for each question number. (I

Use SQL Developer to execute the query below. This needs to be done in SQL. Please post the code for each question number. (I have also provided the tables below).

  1. Write a query to show title and the profit of each book sold to Bonita Morales. Calculate the profit by subtracting the cost from the paideach column in the orderitems table. Use the NATURAL JOIN clause to the join the tables. Use the alias PROFIT for the profit column.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Tables v Relational Tables V ACCTBONUS AMID AMSAL REGION > Constraints > Indexes V ACCTMANAGER AMID AMFIRST AMLAST AMEDATE AMSAL AMCOMM REGION > Constraints > Indexes V ACCTMANAGER2 AMID AMFIRST AMLAST AMEDATE REGION > Constraints > Indexes AUTHOR AUTHORID LNAME FNAME > Constraints > Indexes v BOOKAUTHOR ISBN AUTHORID > Constraints > Indexes V BOOKS ISBN TITLE PUBDATE PUBID COST RETAIL DISCOUNT CATEGORY Constraints > Indexes V CUSTOMERS CUSTOMER# LASTNAME FIRSTNAME ADDRESS CITY STATE ZIP REFERRED REGION EMAIL > Constraints > Indexes ORDERITEMS ORDER# ITEM# ISBN QUANTITY PAIDEACH > Constraints > Indexes ORDERS ORDER# CUSTOMER# ORDERDATE SHIPDATE SHIPSTREET SHIPCITY SHIPSTATE SHIPZIP SHIPCOST > Constraints > Indexes PROMOTION GIFT MINRETAIL MAXRETAIL > Constraints > Indexes V PUBLISHER PUBID NAME CONTACT PHONE > Constraints > Indexes TESTING ID TVALUE DESCRIP > Constraints > Indexes Database structure CUSTOMERS Customer Lastname Firstname Email Address City State Zip Referred Region ORDERS Order# Customer# Orderdate Shipdate Shipstreet Shipcity Shipstate Shipzip Shipcost ORDERITEMS Order# Item# ISBN Quantity Paideach BOOKAUTHOR AUTHOR BOOKS ISBN Author ISBN Authorld Lname Title Fname Pubdate PubID Cost Retail Discount PUBLISHER Category PubID Name PROMOTION Contact Phone Gift Minretail Maxretail

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago