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 is sqlerrd?

0 Answers  


can we delete the trigger in a view? if yes why if not why?

5 Answers   Tech Mahindra,


what is oracle sql,pl/sql with interfaces

2 Answers   TCS,


what is “go” in t-sql? : Transact sql

0 Answers  


hi this is nakka i have been looking for 1+ exp in oracle sql,plsql developer positions also have knoledge on d2k i am not getting proper walkins how to know it? where can i find it?

5 Answers  






What are different functions in sql?

0 Answers  


What is sql dialect?

0 Answers  


What is set serveroutput on in pl sql?

0 Answers  


can we update a view which is created from two tables

11 Answers  


C. Normalize the following data up to the 3rd Normal form. Create the tables and insert the data given. Emp_ID Name Dept_Name Salary Course_Title Date_Completed 100 Adam Marketing 48,000 SPSS 6/19/2008 Surveys 10/7/2008 140 Bob Accounting 52,000 Tax Acc 12/8/2008 110 Cathy IT SQL Server 1/12/2008 C# 4/22/2008 190 Dan Finance 150 Emily Marketing 55,000 SPSS 6/16/2008 42,000 Analysis 8/12/2008 Queries 1. Find all Names who have completed the SPSS Course. 2. Find employee with max salary. 3. Find employee with 2nd max salary. 4. Find all employees in Dept “Marketing”. 5. Find all the employees who have taken more than 2 courses. 6. Find all the employees who have completed the courses before month of September.

0 Answers  


What is duration in sql profiler trace?

0 Answers  


What is integrity in sql?

0 Answers  


Categories