filmov
tv
SQL to delete records using WHER condition and removing records from multiple tables by joining
Показать описание
01:00 Copy sql dump to create sample student table
01:40 Delete query to remove all records for which mark is less than 60
02:40 Delete query to remove all records for which class=’Four’
04:00 Delete student table and restoring the same
04:34 Adding second table student_fee
05:50 Delete records by linking two tables
06:33 Inner Join to Delete from two tables
08:20 Left join to delete records from one table
10:48 Deleting records using subqueries NOT EXISTS
12:15 Deleting records using subqueires NO IN
We can remove all records by using Truncate command.
TRUNCATE student
We can use WHERE condition check to selectively remove records.
DELETE FROM student WHERE mark LESS THAN 60
We can delete all records of Class = ‘Four’
DELETE FROM student WHERE class=’Four’
We can delete records from multiple tables by joining them. We are removing record from two tables for the student having id =2 . This query will remove 2 records from student_fee table and one from student table.
Remove records from our main student table that has no matching records in student_fee table.
By using NOT EXISTS and subquery
DELETE FROM student WHERE NOT EXISTS
By using NOT IN
Download source code from here
Student table sql dump from here
#DeleteRecords #DeleteQuery #MySQLdeleteRecords #DeleterecordsMulitpleTable #plus2net #MySQL #RemoveRecordsFromTable #linkingDelete
01:40 Delete query to remove all records for which mark is less than 60
02:40 Delete query to remove all records for which class=’Four’
04:00 Delete student table and restoring the same
04:34 Adding second table student_fee
05:50 Delete records by linking two tables
06:33 Inner Join to Delete from two tables
08:20 Left join to delete records from one table
10:48 Deleting records using subqueries NOT EXISTS
12:15 Deleting records using subqueires NO IN
We can remove all records by using Truncate command.
TRUNCATE student
We can use WHERE condition check to selectively remove records.
DELETE FROM student WHERE mark LESS THAN 60
We can delete all records of Class = ‘Four’
DELETE FROM student WHERE class=’Four’
We can delete records from multiple tables by joining them. We are removing record from two tables for the student having id =2 . This query will remove 2 records from student_fee table and one from student table.
Remove records from our main student table that has no matching records in student_fee table.
By using NOT EXISTS and subquery
DELETE FROM student WHERE NOT EXISTS
By using NOT IN
Download source code from here
Student table sql dump from here
#DeleteRecords #DeleteQuery #MySQLdeleteRecords #DeleterecordsMulitpleTable #plus2net #MySQL #RemoveRecordsFromTable #linkingDelete