[SOLVED] ')' IS NOT VALID AT THIS POSITION EXPECTING AN IDENTIFIER

Issue

CREATE DATABASE Lab101;
CREATE TABLE STUDENTS(
StudentID varchar(50),
Name varchar(50),
Gender varchar(50),
DOB date ,
Address varchar(50)
)
INSERT INTO STUDENTS (StudentID, Name, Gender, DOB, Address)
VALUES ('S01','Ali','Male','2 Feb 1996','Kuala Lumpur');
INSERT INTO STUDENTS (StudentID, Name, Gender, DOB, Address)
VALUES ('S02','Nancy','Female','16 May 1997','Bukit Jalil');
INSERT INTO STUDENTS (StudentID, Name, Gender, DOB, Address)
VALUES ('S03','Melvin','Male','20 Nov 1998','NULL');
INSERT INTO STUDENTS (StudentID, Name, Gender, DOB, Address)
VALUES ('S04','Angeline','Female','30 Dec 1995','Sri Petaling');

I have an ERROR in the first INSERT statement now. It says INSERT is not valid at the position

Solution

You have an extra comma at

Address varchar(50),

It should be

CREATE TABLE STUDENTSS(
StudentID varchar(50),
Name varchar(50),
Gender varchar(50),
DOB date ,
Address varchar(50)
)

Answered By – Andy Lester

Answer Checked By – Mildred Charles (BugsFixing Admin)

Leave a Reply

Your email address will not be published.