Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hey guys.. heres my database.... im getting errors. any advice is appreciated..

ID: 3638313 • Letter: H

Question

Hey guys.. heres my database.... im getting errors. any advice is appreciated.. oh and i go to start filename.sql and i get these errors


CREATE TABLE Tech_personnel
*
ERROR at line 1:
ORA-00955: name is already used by an existing object


CREATE TABLE Users
*
ERROR at line 1:
ORA-00955: name is already used by an existing object


CREATE TABLE Categories
*
ERROR at line 1:
ORA-00955: name is already used by an existing object


network_port number NUMBER(10),
*
ERROR at line 5:
ORA-00907: missing right parenthesis


CREATE TABLE Locations
*
ERROR at line 1:
ORA-00955: name is already used by an existing object


FOREIGN KEY (owner_pplSoft) REFERENCES Users(pplSoft)
*
ERROR at line 13:
ORA-00907: missing right parenthesis


FOREIGN KEY (ticket_number) REFERENCES Tickets(ticket_number),
*
ERROR at line 8:
ORA-00942: table or view does not exist


----------------------- HERES THE DATABASE.


CREATE TABLE Tech_personnel
( pplSoft NUMBER(7) NOT NULL,
fname VARCHAR2(20),
lname VARCHAR2(20),
pittID NUMBER(6) NOT NULL,
expertise VARCHAR2(20),
office_phone VARCHAR2(20),
CONSTRAINT Tech_personnel_pk PRIMARY KEY (pplSoft, pittID));
CREATE TABLE Users
( pplSoft NUMBER(7) NOT NULL,
fname VARCHAR2(20),
lname VARCHAR2(20),
pittID NUMBER(6) NOT NULL,
office_phone VARCHAR2(20),
CONSTRAINT User_Pk PRIMARY KEY (pplSoft, pittID));

CREATE TABLE Categories
(
category_id VARCHAR2(12) NOT NULL,
category VARCHAR2(20) NOT NULL,
description VARCHAR2(30),
CONSTRAINT Categories_PK PRIMARY KEY (category_id,category));

CREATE TABLE Inventory
(
machine_name VARCHAR2(20),
IP VARCHAR2(15),
network_port number NUMBER(10),
MACADDR VARCHAR2(20),
location_id VARCHAR2(10)
);

CREATE TABLE Locations
(
location_id NUMBER(15),
location VARCHAR2(30),
building VARCHAR2(20),
notes VARCHAR2(50));

CREATE TABLE Tickets
(
ticket_number NUMBER(10) NOT NULL,
owner_pplSoft NUMBER(7) NOT NULL,
date_submitted VARCHAR2(10),
date_closed VARCHAR2(10),
days_worked_on VARCHAR2(10),
category_id NUMBER(10) NOT NULL,
machine_name VARCHAR2(20),
location VARCHAR2(20),
description VARCHAR2(30),
CONSTRAINT tickets_PK PRIMARY KEY (ticket_number)
FOREIGN KEY (owner_pplSoft) REFERENCES Users(pplSoft)
FOREIGN KEY (category_id) REFERENCES Categories(category_id
FOREIGN KEY (machine_name) REFERENCES Inventory(machine_name));


CREATE TABLE Assignment
(
ticket_number NUMBER(10) NOT NULL,
tech_pplSoft NUMBER(7) NOT NULL,
date_assigned VARCHAR2(20),
status VARCHAR2(20),
CONSTRAINT Assignment_PK PRIMARY KEY (ticket_number, tech_pplSoft),
FOREIGN KEY (ticket_number) REFERENCES Tickets(ticket_number),
FOREIGN KEY (tech_pplSoft) REFERENCES Tech_personnel(pplSoft));

Explanation / Answer

So some of the table you are trying to create, they already exist. So first try to delete them with the DROP TABLE table_name_here.
Also be careful when you try to create foregin key to a data type which has a constraint primary key with another field, you should also include thoseone.

Here is the working solution.