0

How to insert data into a table after altering using query(SQL)?

My student table consist of two columns Name and Roll. I alter my table and add Address column, now I don't know how to insert address to my existing row with Name='Ballu' and Roll=1. Please help! Thanking you.

12th Dec 2016, 5:05 PM
Pukhramabam Prameshwormani Singh
5 Answers
+ 1
UPDATE [table_name] SET address = [your value] WHERE name = 'Ballu' and roll = 1
12th Dec 2016, 5:55 PM
Daniel
Daniel - avatar
0
To insert data in a table you need to use INSERT command. Something linke this: INSERT INTO {table name} VALUES ( {put the values here, separated by comma}) http://www.w3schools.com/sql/sql_insert.asp
12th Dec 2016, 5:10 PM
Daniel
Daniel - avatar
0
@Daniel I tried this but it create a whole new row but I want to insert address only to my existing row.
12th Dec 2016, 5:13 PM
Pukhramabam Prameshwormani Singh
0
So you need to use the UPDATE command
12th Dec 2016, 5:42 PM
Daniel
Daniel - avatar
0
@Daniel Thank you
13th Dec 2016, 3:00 AM
Pukhramabam Prameshwormani Singh