how to remove records from table?
no name
1 a
2 b
1 a
2 b
3 c

Answers were Sorted based on User's Feedback



how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / kriahna chaitanya

delete From <table>;

Is This Answer Correct ?    22 Yes 4 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / chinna

truncate table <tbl_nm>

Is This Answer Correct ?    14 Yes 7 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / hannan oca

delete from tablename; will remove all records but we can
rollback these values.

truncate tablename; will remove all records but we cannot
rollback the table values if we want that values in future.

Is This Answer Correct ?    2 Yes 0 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / shekharjchandra

I think people here just answering the questions just for sake of answering. First of all the framing of question is not correct, anyone who knows oracle will know how to delete records from table, just by using Delete from tablename...etc etc

By looking into the question and example by Sophia it looks like she wants to delete the duplicate rows from the table.

Some of you answered correctly like Pratap.

But others are just telling the difference between Delete and Truncate, which is not required in this context at all, I am sure if we answer like this in interviews the interviewer will decide what he wants.

Please don't mind my words, and take it serious and give to the prompt answers, even if u dont know correct answer try to get from other sites, so that when someone looks for such questions they should get correct answer rather they should read all answers for getting correct reply.

Regards
J

Is This Answer Correct ?    2 Yes 0 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / pratap

delete from table name;
or truncate table name;

Is This Answer Correct ?    5 Yes 4 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / rupesh

Mr. Krishna Kumar


With truncate rows will delete as well as tablespace not.


instead of tablespace you have to use physical memory space.

Is This Answer Correct ?    0 Yes 0 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / krishna kum ar

delete <table_name> --------This removes only the records
not a tablespace

but

truncate <table_name>--------This removes both records as
well as tablespaces in database

Is This Answer Correct ?    2 Yes 3 No

how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c..

Answer / pratap

Delete from table name where row_id not in (select min(no)
from table_name group by no)

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

What are the cursor attributes used in PL/SQL ?

4 Answers  


i want run a sql query query? which phases are run in a back ground? pls tell me the answer

1 Answers  


How do I run pl sql in sql developer?

0 Answers  


How do I copy a table in sql?

0 Answers  


How many database objects (trigger, packages, sequence etc) uses a particular field in a given table. For ex: I want to know how many database object uses the ATTRIBUTE1 in the PO_VENDORS table. What query will give me the result showing the database object name(package, trigger etc), field_name used (in this case ATTRIBUTE1) and table_name (in this case PO_VENDORS).

2 Answers   IBM,






Which one is faster ienumerable or iqueryable?

0 Answers  


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

0 Answers  


What are the ways on commenting in a pl/sql code?

0 Answers  


what is oracle database ? : Sql dba

0 Answers  


what is bcp? When is it used?

0 Answers  


Are dml statements autocommit?

0 Answers  


Can we call dml statement in function?

0 Answers  


Categories