Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using SQL Developer to execute the following queries. Copy and paste the query code into the submission box. This assignment should be completed by September

Using SQL Developer to execute the following queries. Copy and paste the query code into the submission box. This assignment should be completed by September 21.

Write a query to display the title and publisher for each book using JOIN...USING clause.

Write a query to show the first and last names of customers who have ordered computer books. Use the WHERE clause to join the tables.

Write a query to show the title and ISBN of each book in the books table. If the book has been ordered, show the order number and order date. Use the OUTER JOIN keywords to join the tables. Sort the titles in alphabetical order.

Write a query to show the gift a customer will receive if he or she orders Holy Grail of Oracle. Use either the WHERE clause or a JOIN keyword to join the tables.

Write a query to show the profit of each book sold to Jake Lucas. Calculate the profit by subtracting the cost from the paideach column in the orderitems table. Use one of the JOIN clauses to the join the tables.

Script for assignment:

CREATE TABLE warehouses (wh_id NUMBER(2), location VARCHAR(12) ); INSERT INTO warehouses VALUES (10, 'Boston'); INSERT INTO warehouses VALUES (20, 'Norfolk'); INSERT INTO warehouses VALUES (30, 'San Diego'); COMMIT; Create Table Publisher2 (ID NUMBER(2), Name VarCHAR2(23), Contact VARCHAR2(15), Phone VARCHAR2(12), CONSTRAINT publisher2_pubid_pk PRIMARY KEY(id)); INSERT INTO PUBLISHER2 VALUES(1,'PRINTING IS US','TOMMIE SEYMOUR','000-714-8321'); INSERT INTO PUBLISHER2 VALUES(2,'PUBLISH OUR WAY','JANE TOMLIN','010-410-0010'); INSERT INTO PUBLISHER2 VALUES(3,'AMERICAN PUBLISHING','DAVID DAVIDSON','800-555-1211'); INSERT INTO PUBLISHER2 VALUES(4,'READING MATERIALS INC.','RENEE SMITH','800-555-9743'); INSERT INTO PUBLISHER2 VALUES(5,'REED-N-RITE','SEBASTIAN JONES','800-555-8284'); commit; Create Table Publisher3 (ID NUMBER(2), Name VarCHAR2(23), Contact VARCHAR2(15), Phone VARCHAR2(12), CONSTRAINT publisher3_pubid_pk PRIMARY KEY(id)); INSERT INTO PUBLISHER3 VALUES(2,'PUBLISH OUR WAY','JANE TOMLIN','010-410-0010'); INSERT INTO PUBLISHER3 VALUES(3,'AMERICAN PUB','DAVID DAVIDSON','800-555-1211'); INSERT INTO PUBLISHER3 VALUES(6,'PRINTING HERE','SAM HUNT','000-714-8321'); INSERT INTO PUBLISHER3 VALUES(7,'PRINT THERE','CINDY TIKE','010-410-0010'); commit; CREATE TABLE Employees ( EMPNO NUMBER(4), LNAME VARCHAR2(20), FNAME VARCHAR2(15), JOB VARCHAR2(9), HIREDATE DATE, DEPTNO NUMBER(2) NOT NULL, MTHSAL NUMBER(7,2), MGR NUMBER(4), CONSTRAINT employees_empno_PK PRIMARY KEY (EMPNO)); INSERT INTO employees VALUES (7839,'KING','BEN', 'GTECH2','17-NOV-91',10,6000,NULL); INSERT INTO employees VALUES (8888,'JONES','LARRY','MTech2','17-NOV-98',10,4200,7839); INSERT INTO employees VALUES (7344,'SMITH','SAM','GTech1','17-NOV-95',20,4900,7839); INSERT INTO employees VALUES (7355,'POTTS','JIM','GTech1','17-NOV-95',20,4900,7839); INSERT INTO employees VALUES (8844,'STUART','SUE','MTech1','17-NOV-98',10,3700,8888); COMMIT;

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

=+ b. What is the equilibrium level of income?

Answered: 1 week ago