Saturday, December 3, 2011

Add Data to Tables in a Database

After you have created a table in database the next step is to add data to that table.Now the data that you will add to the table may consist of one, more than one but less than the required number or all of the parameters specified in the table.The number of parameters depends upon the actions and also the scripts that you are executing and it differs from case to case.

To simplify if you want to add username and password but put all other parameters optional in your script than the data is added to the table inside the database only when a username and a password is entered.In that case it doesn't matter if all other fields are left blank or filled.So basically, by putting up various conditions you can add data to tables in multiple number of ways.

For Adding data to tables - 

INSERT INTO table_name(field1, field2, field3) VALUES('value1', 'value2', 'value3');


To view table content - 
SELECT * from table_name;


1 comment:

  1. This programming is interesting which is giving interesting feature of storing data.

    ReplyDelete

Your Comment Here!!