Tuesday, June 19, 2012

SQL basics

Create New Database:

1. right click on "Databases" folder and click on "Create new Database" then it will shows dialog then enter database name and then click ok
after clicking ok new database created with the given database name under databases

Creating Table:
2.  expand  your database and right click on tables and click on "New Table" then give your columns with appropriate datatype and save table with your table name click on ok. Now new table created under the tables with the given table name

Selecting Data:
   3. Select * from tablename

Inserting Data:

    4. Inserting values into the existing table

    Insert into tablename(column1,column1) values(1,'test');
    result:  1 row(s) inserted sucessfully

Updating Data:

    4. Updating  existing table data

    Update tablename SET column2='testt' where column1=2
    result:  1 row(s) Updated sucessfully

Delete Data:

    4.deleting  existing table data
    delete from tablename   where column1=2

No comments:

Post a Comment