I am in the midst of refreshing myself on MySQL.

The basics have been going well but I am having one issue. I have created a table with two columns and three rows. Next I added a third, null column, Price, which I now wish to populate with data, that is, I want to enter separate, new data for each row in the Price column. Below is the output of the table:

_______________________
Name | Color | Price
_______________________
Apples | Red | Null
Kiwis | Green | Null
Berries | Blue | Null
_______________________


I would like to alter the output to this:

Name | Color | Price
_______________________
Apples | Red | 1.00
Kiwis | Green | 1.50
Berries | Blue | 2.25
_______________________

*Note: I have researched this but have not yet found the solution

Thank-you in advance for any help.

UPDATE yourtable SET price=1 WHERE Name='Apples';

It would be really easier and SAVER if you table has primary key.
Consider that

UPDATE yourtable SET price=1;

changes all three rows.

-- tesu

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.