TIL|Django|Django ORMとSQLの関係:DELETE


DELETE
delete all rows
# SQL
DELETE FROM Person;

# Django ORM
Person.objects.all().delete()
delete specific rows
# SQL
DELETE FROM Person WHERE age < 10;

# Django ORM
Person.objects.filter(age__lt=10).delete()