I was wondering if there is something wrong with the query because it gives me the following error: Q1. ORA-00942: table or view does not exist Q2. no data found - Question and queries: 1) Create a list that displays the title of each book and the name and phone number of the contact at the publisher's office for reordering each book. [the screenShot1 is what I have written.] SELECT title, contact, phone FROM Books b JOIN Publisher pb ON b.pubid = pb.pubid; CREATE TABLE Orders ( Order# NUMBER(4), Customer# NUMBER(4), OrderDate DATE NOT NULL, ShipDate DATE, ShipStreet VARCHAR2(18), ShipCity VARCHAR2(15), ShipState VARCHAR2(2), ShipZip VARCHAR2(5), ShipCost NUMBER(4, 2), CONSTRAINT orders_order#_pk PRIMARY KEY (order#), CONSTRAINT orders_customer#_fk FOREIGN KEY (customer#) REFERENCES customers(customer#) ); CREATE TABLE Customers ( Customer# NUMBER(4), LastName VARCHAR2(10) NOT NULL, FirstName VARCHAR2(10) NOT NULL, 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#), CONSTRAINT customers_region_ck CHECK (region IN ('N', 'NW', 'NE', 'S', 'SE', 'SW', 'W', 'E')) ); 2) Determine which orders haven’t yet shipped and the name of the customer who placed the order. Sort the results by the date on which the order was placed. SELECT Order#, (firstname || ' ' || lastname) name FROM orders o JOIN customers c ON o.customer# = c.customer# AND o.shipdate IS NULL;
I was wondering if there is something wrong with the query because it gives me the following error:
Q1. ORA-00942: table or view does not exist
Q2. no data found
- Question and queries:
1) Create a list that displays the title of each book and the name and phone number of the contact at the publisher's office for reordering each book.
[the screenShot1 is what I have written.]
SELECT title, contact, phone
FROM Books b JOIN Publisher pb
ON b.pubid = pb.pubid;
CREATE TABLE Orders (
Order# NUMBER(4),
Customer# NUMBER(4),
OrderDate DATE NOT NULL,
ShipDate DATE,
ShipStreet VARCHAR2(18),
ShipCity VARCHAR2(15),
ShipState VARCHAR2(2),
ShipZip VARCHAR2(5),
ShipCost NUMBER(4, 2),
CONSTRAINT orders_order#_pk PRIMARY KEY (order#),
CONSTRAINT orders_customer#_fk FOREIGN KEY (customer#)
REFERENCES customers(customer#)
);
CREATE TABLE Customers (
Customer# NUMBER(4),
LastName VARCHAR2(10) NOT NULL,
FirstName VARCHAR2(10) NOT NULL,
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#),
CONSTRAINT customers_region_ck CHECK (region IN ('N', 'NW', 'NE', 'S', 'SE', 'SW', 'W', 'E'))
);
2) Determine which orders haven’t yet shipped and the name of the customer who placed the order. Sort the results by the date on which the order was placed.
SELECT Order#, (firstname || ' ' || lastname) name
FROM orders o JOIN customers c
ON o.customer# = c.customer#
AND o.shipdate IS NULL;
Trending now
This is a popular solution!
Step by step
Solved in 2 steps