Database - Introduction to SQL - Discussion

Discussion :: Introduction to SQL - General Questions (Q.No.2)

2. 

The command to remove rows from a table 'CUSTOMER' is:

[A]. REMOVE FROM CUSTOMER ...
[B]. DROP FROM CUSTOMER ...
[C]. DELETE FROM CUSTOMER WHERE ...
[D]. UPDATE FROM CUSTOMER ...

Answer: Option C

Explanation:

No answer description available for this question.

Rakesh Dasari said: (Nov 4, 2010)  
Update used only to make changes in existing records, reamainin options are used to do operations on the table not individual columns.

Ankur said: (Nov 26, 2010)  
delete from <table_name> where<condition>;

Swopna said: (Jan 30, 2011)  
drop command is used to drop the table entirely.....the table structure will be deleted and update is used to make the changes....delete is used to delete a particular row or column.....i don't know about remove as we haven't used it

Kanchana said: (Feb 11, 2011)  
I go with Ankur command.

Dilip Kumar said: (Mar 12, 2011)  
Drop table tablename; removes the table from database temporarily whereas drop table tablename purge; command removes the table from database permanently.

This is updated one.

Sangeeta said: (Mar 26, 2011)  
I agree with dilip.

Pooja said: (Apr 28, 2011)  
Delete command delete one row in a table and drop command delete a table.

Mirnal said: (May 15, 2011)  
Pooja is right.

Pankaj said: (Sep 25, 2011)  
Puja & ankur are right.

Ramya said: (Oct 29, 2011)  
Delete command is used to delete the particular row in the table. Where as drop command delete entire table.

Manche Shekhar said: (Nov 8, 2011)  
The delete command is used to remove records from a table.
The syntax of delete command is as follow:
Delete from <tablename>;
If u want to remove a particular record then we use where clause.
The syntax of delete command is as follow:
Delete from <tablename> where <condition>;

Raku said: (Dec 30, 2011)  
Manche is right.

Rinkesg said: (Jan 21, 2012)  
Ramya is right.

Kiran Kumar said: (Apr 18, 2012)  
Both delete and drop are useful for this but with drop we can delete one or total table we can remove where as by using delete with conditions we can delete the rows which are satisfying with that conditions.

K.V.L.K.Prasanna Kumar said: (Jun 14, 2012)  
We should not use the where clause if we want to delete all the rows and it should end with ; .

Aniley Belayneh said: (Dec 3, 2012)  
The DELETE statement is used to delete rows in a table.
SQL DELETE Syntax
DELETE FROM table_name
WHERE some_column=some_value
////////////////////////////////////////
Note: Notice the WHERE clause in the DELETE syntax. The WHERE clause specifies which record or records that should be deleted. If you omit the WHERE clause, all records will be deleted!

Kawaljeet said: (Mar 11, 2013)  
The command DELETE delete the rows from a table and by a condition where clause,you can delete a particular row.

Shivamkumar said: (Apr 21, 2014)  
Delete from tablename where column name;.

Gouthami.G said: (Nov 5, 2014)  
Delete is used to delete all rows or particular rows from a table.

Eg:

Sql> delete from table name;

O/p: all rows are deleted.

Eg:

Sql> delete table name where column name = value;

O/p: particular rows are deleted.

Hitendra Dineshbhai Pansuriya said: (Feb 26, 2015)  
Delete is used for row data hence it will be use and after is to change structure of table like add and drop or column and index.

Hitendra Dineshbhai Pansuriya said: (Feb 26, 2015)  
Delete is used to delete row and drop is used delete whole table.

Hitendra Dineshbhai Pansuriya said: (Feb 26, 2015)  
After is used to change data in row and update is used to change structure of table like add and drop of column and index's.

Vijju said: (Jun 30, 2015)  
How can we delete null values or a row from a table?

Harsha said: (Sep 18, 2015)  
This statement is used to delete records in a table.

By using where statement we can specify which regard to be deleted. Or else whole will be deleted.

Harsha said: (Sep 18, 2015)  
DELETE FROM <Table_Name> WHERE <Col_Name> IS NULL;

Mounika Pallapu said: (Oct 27, 2015)  
DELETE is used for delete one or more than one records but not table.

Kanimozhi said: (Dec 26, 2016)  
To remove rows from table: DELETE FROM "table_name" where "condition";.

Rithy said: (Feb 21, 2017)  
What is the difference between truncate and delete command? Because both commands are used to delete rows in a table. Which one is preferable?

Thanks in advance!

Shik said: (Oct 22, 2018)  
Truncate -- if we truncate a table, the structure of the table remains same and the data inside the table will be deleted.

BUT IN, Delete --- whole table or particular row is deleted. Here the structure of the table is also deleted.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.