SQL DELETE JOIN Last Updated : 21 Nov, 2025 Comments Improve Suggest changes 1 Likes Like Report The SQL DELETE JOIN statement allows you to delete rows from one table based on matching conditions in another related table. It is useful for managing linked data across multiple tables while ensuring database consistency.Deletes rows from only one table even when multiple tables are joined.Uses joins to apply conditions based on related table data.Supports INNER JOIN, LEFT JOIN, and USING to match rows.Allows precise deletion using the WHERE clause.Example: First, we create a demo SQL database and tables, on which we use the DELETE JOIN command.Employees TableDepartments TableQuery:DELETE employeesFROM employeesJOIN departmentsON employees.dept_id = departments.dept_idWHERE departments.dept_name = 'HR'; Joins the employees table with the departments table using dept_id.Deletes employees whose department name is HR.Syntax:DELETE table1 FROM table1 JOIN table2 ON table1.attribute_name = table2.attribute_nameWHERE condition;table1: The primary table from which rows will be deletedtable2: The table used for comparison or condition.ON: Specifies the condition for the JOIN.WHERE: Optional; filters which rows to delete.Example of DELETE JOINIn this example, we demonstrate the implementation of DELETE JOIN. Consider the following tables for the example below: Customers TableOrders TableQuery:DELETE OrdersFROM OrdersJOIN CustomersON Orders.customer_id = Customers.customer_idWHERE Customers.status = 'inactive';SELECT * FROM Orders;Output: Joins the Orders table with Customers using the customer_id column.Deletes rows from Orders where the customer status is inactive.Displays the remaining records in the Orders table using SELECT *. Create Quiz Comment L lokeshpotta20 Follow 1 Improve L lokeshpotta20 Follow 1 Improve Article Tags : SQL Databases SQL-Server Explore BasicsWhat is SQL?6 min readSQL Data Types3 min readSQL Operators4 min readSQL Commands | DDL, DQL, DML, DCL and TCL Commands4 min readSQL Database Operations3 min readSQL CREATE TABLE3 min readQueries & OperationsSQL SELECT Query3 min readSQL INSERT INTO Statement4 min readSQL UPDATE Statement3 min readSQL DELETE Statement3 min readSQL - WHERE Clause2 min readAliases in SQL2 min readSQL Joins & FunctionsSQL Joins (Inner, Left, Right and Full Join)4 min readSQL CROSS JOIN1 min readSQL | Date Functions3 min readSQL | String functions6 min readData Constraints & Aggregate FunctionsSQL NOT NULL Constraint2 min readSQL PRIMARY KEY Constraint5 min readSQL Count() Function4 min readSQL SUM() Function2 min readSQL MAX() Function3 min readAVG() Function in SQL2 min readAdvanced SQL TopicsSQL Subquery5 min readWindow Functions in SQL6 min readSQL Stored Procedures7 min readSQL Triggers5 min readSQL Performance Tuning6 min readSQL TRANSACTIONS6 min readDatabase Design & SecurityIntroduction of ER Model9 min readIntroduction to Database Normalization6 min readSQL Injection11 min readSQL Data Encryption5 min readSQL Backup4 min readWhat is Object-Relational Mapping (ORM) in DBMS?7 min read Like