Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- PROJECT
- Text mining
- iterates
- self parameter
- Python
- continue
- error
- Text Analytics
- __init__
- Default X points
- PANDAS
- AS
- Github
- SQL
- multiple lines
- variables
- line color
- line width
- Else
- For loops
- data distribution
- polynomial regression
- train/test
- matplotlib.pyplot
- start exercise
- machine learning
- break
- MySQL
- pie charts
- matplotlib
Archives
- Today
- Total
Data Science Explorer
[Basic Grammar] SQL DELETE Statement 본문
반응형
The DELETE statement is used to remove existing records in a table.
- DELETE Syntax
DELETE FROM table_name WHERE condition;
** WARNING: Be careful when you delete records in a table! If you omit the WHERE clause, all records in the table will be deleted. The Where clause in the DELETE statement. **
Example
Delete the customer "Jack Lee" from the "Customers" table:
DELETE FROM Customers WHERE CustomerName = 'Jack Lee';
- Delete all the records
You can delete all rows in a table without deleting the table.
Example
Delete all rows in the "Students" table, without deleting the table:
DELETE FROM Students;
- Delete a table
When you want to delete the whole table, use the DROP TABLE statement:
Example
Remove the Brands table:
DROP TABLE Brands;
Exercises
Delete all the records from the "Orders" table where the "Status" value is 'Canceled'.
DELETE FROM Orders
WHERE Status = 'Canceled';
'SQL' 카테고리의 다른 글
[Basic Grammar] SQL COUNT Function (0) | 2023.10.14 |
---|---|
[Basic Grammar] SQL MIN() and MAX() Functions (0) | 2023.10.14 |
[Basic Grammar] SQL UPDATE Statement (0) | 2023.10.14 |
[Basic Grammar] SQL NULL Values (0) | 2023.10.14 |
[Basic Grammar] SQL INSERT INTO Statement (1) | 2023.10.14 |