0

I created my table: enter image description hereEnd result:

Any help is appreciated.

I am trying to create a table showing the employee information, but when I used the "insert" command only the information for the second employee appears. Also, the column names are missing and the numbers are incorrect.

Edit Apologies about the images. I made some updates, but I am still having an issue with the column names and my first row not appearing.

Create table biscoe6
("EmployeeID" "varchar"(11),
"SSN" "varchar"(11),
"fName" "varchar"(12),
"lName" "varchar"(12),
"Position" "varchar"(12),
"Salary" number(10, 2),
"PhoneNum" "char"(12)); 

insert into biscoe6 ("EmployeeID", "SSN", "fName", "lName", "Position", "Salary", "PhoneNum")
values (null, null, null, null, null, null, null);
values (100, '111-11-0607', 'John', 'Smith', 'Manager', 35000.75, '800-350-0000');
values (200, '333-22-0607', 'John', 'Jones', 'Associate', 25000.00, '202-666-0000');
values (300, '444-444-0607', 'Sally', 'Smith', 'Manager', 46500.00, '303-999-0000');
values (400, '111-11-2102', 'Randy', 'Johnson', 'Intern', 36900.00, '205-654-0000');
  • What is your SQL _version_ (e.g. MySQL, SQL Server, Oracle) ? – Tim Biegeleisen Mar 27 '22 at 02:25
  • I honestly I am not sure. I am a student and this is part of my first assignment. We were instructed to use www.sqlcourse.com as a SQL interpreter. – Ilbiscotto Mar 27 '22 at 02:29
  • Try to change the online IDE , because if you are not running on your local system then it cause such type of errors on online IDE .Try to use W3School or any other . – Jagroop Mar 27 '22 at 02:34
  • 1
    Any column that has the type `char` or `varchar` needs to be surrounded by `''`, in the same way that names are quoted. Otherwise, the `SSN` and `PhoneNum` values are storing the literal subtraction of the 3 numbers, which causes the `numbers are incorrect`. Also, post those two code example as text instead of images using the `{}` icon on the editor toolbar, so that others can copy/past your code to assist. – Paul T. Mar 27 '22 at 02:49
  • Providing text instead of images helps to get faster recommendations from the community – RF1991 Mar 27 '22 at 03:22
  • There might be a problem with the online tool you are using, not always reliable to use when learning. I think you need to review what is valid SQL Insert statement is usually `INSERT INTO {TABLE} (Columns) VALUES (values)` So for each insert statement you need to start with INSERT and followed by Values. `INSERT INTO TABLE VALUES (values); INSERT INTO TABLE VALUES (values);` You may also find your SSN definition of `varchar(11)` is not enough for a value such as "444-444-0607" – Squirrel5853 Mar 28 '22 at 12:27
  • https://stackoverflow.com/questions/6889065/inserting-multiple-rows-in-mysql – Engr.Aftab Ufaq Mar 28 '22 at 12:30
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 28 '22 at 12:31

2 Answers2

0

I think the first insert-values is working, but the second values does not have a corresponding insert and it is being treated as a simple select-values. The results you see is from the sole values.

tinazmu
  • 3,880
  • 2
  • 7
  • 20
0

You are making a basic mistake,values must be one time and comma separated values. try this

insert into biscoe6 ("EmployeeID", "SSN", "fName", "lName", "Position", "Salary", "PhoneNum") 
    values 
    (100, '111-11-0607', 'John', 'Smith', 'Manager', 35000.75, '800-350-0000'),
    (200, '333-22-0607', 'John', 'Jones', 'Associate', 25000.00, '202-666-0000'), 
    (300, '444-444-0607', 'Sally', 'Smith', 'Manager', 46500.00, '303-999-0000'), 
    (400, '111-11-2102', 'Randy', 'Johnson', 'Intern', 36900.00, '205-654-0000');
Engr.Aftab Ufaq
  • 3,356
  • 3
  • 21
  • 47