关于SQL的第一个代码是抛出错误

时间:2018-05-12 10:52:54

标签: sql

我正在尝试通过Oracle Live SQL学习SQL。以下是我的第一个代码。请帮我解决错误

CREATE TABLE Persons 
(    
    PersonID int,    
    LastName varchar(255),    
    FirstName varchar(255),    
    Address varchar(255),    
    City varchar(255)     
)

INSERT INTO Persons (Person ID, LastName, FirstName, Address, City)   
VALUES (103980, 'Ramanathan', 'Arun', 'Chennai', 'India')

我收到此错误:

  

ORA-00922:缺少或无效选项

1 个答案:

答案 0 :(得分:-1)

插入代码中的Person ID中有空格(第8行) 用户PersonID代替Person ID

CREATE TABLE Persons (    
    PersonID int,    
    LastName varchar(255),    
    FirstName varchar(255),    
    Address varchar(255),    
    City varchar(255)     
);



INSERT INTO Persons (PersonID, LastName, FirstName, Address, City)   
VALUES (103980, 'Ramanathan', 'Arun', 'Chennai', 'India')