ERROR = SQL state: 42703 while trying to insert data into my table - sql

I have a SQL state:
42703 ERROR (ERROR: column "datereq" of relation "eventrequest" does not exist)
while trying to insert data into my table. But I don't see any issue. Can you please help? It is the DATEREQ values that don't seem to match with the DateReq column in the "eventrequest" table.
Below is the code I have written
Table:
CREATE TABLE EventRequest
(EventNo VARCHAR(8) CONSTRAINT EventNoNotNull NOT NULL,
DateHeld DATE CONSTRAINT DateHeldNotNull NOT NULL,
DateReq DATE CONSTRAINT DATEREQNotNull NOT NULL,
CustNo VARCHAR(8) CONSTRAINT CustNoNotNull NOT NULL,
FacNo VARCHAR(8) CONSTRAINT FacNoNotNull NOT NULL,
DateAuth DATE,
Status VARCHAR(10) CONSTRAINT StatusNotNull NOT NULL CHECK (Status IN('pending','Denied','Approved')),
EstCost DECIMAL(12,2) CONSTRAINT EstCostNotNull NOT NULL,
EstAudience INTEGER CONSTRAINT EstAudienceNotNull NOT NULL CHECK (EstAudience>0),
BudNo VARCHAR(10),
CONSTRAINT PK_EVENTREQUEST PRIMARY KEY (EventNo),
CONSTRAINT FK_FACNO FOREIGN KEY (FacNo)
REFERENCES FACILITY (FacNo),
CONSTRAINT FK_CUSTNO FOREIGN KEY (CustNo)
REFERENCES CUSTOMER (CustNo) );
Data input:
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E100','2018-10-25','2018-06-06','C100','F100','2018-06-08','Approved',5000,80000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E101','2018-10-26','2018-07-28','C100','F100',NULL,'Pending',5000,80000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E103','2018-09-21','2018-07-28','C100','F100','2018-08-01','Approved',5000,80000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E102','2018-09-14','2018-07-28','C100','F100','2018-07-31','Approved',5000,80000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E104','2018-12-03','2018-07-28','C101','F101','2018-07-31','Approved',2000,12000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E105','2018-12-05','2018-07-28','C101','F101','2018-08-01','Approved',2000,10000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E106','2018-12-12','2018-07-28','C101','F101','2018-07-31','Approved',2000,10000,'B1000');
Insert into EVENTREQUEST (EVENTNO,DATEHELD,DATEREQ,CUSTNO,FACNO,DATEAUTH,STATUS,ESTCOST,ESTAUDIENCE,BUDNO) values ('E107','2018-11-23','2018-07-28','C105','F100','2018-07-31','Denied',10000,5000,null);

Related

Invalid Foreign Key value in Teradata

I am getting an invalid foreign key value and I cannot figure out what it is, here is the error.
Executed as multiple statements.
STATEMENT 1:
DATABASE completed. 0 rows processed. Elapsed time = 00:00:00.047
STATEMENT 2:
Insert Statement failed. Failed [2700 : 23000] Referential constraint violation: invalid foreign key value.
This happens when I try to insert:
insert into SALE values (1,30.45,'2020-12-31','VMBNH',1,1);
into the SALE Table
Here is the table, and I am also including the inserts that I already put on the table.
CREATE TABLE EQUIPMENT_DETAIL
(
EquipDetailID INT NOT NULL,
Make VARCHAR(20) NOT NULL,
Equipment_Type VARCHAR(20) NOT NULL,
Model VARCHAR(20) NOT NULL,
PRIMARY KEY (EquipDetailID)
);
CREATE TABLE CUSTOMER
(
CustID INT NOT NULL,
CustName VARCHAR(40) NOT NULL,
CustCategory VARCHAR(20) NOT NULL,
PRIMARY KEY (CustID)
);
CREATE TABLE EQUIPMENT
(
SerialNo VARCHAR(20) NOT NULL,
LastInspectedDate DATE NOT NULL,
DateMade DATE NOT NULL,
EquipDetailID INT NOT NULL,
PRIMARY KEY (SerialNo),
FOREIGN KEY (EquipDetailID) REFERENCES EQUIPMENT_DETAIL(EquipDetailID)
);
CREATE TABLE SALE
(
SaleTransID INT NOT NULL,
Price DECIMAL(4,2) NOT NULL,
Sale_Date DATE NOT NULL,
SerialNo VARCHAR(20) NOT NULL,
CustID INT NOT NULL,
SRepID INT NOT NULL,
PRIMARY KEY(SaleTransID),
FOREIGN KEY (SerialNo) REFERENCES EQUIPMENT(SerialNo),
FOREIGN KEY (CustID) REFERENCES CUSTOMER(CustID),
FOREIGN KEY (SRepID) REFERENCES SALES_REP(SRepID)
);
CREATE TABLE RENTAL
(
Price DECIMAL(4,2) NOT NULL,
Rental_Date DATE NOT NULL,
RentTransID INT NOT NULL,
SerialNo VARCHAR(20) NOT NULL,
CustID INT NOT NULL,
SRepID INT NOT NULL,
PRIMARY KEY (RentTransID),
FOREIGN KEY (SerialNo) REFERENCES EQUIPMENT(SerialNo),
FOREIGN KEY (CustID) REFERENCES CUSTOMER(CustID),
FOREIGN KEY (SRepID) REFERENCES SALES_REP(SRepID)
);
CREATE TABLE SALES_REP
(
SRepID INT NOT NULL,
SRepLName VARCHAR(40) NOT NULL,
SRepFName VARCHAR(20) NOT NULL,
Rank_ID VARCHAR(20) NOT NULL,
Mentors_SRepID INT,
PRIMARY KEY (SRepID),
FOREIGN KEY (Mentors_SRepID) REFERENCES SALES_REP(SRepID)
);
insert into EQUIPMENT_DETAIL values (1,'CFT','Drill','B123');
insert into EQUIPMENT_DETAIL values (2,'CFT','Hammer','B124');
insert into EQUIPMENT_DETAIL values (3,'MKT','Saw','M123');
insert into EQUIPMENT_DETAIL values (4'MKT','Wrench','M124');
insert into EQUIPMENT_DETAIL values (5'SNP','Flat Head','S123');
insert into CUSTOMER values (1,'Jim Halpert','A');
insert into CUSTOMER values (2,'Michael Scott','B');
insert into EQUIPMENT values ('KDJHS','2021-01-12','2010-11-11',1);
insert into EQUIPMENT values ('VMBNH','2021-03-05','2007-12-12',2);
insert into EQUIPMENT values ('QIEIR','2021-03-05','2007-12-12',3);
insert into EQUIPMENT values ('PTPYO','2021-03-05','2007-12-12',4);
insert into EQUIPMENT values ('AGSGD','2021-03-05','2007-12-12',5);
I had to drop the foreign key constraint from SALE (SRepID)

Locking Order of table with foreign key constraint?

If I create a schema such as the following:
create table org
(
org_id bigint not null auto_increment,
name varchar(255) not null,
primary key(org_id)
);
create table user
(
user_id bigint not null auto_increment,
name varchar(255) not null,
org_id bigint not null,
primary key(user_id),
foreign key(org_id) references org (org_id)
);
Where the org table has one entry:
insert into org (name) values ('org 1');
If I run the following sql statement:
insert into user (name, org_id) values ('user 1', 1);
In what order will the tables be locked? Is it deterministic? What if there were a second foreign key constraint to another table?

Error ORA-02291: integrity constraint

I keep getting this error when trying to populate my DB tables.
This is the code to create my tables:
CREATE table tbcustomer (
customerid char(4) not null constraint rg_customerid check (customerid between '1000' and '4999') constraint pk_customer primary key,
customername varchar2(40) not null,
customeraddress varchar2(50) null,
customercity varchar2(30) null,
customerstate char(2) null,
customerzip varchar2(10) null,
customercontact varchar2(30) null,
customerphone varchar2(12) null,
customeremail varchar2(50) null);
CREATE table tborder (
orderno number(11,0) not null constraint pk_order primary key,
orderdate date not null,
customerid char(4) not null constraint fk_customerid_tborder references tbcustomer on delete cascade);
CREATE table tbproduct (
productid char(3) not null constraint pk_product primary key constraint rg_productid check (productid between '100' and '999'),
productname varchar2(30) not null,
budgetsales number(4,0));
CREATE table tbvendor (
vendorid char(4) not null constraint pk_vendor primary key constraint rg_vendorid check (vendorid between '5000' and '9999'),
vendorname varchar2(25) not null,
vendoraddress varchar2(50) null,
vendorcity varchar2(30) null,
vendorstate char(2) null,
vendorzip varchar2(10) null);
CREATE table tbitem (
productid char(4) not null,
vendorid char(4) not null,
itemprice number(10,2) null constraint rg_itemprice check (itemprice>=0.00),
qoh number(8,0) not null,
constraint fk_productid_tbitem foreign key (productid) references tbproduct (productid),
constraint fk_vendorid foreign key (vendorid) references tbvendor (vendorid),
constraint pk_item primary key (productid, vendorid));
CREATE table tborderitem (
orderno number(11,0) not null constraint fk_orderno_tbborderitem references tborder (orderno) on delete cascade,
orderitemno char(2) not null,
productid char(3) not null,
vendorid char(4) not null,
quantity number(4,0) not null,
itemprice number(10,2) null,
constraint pk_orderitem primary key (orderno, orderitemno));
constraint fk_productid_vendorid foreign key (productid, vendorid) references tbitem (productid, vendorid) on delete cascade);
And this the code I use to populate my tables:
INSERT into tbcustomer values ('1123','Z Best','123 Main Street','Cambridge','MA','02139','Carol Jenkins','617-555-2222','jenskinssc#abc.com');
INSERT into tbcustomer values ('1234','Pop Shop','2233 Spring Street','Boston','MA','02114','Mandy Peters','617-344-1111','mpeters#def.com');
INSERT into tbcustomer values ('1667','Zoom','4545 Winter Street','Boston','MA','02112','James Hughes','617-433-3333','jhughes#zoomco.com');
INSERT into tbvendor values ('5100','Wesell','233 South Willow Street','Manchester','NH','03102');
INSERT into tbvendor values ('5200','Givin', '33 Harvard Place','Boston','MA','02211');
INSERT into tbvendor values ('5300','Z A List','4500 Summer Street','Quincy','MA','02161');
INSERT into tbproduct values ('100','Microwave','40');
INSERT into tbproduct values ('121','Toaster','30');
INSERT into tbproduct values ('434','Steamer','40');
INSERT into tbproduct values ('677','Coffee Maker','20');
INSERT into tborder values ('1','10-OCT-12','1667');
INSERT into tborder values ('2','12-OCT-12','1234');
INSERT into tborder values ('3','13-OCT-12','1667');
INSERT into tbitem values ('100','5100','55','22');
INSERT into tbitem values ('100','5200','66','20');
INSERT into tbitem values ('100','5300','70','35');
INSERT into tbitem values ('121','5100','12','20');
INSERT into tbitem values ('121','5300','15','15');
INSERT into tbitem values ('434','5100','18','35');
INSERT into tbitem values ('434','5200','25','25');
INSERT into tbitem values ('677','5100','40','20');
INSERT into tbitem values ('677','5200','46','30');
INSERT into tbitem values ('677','5300','48','20');
INSERT into tborderitem values ('1','01','100','5300','5','70');
INSERT into tborderitem values ('1','02','100','5100','5','55');
INSERT into tborderitem values ('1','03','121','5100','5','12');
INSERT into tborderitem values ('2','01','100','5200','10','65');
INSERT into tborderitem values ('2','02','677','5300','5','48');
INSERT into tborderitem values ('3','01','121','5100','5','12');
INSERT into tborderitem values ('3','02','677','5300','3','45');
INSERT into tborderitem values ('3','03','100','5100','2','55');
When I run the script I keep getting this error when inserting values to the tbitem table:
60-SQL>INSERT into tbitem values ('677','5300','48','20');
INSERT into tbitem values ('677','5300','48','20')
*
ERROR at line 1:
ORA-02291: integrity constraint (MQUIJANO.FK_PRODUCTID_TBITEM) violated -parent key not found
I also get the same error when trying to insert values into the tborderitem:
60-SQL>INSERT into tborderitem values ('1','01','100','5300','5','70');
INSERT into tborderitem values ('1','01','100','5300','5','70')
*
ERROR at line 1:
ORA-02291: integrity constraint (MQUIJANO.FK_PRODUCTID_VENDORID) violated -parent key not found
How can I fix this?
The problem may be that you do not have the same field types for your keys in the first example. Notice that in tbproduct you said:
productid char(3)
And in tbitem you said:
productid char(4)
And again in border item you said:
productid char(3)
Try changing the tbitem table to have productid with a length of 3.

Msg 2627, occured while using IDENT_CURRENT()

DDL:
CREATE TABLE OSOBA
(
id INT PRIMARY KEY not null IDENTITY,
imie VARCHAR(30) not null,
nazwisko VARCHAR(40) not null,
zawod VARCHAR(30) not null,
dataUrodzenia DATE,
plec BIT not null,
narodowosc VARCHAR(30) not null,
);
CREATE TABLE OSOBISTOSCI
(
nazwaMiasta VARCHAR(30) not null,
id INT not null,
adres VARCHAR(50),
czy BIT,
PRIMARY KEY (id),
FOREIGN KEY (id) REFERENCES OSOBA,
FOREIGN KEY (nazwaMiasta) REFERENCES MIASTA,
);
CREATE TABLE ARCHITEKCI
(
id INT not null,
uprawnienia VARCHAR(30) UNIQUE,
styl VARCHAR(30) not null,
liczba INT not null,
PRIMARY KEY (id),
FOREIGN KEY (id) REFERENCES OSOBA,
);
And I have these insert statements:
-- these work fine
INSERT INTO OSOBA (imie,nazwisko,zawod,dataUrodzenia,plec,narodowosc) VALUES ('Lech', 'Wałęsa', 'Elektryk', '19430129', 1, 'Polak');
INSERT INTO OSOBISTOSCI (nazwaMiasta, id, adres, czy) VALUES ('Gdańsk', IDENT_CURRENT('OSOBA'), 'ul. Polanki', 0);
-- these throw the below error message
INSERT INTO OSOBA (imie,nazwisko,zawod,dataUrodzenia,plec,narodowosc) VALUES ('Marcia','Frank','Architekt','19570720','0','Niemiec');
INSERT INTO ARCHITEKCI (id,styl,liczba) VALUES (IDENT_CURRENT('OSOBA'),'Nowoczesny',8);
Error:
Msg 2627, Level 14, State 1, Line 124
Violation of UNIQUE KEY constraint 'UQ_ARCHITEK_982D973E2BA18BE7'. Cannot insert duplicate key in object 'dbo.ARCHITEKCI'. The duplicate key value is ().
As Aaron mentioned the IDENT_CURRENT is not very reliable. It would be better to use an OUTPUT clause. See the following example:
DECLARE #LatestID TABLE (ID INT);
INSERT INTO #OSOBA (imie,nazwisko,zawod,dataUrodzenia,plec,narodowosc)
OUTPUT INSERTED.ID INTO #LatestID
VALUES ('Marcia','Frank','Architekt','19570720','0','Niemiec');
INSERT INTO #ARCHITEKCI (id,styl,liczba) VALUES ((SELECT ID FROM #LatestID),'Nowoczesny',8);

difficulty inserting values in database

I have created my tables as shown below (I am using Oracle XE). The problem that occurs is that when I try to insert values into the tables, I get an error because the value of one's foreign key, has not been entered as a primary key of the other. For example, see tables DEPARTMENT and EMPLOYEE. Below, along with table creation code, is also the data inserting part. How to bypass that problem?
CREATE TABLE DEPARTMENT
(
DNAME VARCHAR(10),
DEPTID INTEGER NOT NULL,
MNG_IDNO INTEGER NOT NULL,
PRIMARY KEY (DEPTID)
);
CREATE TABLE EMPLOYEE
(
IDNO INTEGER NOT NULL,
FNAME VARCHAR(10) NOT NULL,
LNAME VARCHAR(10) NOT NULL,
GENDER VARCHAR(6) NOT NULL,
CITY VARCHAR(20),
AREA VARCHAR(20),
STREET VARCHAR(50),
HOUSENO VARCHAR(4),
ZIPCODE INTEGER,
BIRTHDAY DATE,
SALARY INTEGER,
IBAN VARCHAR(34),
DEPT_ID INTEGER NOT NULL,
PRIMARY KEY (IDNO)
);
CREATE TABLE CUSTOMER
(
IDNO INTEGER NOT NULL,
FNAME VARCHAR(10) NOT NULL,
LNAME VARCHAR(10) NOT NULL,
GENDER VARCHAR(6) NOT NULL,
CITY VARCHAR(20),
AREA VARCHAR(20),
STREET VARCHAR(50),
HOUSENO VARCHAR(4),
ZIPCODE INTEGER,
BIRTHDAY DATE,
PRIMARY KEY (IDNO)
);
CREATE TABLE CAR
(
VIN INTEGER NOT NULL,
BRAND VARCHAR(10) NOT NULL,
MODEL VARCHAR(10) NOT NULL,
COLOR VARCHAR(10) NOT NULL,
TRANTYPE VARCHAR(10) NOT NULL,
FUELTYPE VARCHAR(10) NOT NULL,
ENGCC INTEGER NOT NULL,
ENTRYDATE DATE,
PRICE INTEGER NOT NULL,
PAYMENTMETHOD VARCHAR(10) NOT NULL,
DEPT_ID INTEGER NOT NULL,
CUST_IDNO INTEGER NOT NULL,
PRIMARY KEY (VIN)
);
CREATE TABLE CAR_PARTS
(
PARTNUM VARCHAR(25) NOT NULL,
PARTNAME VARCHAR(25) NOT NULL,
COST INTEGER NOT NULL,
PRIMARY KEY (PARTNUM)
);
CREATE TABLE USED_CAR
(
CAR_VIN INTEGER NOT NULL,
MILEAGE INTEGER NOT NULL,
REGDATE DATE NOT NULL,
PRIMARY KEY (CAR_VIN)
);
CREATE TABLE SERVICE
(
DUE_DATE DATE,
ARR_DATE DATE,
COST INTEGER NOT NULL,
SERVICE_NUM INTEGER NOT NULL,
CUST_IDNO INTEGER NOT NULL,
PAYMENTMETHOD VARCHAR(10) NOT NULL,
CAR_VIN INTEGER NOT NULL,
PRIMARY KEY (SERVICE_NUM)
);
CREATE TABLE CUST_PHONUMBER
(
PHONE_NUM INTEGER NOT NULL,
CUST_IDNO INTEGER NOT NULL,
PHONE_TYPE VARCHAR(10),
PRIMARY KEY (CUST_IDNO, PHONE_NUM)
);
CREATE TABLE CAR_DEFECTS
(
DEFECTS VARCHAR(100) NOT NULL,
CAR_VIN VARCHAR(100) NOT NULL,
PRIMARY KEY (DEFECTS, CAR_VIN)
);
CREATE TABLE EMPLOYEE_PHONUMBER
(
PHONENUM INTEGER NOT NULL,
EMPL_IDNO INTEGER NOT NULL,
PRIMARY KEY (PHONENUM, EMPL_IDNO)
);
CREATE TABLE SERVICE_DETAILS
(
SERVICENUM INTEGER NOT NULL,
PROBLEMS VARCHAR(100) NOT NULL,
SOLUTION VARCHAR(100),
PRIMARY KEY (PROBLEMS, SERVICENUM)
);
CREATE TABLE HAS
(
PART_NUM VARCHAR(25) NOT NULL,
CAR_VIN INTEGER NOT NULL,
PRIMARY KEY (PART_NUM, CAR_VIN)
);
CREATE TABLE USES
(
PART_NUM VARCHAR(25) NOT NULL,
SERVICE_NUM INTEGER NOT NULL,
PRIMARY KEY (PART_NUM, SERVICE_NUM)
);
ALTER TABLE DEPARTMENT ADD FOREIGN KEY (MNG_IDNO) REFERENCES EMPLOYEE(IDNO);
ALTER TABLE EMPLOYEE ADD FOREIGN KEY (DEPT_ID) REFERENCES DEPARTMENT(DEPTID);
ALTER TABLE CAR ADD FOREIGN KEY (DEPT_ID) REFERENCES DEPARTMENT(DEPTID);
ALTER TABLE CAR ADD FOREIGN KEY (CUST_IDNO) REFERENCES CUSTOMER(IDNO);
ALTER TABLE SERVICE ADD FOREIGN KEY (CUST_IDNO) REFERENCES CUSTOMER(IDNO);
ALTER TABLE SERVICE ADD FOREIGN KEY (CAR_VIN) REFERENCES CAR(VIN);
ALTER TABLE USED_CAR ADD FOREIGN KEY (CAR_VIN) REFERENCES CAR(VIN);
ALTER TABLE HAS ADD FOREIGN KEY (PART_NUM) REFERENCES CAR_PARTS(PARTNUM);
ALTER TABLE HAS ADD FOREIGN KEY (CAR_VIN) REFERENCES CAR(VIN);
ALTER TABLE USES ADD FOREIGN KEY (PART_NUM) REFERENCES CAR_PARTS(PARTNUM);
ALTER TABLE USES ADD FOREIGN KEY (SERVICE_NUM) REFERENCES SERVICE(SERVICE_NUM);
ALTER TABLE CUSTOMER_PHONUMBER ADD FOREIGN KEY (CUST_IDNO) REFERENCES CUSTOMER(IDNO);
ALTER TABLE EMPLOYEE_PHONUMBER ADD FOREIGN KEY (EMPL_IDNO) REFERENCES EMPLOYEE(IDNO);
ALTER TABLE SERVICE_DETAILS ADD FOREIGN KEY (SERVICENUM) REFERENCES SERVICE(SERVICE_NUM);
Data Insert:
INSERT INTO EMPLOYEE VALUES (1234,'ANTREAS','GEORGIOU','MALE','NICOSIA','STROVOLOS','PANAYIAS','12',2682,TO_DATE('01.01.1989', 'DD.MM.YYYY'),5000,9999999,1);
INSERT INTO EMPLOYEE VALUES (1235,'KOSTAS', 'KOSTA', 'MALE', 'NICOSIA','STROVOLOS','VIZANTIOU','12',2064,TO_DATE('01.02.1980', 'DD.MM.YYYY'),5000,9999998,2);
INSERT INTO EMPLOYEE VALUES (1236,'MARIA', 'ANTREOU', 'FEMALE', 'NICOSIA','EGKOMI','TSAROU','12',2522,TO_DATE('05.05.1988', 'DD.MM.YYYY'),5000,9999995,3);
INSERT INTO EMPLOYEE VALUES (1237,'GEORGIA', 'ANTREOU', 'FEMALE', 'NICOSIA','EGKOMI','TSAROU','13',2522,TO_DATE('05.05.1978', 'DD.MM.YYYY'),5000,9999996,4);
INSERT INTO DEPARTMENT VALUES ('SERVICE',1,1234);
INSERT INTO DEPARTMENT VALUES ('SALES',2,1235);
INSERT INTO DEPARTMENT VALUES ('ACCOUNTING',3,1236);
INSERT INTO DEPARTMENT VALUES ('MANAGEMENT',4,1237);
INSERT INTO CUSTOMER VALUES (4321, 'ANTREAS', 'ANTREOU','MALE','PAFOS','GEROSKIPOU','VIZANTIOU','3',2525,TO_DATE('04.04.1954','DD.MM.YYYY'));
INSERT INTO CUSTOMER VALUES (4322, 'MARIA', 'ANTREOU','FEMALE','PAFOS','GEROSKIPOU','VIZANTIOU','7',2525,TO_DATE('03.03.1953','DD.MM.YYYY'));
INSERT INTO CUSTOMER VALUES (4323, 'KOSTAS', 'ANTREOU','MALE','PAFOS','GEROSKIPOU','VIZANTIOU','3',2525,TO_DATE('04.04.1970','DD.MM.YYYY'));
INSERT INTO CUSTOMER VALUES (4324, 'ELENA', 'ANTREOU','MALE','PAFOS','GEROSKIPOU','VIZANTIOU','3',2252,TO_DATE('04.04.1985','DD.MM.YYYY'));
INSERT INTO CUSTOMER VALUES (4325, 'MARIOS', 'ANTREOU','MALE','PAFOS','GEROSKIPOU','VIZANTIOU','3',2525,TO_DATE('04.04.1987','DD.MM.YYYY'));
INSERT INTO CAR VALUES (1111111111, 'MAZDA', '3', 'BLUE', 'MANUAL', 'PETROL', 1600, TO_DATE('08.01.2013','DD.MM.YYYY'), 5000, 'CASH', 2, 4321);
INSERT INTO CAR VALUES (2222222222, 'TOYOTA', 'COROLLA','BLACK', 'MANUAL','PETROL',1600,TO_DATE('08.01.2013','DD.MM.YYYY'),7000,'FINANCE',2,4322);
INSERT INTO CAR VALUES (3333333333, 'TOYOTA', 'HILUX', 'GRAY', '4X4', 'DIESEL', 2500, TO_DATE('08.01.2013','DD.MM.YYYY'), 10000, 'CASH', 2 , 4325);
INSERT INTO CAR VALUES (4444444444, 'HONDA', 'CIVIC', 'BLACK', 'MANUAL', 'PETROL', 1300, TO_DATE('08.01.2013','DD.MM.YYYY'), 3000,'CASH', 2, 4323);
INSERT INTO CAR VALUES (5555555555, 'HONDA', 'INSIGHT', 'WHITE', 'AUTO', 'PETROL', 1500, TO_DATE('08.01.2013','DD.MM.YYYY'), 20000, 'FINANCE', 2, 4324);
INSERT INTO CAR_PARTS VALUES ('A20005B', 'RIGHT FRONT AXLE', 200);
INSERT INTO CAR_PARTS VALUES ('C15220C', 'AIR FILTER', 50);
INSERT INTO CAR_PARTS VALUES ('V99T', 'ENGINE GASKET', 80);
INSERT INTO CAR_PARTS VALUES ('A20004B', 'LEFT FRONT AXLE', 200);
INSERT INTO CAR_PARTS VALUES ('U9P002', 'INTAKE MANIFOLD', 300);
INSERT INTO USED_CAR VALUES (4444444444, 25000, TO_DATE('02.02.2000','DD.MM.YYYY'));
INSERT INTO USED_CAR VALUES (5555555555, 122000, TO_DATE('05.08.2003','DD.MM.YYYY'));
INSERT INTO SERVICE VALUES (TO_DATE('12.01.2013','DD.MM.YYYY'), TO_DATE('01.01.2013','DD.MM.YYYY'), 300, 0001, 4321, 'CASH', 1111111111);
INSERT INTO CUST_PHONUMBER VALUES (99123456, 4321, 'MOBILE');
INSERT INTO CUST_PHONUMBER VALUES (99849563, 4322, 'MOBILE');
INSERT INTO CUST_PHONUMBER VALUES (22568988, 4323, 'LANDLINE');
INSERT INTO CUST_PHONUMBER VALUES (25698974, 4324, 'LANDLINE');
INSERT INTO CUST_PHONUMBER VALUES (97584692, 4325, 'MOBILE');
INSERT INTO CAR_DEFECTS VALUES ('BROKEN SIDE MIRRORS|OIL LEAKS', 4444444444);
INSERT INTO CAR_DEFECTS VALUES ('RUSTY PAINT|WORN-OUT CLUTCH', 5555555555);
INSERT INTO EMPLOYEE_PHONUMBER VALUES (97989565, 1234);
INSERT INTO EMPLOYEE_PHONUMBER VALUES (97585858, 1235);
INSERT INTO EMPLOYEE_PHONUMBER VALUES (96525263, 1236);
INSERT INTO EMPLOYEE_PHONUMBER VALUES (97484852, 1237);
INSERT INTO SERVICE_DETAILS VALUES (0001, 'BROKEN FRONT RIGHT AXLE', 'REPLACED FRONT RIGHT AXLE');
INSERT INTO HAS VALUES ('A20005B', 1111111111);
INSERT INTO HAS VALUES ('A20004B', 1111111111);
INSERT INTO USES VALUES ('A20005B', 0001);