0
votes

So I am brand new to sql, and I was dabbling with creating a basic table to add and query data from. I am trying to create a table, but I keep getting an "ORA-00907 missing right parenthesis" error on the first part of the script, and I am not sure why. Here is my code:

CREATE TABLE Payroll
(
Identification_Number INTEGER(10),
Full_Name VARCHAR2(20) NOT NULL,
Position VARCHAR2(20) NOT NULL,
Salary INTEGER(20) NOT NULL
);

INSERT INTO Payroll (Identification_Number, Full_Name, Position, Salary) VALUES (1476563, 'Bob Smith', 'CEO', 6000000);
INSERT INTO Payroll (Identification_Number, Full_Name, Position, Salary) VALUES (1892345, 'Brian Smith', 'President', 5000000);
INSERT INTO Payroll (Identification_Number, Full_Name, Position, Salary) VALUES (1234567, 'Ron Smith', 'Vice President', 4000000);

SELECT * FROM Payroll;

Any suggestions?

1
INTEGER(10) should be int - Vamsi Prabhala
Hmmm I tried that, and it still gives me that error. Thanks for the suggestion though. - ejmie518
@ejmie518 vkp is right, but you need to change both INTEGERs. - Jon Heller
Oh right! I forgot to change the second one. It worked. Thanks! - ejmie518

1 Answers

1
votes

Change your script as:

CREATE TABLE Payroll
(
Identification_Number NUMBER(10),
Full_Name VARCHAR2(20) NOT NULL,
Position VARCHAR2(20) NOT NULL,
Salary NUMBER(20) NOT NULL
);