0

I have created a database called fruits within it I have created a table called fruits_info.

With headings of fruits_name VARCHAR(25), fruits_description VARCHAR(75), fruits_price FLOAT.

When I try and insert values to the table I use this function.

INSERT INTO fruits.fruits_info VALUES(`Peaches`, `Fresh peaches from Bengal`, `1.90`);

I then get this error message.

Error 1054 (42s22):Unknown column peaches in field list

1
  • 1
    Using backticks denotes a column. Using quotes denotes a string. Also potentially a bad idea to use FLOAT for prices. Commented Jan 26, 2018 at 14:17

2 Answers 2

2

Instead of ` use '.

INSERT INTO fruits.fruits_info VALUES('Peaches', 'Fresh peaches from Bengal', '1.90');

The backtick (`) is for specifying a column.
The single quote (') is for a value.

Sign up to request clarification or add additional context in comments.

Comments

0

Use this

INSERT INTO fruits.fruits_info VALUES('Peaches', 'Fresh peaches from 
Bengal', '1.90');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.