I don’t know why I keep getting an error
Thank you in advance
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
INSERT syntax allows inserting multiple rows, but each row needs to be in its own tuple:
insert into shoppinglistTest(itemdescription, quantity, dateadded) values ('Bananas',20,'0000-00-00'), ('apples',10,'0000-00-00'), ('grapes',20,'0000-00-00'), ('gatorade',10,'0000-00-00'), ('steak',10,'0000-00-00'), ('milk',2,'0000-00-00'), ('eggs',4,'0000-00-00');
The syntax you tried to use used a single tuple of 21 values for a column list of 3 columns. The number of columns in your column list must be the same as the number of values in each tuple in the VALUES clause. But you can make a list of many tuples.