Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Oracle SQL Developer/Oracle Forms Builder ERROR:ORA-00001: unique constraint (BSE21BFT1.CUSTOMER_C_ID_PK) violated Need to create forms with this SQL but there are errors and I cannot create

Oracle SQL Developer/Oracle Forms Builder

ERROR:ORA-00001: unique constraint (BSE21BFT1.CUSTOMER_C_ID_PK) violated

Need to create forms with this SQL but there are errors and I cannot create new data

DROP TABLE payment CASCADE CONSTRAINTS; DROP TABLE sales_line CASCADE CONSTRAINTS; DROP TABLE inventory CASCADE CONSTRAINTS; DROP TABLE strap_material CASCADE CONSTRAINTS; DROP TABLE color CASCADE CONSTRAINTS; DROP TABLE item CASCADE CONSTRAINTS; DROP TABLE brand CASCADE CONSTRAINTS; DROP TABLE sales CASCADE CONSTRAINTS; DROP TABLE customer CASCADE CONSTRAINTS;

CREATE TABLE customer (c_id NUMBER(5), c_last VARCHAR2(30), c_first VARCHAR2(30), c_birthdate DATE, c_address VARCHAR2(30), c_city VARCHAR2(30), c_state CHAR(2), c_zip VARCHAR2(10), c_phone VARCHAR2(10), c_email VARCHAR2(50), CONSTRAINT customer_c_id_pk PRIMARY KEY (c_id));

CREATE TABLE sales (s_id NUMBER(8), c_id NUMBER(5), s_date DATE, CONSTRAINT sales_s_id_pk PRIMARY KEY (s_id), CONSTRAINT orders_c_id_fk FOREIGN KEY (c_id) REFERENCES customer(c_id));

CREATE TABLE brand (br_id NUMBER(8), br_name VARCHAR2(30), CONSTRAINT brand_b_id_pk PRIMARY KEY (br_id));

CREATE TABLE item (item_id NUMBER(8), item_desc VARCHAR2(30), item_dislay VARCHAR2(30), br_id NUMBER(8), CONSTRAINT item_item_id_pk PRIMARY KEY (item_id), CONSTRAINT item_br_id_fk FOREIGN KEY (br_id) REFERENCES brand(br_id));

CREATE TABLE color (color VARCHAR2(20), CONSTRAINT color_color_pk PRIMARY KEY (color));

CREATE TABLE strap_material (mat_id NUMBER(8), mat_desc VARCHAR2(30), CONSTRAINT material_m_id_pk PRIMARY KEY (mat_id));

CREATE TABLE inventory (inv_id NUMBER(10), item_id NUMBER(8), mat_id NUMBER(8), color VARCHAR2(20), inv_qoh NUMBER(4), inv_price NUMBER(6,2), CONSTRAINT inventory_inv_id_pk PRIMARY KEY (inv_id), CONSTRAINT inventory_item_id_fk FOREIGN KEY (item_id) REFERENCES item(item_id), CONSTRAINT inventory_mat_id_fk FOREIGN KEY (mat_id) REFERENCES strap_material(mat_id), CONSTRAINT inventory_color_fk FOREIGN KEY (color) REFERENCES color(color));

CREATE TABLE sales_line (s_id NUMBER(8), inv_id NUMBER(10), s_quantity NUMBER(4) NOT NULL, CONSTRAINT sales_line_s_id_fk FOREIGN KEY (s_id) REFERENCES sales(s_id), CONSTRAINT sales_line_inv_id_fk FOREIGN KEY (inv_id) REFERENCES inventory(inv_id), CONSTRAINT sales_line_sid_invid_pk PRIMARY KEY (s_id, inv_id));

CREATE TABLE payment (p_id NUMBER(8), p_date DATE, p_amount NUMBER(6,2), p_method VARCHAR2(30), s_id NUMBER(8), CONSTRAINT pay_p_id_pk PRIMARY KEY (p_id), CONSTRAINT pay_s_id_fk FOREIGN KEY (s_id) REFERENCES sales(s_id));

INSERT INTO CUSTOMER VALUES (1, 'Styn', 'Jones', to_date('04/09/1953', 'mm/dd/yyyy'), '1156 Water Street, Apt. #3', 'Osseo', 'WI', '54705', '7155558943','stynjones@g.com');

INSERT INTO CUSTOMER VALUES (2, 'Sylvia', 'Fox', to_date('07/10/1973', 'mm/dd/yyyy'), '7645 Wisconsin Street', 'Radisson', 'WI', '43565', '7154558965','syl21@g.com');

INSERT INTO CUSTOMER VALUES (3, 'Tommy', 'Viceroy', to_date('10/09/1993', 'mm/dd/yyyy'), '965 Smith Avenue', 'Silver Lake', 'WI', '41276', '7155554653','timvic@g.com');

INSERT INTO CUSTOMER VALUES (4, 'Danny', 'Wist', to_date('03/25/1998', 'mm/dd/yyyy'), '454 Western Boulevard', 'Apple Valley', 'WI', '87655', '7155657345','danielwist12@g.com');

INSERT INTO CUSTOMER VALUES (5, 'Vinteihero', 'Smith', to_date('07/08/1953', 'mm/dd/yyyy'), '91 Swiss Street', 'Washburn', 'WI', '98765', '7155565984','vsmith@g.com');

INSERT INTO brand VALUES (1, 'Citizen');

INSERT INTO brand VALUES (2, 'Casio');

INSERT INTO brand VALUES (3, 'Seiko');

INSERT INTO brand VALUES (4, 'Titan');

INSERT INTO brand VALUES (5, 'Tissot');

INSERT INTO brand VALUES (6, 'Polar');

INSERT INTO brand VALUES (7, 'Boss');

INSERT INTO item VALUES (1, 'Men''s Nivihawk AT','Analogue', 5);

INSERT INTO item VALUES (2, 'Ladie''s Astin Smartwatch','Digital', 6);

INSERT INTO item VALUES (3, 'Men''s Opera','Analogue', 1);

INSERT INTO item VALUES (4, 'Men''s Classic 80','Analogue', 2);

INSERT INTO item VALUES (5, 'Men''s Elecgnoc Thrill','Analogue', 3);

INSERT INTO item VALUES (6, 'Ladie''s Ocean Pearl','Analogue', 4);

INSERT INTO item VALUES (7, 'Men''s Blue Sapphire','Analogue', 5);

INSERT INTO color VALUES ('Sky Blue'); INSERT INTO color VALUES ('Light Grey'); INSERT INTO color VALUES ('Black'); INSERT INTO color VALUES ('Navy'); INSERT INTO color VALUES ('Royal'); INSERT INTO color VALUES ('Brown'); INSERT INTO color VALUES ('Blue'); INSERT INTO color VALUES ('Red'); INSERT INTO color VALUES ('Dark Blue'); INSERT INTO color VALUES ('Turquoise'); INSERT INTO color VALUES ('Bright Pink'); INSERT INTO color VALUES ('White');

INSERT INTO strap_material VALUES (1, 'Leather');

INSERT INTO strap_material VALUES (2, 'Resin');

INSERT INTO strap_material VALUES (3, 'Plastic');

INSERT INTO strap_material VALUES (4, 'Metal');

INSERT INTO strap_material VALUES (5, 'Wood');

INSERT INTO inventory VALUES (1, 2, 5, 'Sky Blue', 3, 112.99 );

INSERT INTO inventory VALUES (2, 1, 3, 'Light Grey', 7, 99.80);

INSERT INTO inventory VALUES (3, 4, 4, 'Black', 1, 92.90);

INSERT INTO inventory VALUES (4, 5, 2, 'Black', 0, 80.95);

INSERT INTO inventory VALUES (5, 3, 1, 'White', 4, 234.99);

INSERT INTO sales VALUES (1, 4, TO_DATE('08/15/2022', 'MM/DD/YYYY'));

INSERT INTO sales VALUES (2, 2, TO_DATE('06/16/2022', 'MM/DD/YYYY'));

INSERT INTO sales VALUES (3, 1, TO_DATE('04/05/2022', 'MM/DD/YYYY'));

INSERT INTO sales VALUES (4, 5, TO_DATE('10/17/2022', 'MM/DD/YYYY'));

INSERT INTO sales VALUES (5, 4, TO_DATE('11/25/2022', 'MM/DD/YYYY'));

INSERT INTO sales VALUES (6, 5, TO_DATE('12/29/2022', 'MM/DD/YYYY'));

INSERT INTO sales_line VALUES (4, 5, 1);

INSERT INTO sales_line VALUES (3, 2, 1);

INSERT INTO sales_line VALUES (6, 3, 1);

INSERT INTO sales_line VALUES (1, 1, 1);

INSERT INTO sales_line VALUES (2, 4, 1);

INSERT INTO payment VALUES (1, TO_DATE('10/17/2022', 'MM/DD/YYYY'), 245.99, 'Cash', 4);

INSERT INTO payment VALUES (2, TO_DATE('12/29/2022', 'MM/DD/YYYY'), 300.99, 'Juice', 6);

INSERT INTO payment VALUES (3, TO_DATE('11/25/2022', 'MM/DD/YYYY'), 90.99, 'Cash', 5);

INSERT INTO payment VALUES (4, TO_DATE('08/15/2022', 'MM/DD/YYYY'), 300.99, 'Juice', 1);

INSERT INTO payment VALUES (5, TO_DATE('04/05/2022', 'MM/DD/YYYY'), 124.99, 'Cash', 3);

INSERT INTO payment VALUES (6, TO_DATE('06/16/2022', 'MM/DD/YYYY'), 650.99, 'Cash', 2);

COMMIT; image text in transcribed

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions