Docsity

Using DELETE SQL command, Assignments of Database Programming

Toggle sidebar
bg1
UsingDELETESQL command
When you ask any question inStudytonight's Forumit gets
saved into a table. And using theDeleteoption, you can
even delete a question asked by you. How do you think that
works? Yes, using the Delete DML command.
Let's study about the syntax and the usage of the Delete
command.
DELETEcommand
DELETEcommand is used to delete data from a table.
Following is its general syntax,
DELETE FROM table_name;
Let's take a sample tablestudent:
s_id name age
101 Adam 15
102 Alex 18
103 Abhi 17
pf3

Partial preview of the text

Download Using DELETE SQL command and more Assignments Database Programming in PDF only on Docsity!

Using DELETE SQL command

When you ask any question in Studytonight's Forum it gets saved into a table. And using the Delete option, you can even delete a question asked by you. How do you think that works? Yes, using the Delete DML command. Let's study about the syntax and the usage of the Delete command.

DELETE command

DELETE command is used to delete data from a table. Following is its general syntax, DELETE FROM table_name; Let's take a sample table student : s_id name age 101 Adam 15 102 Alex 18 103 Abhi 17

Delete all Records from a Table DELETE FROM student; The above command will delete all the records from the table student. Delete a particular Record from a Table In our student table if we want to delete a single record, we can use the WHERE clause to provide a condition in our DELETE statement. DELETE FROM student WHERE s_id= 103 ; The above command will delete the record where s_id is 103 from the table student. S_id S_Name age 101 Adam 15 102 Alex 18