Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Before starting these problems, update the JustLee Books database by executing the JLDB _ Build _ 9 . sql script, otherwise, your solutions might not
Before starting these problems, update the JustLee Books database by executing the JLDBBuildsql script, otherwise, your solutions might not work!
Note: In this module, it is assumed that students already have JLDB installed so they need to run JLDBBuildsql to add the three tables to the existing DB If you do not have it installed, you need to run JLDBBuildsql first and then JLDBBuildsql
Write a SQL code to join two tables using the WHERE statement. Explain what the query is intended to do in a complete, coherent sentence with no SQL terminology.
Repeat Problem above but remove the WHERE statement. What happened? Why?
Write an SQL query to join three related tables using JOIN ON in the JustLee Books. Select fourfive columns that you would like to display in the output do not use SELECT Include one condition with a special comparison operator. Explain what the query is intended to do in a complete, coherent sentence with no SQL terminology.
Write an SQL query to join three related tables using JOIN USING in the JustLee Books. Select fourfive columns that you would like to display in the output do not use SELECT Include one condition with a special comparison operator and a logical operator. Do not use the same set of tables as before. Explain what the query is intended to do in a complete, coherent sentence with no SQL terminology.
Write an SQL query to join two tables using JOIN...ON and JOIN...USING use SELECT Did you receive the same output? Why?
Write an SQL query that lists customers last name and first name if heshe does not have the same address and shipping street and whose orders include books that have the letter a in the title. In addition, consider only the following authors: Peterson, Adams, and Austin. Explain why some customers' names appear multiple times.
Write an SQL query to create a list of employees and their managers. Use columns aliases to clearly identify mangers and employees in the output.
Modify Problem above to list all customers along with those who referred them if any
Write an SQL query to display a list of books in the BOOKS table. If a book has been ordered by a customer, also list the corresponding order number and the state in which the customer resides.
Use set operators UNION, INION ALL, INTERSECT, and MINUS to combine the results of two queries. Explain what queries are intended to do in complete, coherent sentences with no SQL terminology.
CREATE TABLE warehouses
whid NUMBER
location VARCHAR
Statement
INSERT INTO warehouses
VALUES 'Boston'
Statement
INSERT INTO warehouses
VALUES 'Norfolk'
Statement
INSERT INTO warehouses
VALUES 'San Diego'
Statement
COMMIT
Statement
Create Table Publisher
ID NUMBER
Name VarCHAR
Contact VARCHAR
Phone VARCHAR
CONSTRAINT publisherpubidpk PRIMARY KEYid
Statement
INSERT INTO PUBLISHER
VALUES'PRINTING IS US'TOMMIE SEYMOUR',
Statement
INSERT INTO PUBLISHER
VALUES'PUBLISH OUR WAY','JANE TOMLIN',
Statement
INSERT INTO PUBLISHER
VALUES'AMERICAN PUBLISHING','DAVID DAVIDSON',
Statement
INSERT INTO PUBLISHER
VALUES'READING MATERIALS INC.'RENEE SMITH',
Statement
INSERT INTO PUBLISHER
VALUES'REEDNRITE','SEBASTIAN JONES',
Statement
commit
Statement
Create Table Publisher
ID NUMBER
Name VarCHAR
Contact VARCHAR
Phone VARCHAR
CONSTRAINT publisherpubidpk PRIMARY KEYid
Statement
INSERT INTO PUBLISHER
VALUES'PUBLISH OUR WAY','JANE TOMLIN',
Statement
INSERT INTO PUBLISHER
VALUES'AMERICAN PUB','DAVID DAVIDSON',
Statement
INSERT INTO PUBLISHER
VALUES'PRINTING HERE','SAM HUNT',
Statement
INSERT INTO PUBLISHER
VALUES'PRINT THERE','CINDY TIKE',
Statement
commit
Statement
CREATE TABLE Employees
EMPNO NUMBER
LNAME VARCHAR
FNAME VARCHAR
JOB VARCHAR
HIREDATE DATE,
DEPTNO NUMBER NOT NULL,
MTHSAL NUMBER
MGR NUMBER
CONSTRAINT employeesempnoPK PRIMARY KEY EMPNO
Statement
INSERT INTO employees VALUES 'KING','BEN', 'GTECHTODATENOVDDMONYYNULL
Statement
INSERT INTO employees VALUES 'JONES','LARRY','MTechTODATENOVDDMONYY
Statement
INSERT INTO employees VALUES 'SMITH','SAM','GTechTODATENOVDDMONYY
Statement
INSERT INTO employees VALUES 'POTTS','JIM','GTechTODATENOVDDMONYY
Statement
INSERT INTO employees VALUES 'STUART','SUE','MTechTOD
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started