I was wondering if there is something wrong with the query because it gives me the following error:
ORA-00942: table or view does not exist
- 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 screenShot is what I have written.]
[screenshot 2 is what they have provided me.]
Transcribed Image Text: 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'))
);
Transcribed Image Text: 1
CREATE TABLE warehouses
(wh_id NUMBER(2),
location VARCHAR(12) );
4
INSERT INTO warehouses
VALUES (10, 'Boston');
6
INSERT INTO warehouses
7
VALUES (20, 'Norfolk');
8
INSERT INTO warehouses
VALUES (30, 'San Diego');
10
СOMMIT;
11
12
Create Table Publisher2
13
(ID NUMBER(2),
Name VarCHAR2(23),
15 Contact VARCHAR2(15),
Phone VARCHAR2(12),
14
16
17
CONSTRAINT publisher2_pubid_pk PRIMARY KEY(id));
18
INSERT INTO PUBLISHER2
19 VALUES(1,'PRINTING IS US','TOMMIE SEYMOUR', '000-714-8321');
20
INSERT INTO PUBLISHER2
21
VALUES (2, 'PUBLISH OUR WAY','JANE TOMLIN','010-410-0010');
22
INSERT INTO PUBLISHER2
23
VALUES (3, 'AMERICAN PUBLISHING', 'DAVID DAVIDSON','800-555-1211');
24
INSERT INTO PUBLISHER2
25 VALUES (4,'READING MATERIALS INC.', 'RENEE SMITH','800-555-9743');
26
INSERT INTO PUBLISHER2
27 VALUES (5, 'REED-N-RITE','SEBASTIAN JONES','800-555-8284');
28
commit;
29
30
Create Table Publisher3
(ID NUMBER(2),
Name VarCHAR2(23),
Contact VARCHAR2 (15),
34 Phone VARCHAR2(12),
31
32
33
35
CONSTRAINT publisher3_pubid_pk PRIMARY KEY(id));
36
INSERT INTO PUBLISHER3
37 VALUES (2, 'PUBLISH OUR WAY','JANE TOMLIN', '010-410-0010');
38
INSERT INTO PUBLISHER3
39
VALUES (3, 'AMERICAN PUB', ' DAVID DAVIDSON', '800-555-1211');
40
INSERT INTO PUBLISHER3
41
VALUES (6, 'PRINTING HERE,'SAM HUNT', '000-714-8321');
42
INSERT INTO PUBLISHER3
43 VALUES (7,'PRINT THERE','CINDY TIKE','010-410-0010');
44
commit;
45
46
CREATE TABLE Employees (
47
EMPNO
NUMBER (4),
48
LNAME
VARCHAR2 (20),
49
FNAME
VARCHAR2 (15),
50
JOB
VARCHAR2 (9),
51
HIREDATE
DATE,
NUMBER (2) NOT NULL,
NUMBER (7,2),
NUMBER (4),
52
DEPTNO
53
MTHSAL
54
MGR
CONSTRAINT employees_empno_PK PRIMARY KEY (EMPNO));
INSERT INTO employees VALUES (7839, 'KING','BEN', 'GTECH2', TO DATE ('17-NOV-91','DD-MON-YY'),10,6000, NULL);
INSERT INTO employees VALUES (8888, 'JONES','LARRY', 'MTech2', TO_DATE ('17-NOV-98','DD-MON-YY'),10,4200,7839);
INSERT INTO employees VALUES (7344, 'SMITH','SAM','GTech1', TO_DATE('17-NOV-95','DD-MON-YY'), 20,4900,7839);
INSERT INTO employees VALUES (7355, 'POTTS','JIM','GTech1', TO_DATE('17-NOV-95','DD-MON-YY'), 20,4900,7839);
55
56
57
58
59
60
INSERT INTO employees VALUES (8844, 'STUART','SUE', 'MTech1',TO_DATE('17-NOV-98','DD-MON-YY'),10,3700,8888);
61
COMMIT;
62
ALTER TABLE employees ADD (region CHAR(2));