Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

ORACLE SQL - Tutorial 2

Loading...

Published in: Oracle Training
658 Views

More Built Function about ORACLE SQL

Debarun S / Kolkata

10 years of teaching experience

Qualification: B.Tech

Teaches: Computer, Mathematics, Science, Chemistry, Computer Science, Physics, School Level Computer, Defence Exams, IBPS, Insurance Exams, SSC Exams

Contact this Tutor
  1. SQL DELETE Statement The SQL DELETE Statement The DELETE statement is used to delete existing records in a table. DELETE Syntax DELETE FROM table name WHERE condition; Note: Be careful when deleting records in a table! Notice the WHERE clause in the DELETE statement. The WHERE clause specifies which record(s) that should be deleted. If you omit the WHERE clause, all records in the table will be deleted! Demo Database Below is a selection from the "Customers" table in the Northwind sample database: CustomerID CustomerName ContactName Address City PostalCode Country 1 2 3 4 5 Alfreds Futterkiste Maria Anders Ana Trujillo Emparedados y helados Antonio Moreno Taquerfa Around the Horn Berglunds snabbköp Ana Trujillo Antonio Moreno Obere Str. 57 Avda. de la Constituci6n 2222 Berlin 12209 México 05021 D.F. México Mataderos 2312 05023 D.F. 120 Hanover Thomas Hardy London WAI IDP sq. Christina Berguvsvägen 8 Luleå S-958 22 Berglund Germany Mexico Mexico UK Sweden SQL DELETE Example The following SQL statement deletes the customer "Alfreds Futterkiste" from the "Customers" table:
  2. Example DELETE FROM Customers WHERE CustomerName= 'Alfreds Futterkiste'; The "Customers" table will now look like this: CustomerID CustomerName ContactName Address Avda. de la Ana Trujillo Constituci6n 2222 City PostalCode Country 2 3 4 5 Ana Trujillo Emparedados y helados Antonio Moreno Taquerfa Around the Horn Berglunds snabbköp México 05021 D.F. México Antonio Moreno Mataderos 2312 05023 120 Hanover Thomas Hardy sq. Christina D.F. London WAI IDP Berguvsvägen 8 Luleå S-958 22 Berglund Mexico Mexico UK Sweden Delete All Records It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact: DELETE FROM table name; or: DELETE * FROM table name;