In: Computer Science
INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]');
INSERT INTO (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,
OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]');
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]');
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]')
Solution :
1.
INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]');
This command is wrong as THERE is no IN keyword in sql it should be INTO.
Correct Sql command :
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]');
2.
INSERT INTO (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,
OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]');
This is also wrong as you are not defining the table name in this so that's why it should give error in it.
Correct INSERT Command :
INSERT INTO EMPLOYEE(EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,
OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]');
3.
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]');
This is also worng as the first column is EmployeeNumber and you are not passing any value in the values so it will also give error.
Correct sql command.
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]');
4.
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]')
in that query there is same error as you are not giving any value for employee number.
correct sql command is :
INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,
Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]').