Wednesday, 27 June 2012

SQL Queries

How to Delete all rows from a table?

   Delete from table_name  or  Delete * from table_name

Eg: in my case table name=BD
                                     Delete from BD

How to Delete specific rows from a table
                         


DELETE FROM table_name WHERE some_column=some_value



code
name
Designation
Amount
1
Abc
Supervisor
300
1
Bcd
Assistant
300
3
Efg
assistant
300




Eg:  Delete from BD where name= 'abc'


How to delete a Column from a table


ALTER TABLE TableName DROP COLUMN ColumnName

eg:Alter BD Drop column Amount




No comments:

Post a Comment

Please Leave Your Comment here

You Might also like this

Related Posts Plugin for WordPress, Blogger...