Skip to content
  • SiteMap
  • Our Services
  • Frequently Asked Questions (FAQ)
  • Support
  • About Us

UpdateGadh

Update Your Skills.

  • Home
  • Projects
    •  Blockchain projects
    • Python Project
    • Data Science
    •  Ai projects
    • Machine Learning
    • PHP Project
    • React Projects
    • Java Project
    • SpringBoot
    • JSP Projects
    • Java Script Projects
    • Code Snippet
    • Free Projects
  • Tutorials
    • Ai
    • Machine Learning
    • Advance Python
    • Advance SQL
    • DBMS Tutorial
    • Data Analyst
    • Deep Learning Tutorial
    • Data Science
    • Nodejs Tutorial
  • Blog
  • Contact us
  • Toggle search form
Node.js MySQL Delete Records

Node.js MySQL Delete Records

Posted on October 22, 2025October 22, 2025 By Rishabh saini No Comments on Node.js MySQL Delete Records

Node.js MySQL Delete Records

The DELETE FROM command in MySQL is used to remove one or more records from a database table. It’s an essential part of CRUD (Create, Read, Update, Delete) operations, allowing you to manage and maintain clean data efficiently.

Data Science Tutorial:–Click Here

Let’s go through an example to understand how to delete specific records using Node.js and MySQL.

Example: Delete Employee Record Based on City

Suppose you want to delete employees from the table employees where the city is Delhi.
Follow the steps below to implement this.

Introduction to Applied AI:–Click Here

  1. Create a new JavaScript file named delete.js inside a folder called DBexample.
  2. Add the following code to your delete.js file:

var mysql = require('mysql');  
var con = mysql.createConnection({  
  host: "localhost",  
  user: "root",  
  password: "12345",  
  database: "updategadh"  
});  

con.connect(function(err) {  
  if (err) throw err;  
  var sql = "DELETE FROM employees WHERE city = 'Delhi'";  
  con.query(sql, function (err, result) {  
    if (err) throw err;  
    console.log("Number of records deleted: " + result.affectedRows);  
  });  
});  

Run the Script

Download New Real Time Projects :–Click here

Open your command terminal, navigate to the DBexample folder, and run the following command:

node delete.js

This command executes the script and deletes the records from the employees table where the city is Delhi.

Verify the Deleted Records

To confirm that the records have been removed successfully, you can use a SELECT statement to display the current data in the table:

SQL Tutorial :–Click Here

SELECT * FROM employees;

This will show you the updated records after the deletion operation.

Deep Learning Tutorial:– Click Here
Machine Learning Tutorial:–Click Here
Complete Advance AI topics:- CLICK HERE
Complete Python Course with Advance topics:-Click Here


nodejs mysql delete, nodejs mysql delete query, mysql delete nodejs, mysql delete query nodejs, nodejs delete mysql, delete query mysql nodejs, nodejs mysql delete query postman, error in delete db record using node.js and mysql, node.js mysql delete, node.js mysql delete query, delete a record mysql db, node.js mysql delete data, nodejs mysql query to delete data from database, unable to delete row from mysql using nodejs, delete data mysql node.js, node js mysql delete data, delete in node js mysql node js mysql delete records example node js mysql query return result mysql delete command mysql delete join write a program to update table records using node js and mysql database delete query in node js delete row mysql w3school sdelete all records from table mysql

    Post Views: 226
    Node.js Tutorial Tags:delete a record mysql db, delete data mysql node.js, delete query mysql nodejs, error in delete db record using node.js and mysql, mysql delete nodejs, mysql delete query nodejs, node js mysql delete data, node.js mysql delete, node.js mysql delete data, node.js mysql delete query, nodejs delete mysql, nodejs mysql delete, nodejs mysql delete query, nodejs mysql delete query postman, nodejs mysql query to delete data from database, unable to delete row from mysql using nodejs

    Post navigation

    Previous Post: Node.js MySQL Update Records
    Next Post: Best Oral Cancer Detection Using Deep Learning

    More Related Articles

    Node.js Process Node.js Process Node.js Tutorial
    Node.js Web Module Node.js Web Module Node.js Tutorial
    Node.js Events Node.js Events Node.js Tutorial

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    You may also like

    1. Install Nodejs on Windows
    2. Node.js Command Line Options
    3. Node.js Assertion Testing
    4. Node.js MySQL Update Records
    5. Node.js Create Connection with MongoDB
    6. Node.js MongoDB Filter Query

    Most Viewed Posts

    1. Top Large Language Models in 2025
    2. Online Shopping System using PHP, MySQL with Free Source Code
    3. login form in php and mysql , Step-by-Step with Free Source Code
    4. Flipkart Clone using PHP And MYSQL Free Source Code
    5. News Portal Project in PHP and MySql Free Source Code
    6. User Login & Registration System Using PHP and MySQL Free Code
    7. Top 10 Final Year Project Ideas in Python
    8. Online Bike Rental Management System Using PHP and MySQL
    9. E learning Website in php with Free source code
    10. E-Commerce Website Project in Java Servlets (JSP)
    • AI
    • ASP.NET
    • Blockchain
    • ChatCPT
    • code Snippets
    • Collage Projects
    • Data Science Project
    • Data Science Tutorial
    • DBMS Tutorial
    • Deep Learning Tutorial
    • Final Year Projects
    • Free Projects
    • How to
    • html
    • Interview Question
    • Java Notes
    • Java Project
    • Java Script Notes
    • JAVASCRIPT
    • Javascript Project
    • JSP JAVA(J2EE)
    • Machine Learning Project
    • Machine Learning Tutorial
    • MySQL Tutorial
    • Node.js Tutorial
    • PHP Project
    • Portfolio
    • Python
    • Python Interview Question
    • Python Projects
    • PythonFreeProject
    • React Free Project
    • React Projects
    • Spring boot
    • SQL Tutorial
    • TOP 10
    • Uncategorized
    • Online Examination System in PHP with Source Code
    • AI Chatbot for College and Hospital
    • Job Portal Web Application in PHP MySQL
    • Online Tutorial Portal Site in PHP MySQL — Full Project with Source Code
    • Online Job Portal System in JSP Servlet MySQL

    Most Viewed Posts

    • Top Large Language Models in 2025 (8,613)
    • Online Shopping System using PHP, MySQL with Free Source Code (5,215)
    • login form in php and mysql , Step-by-Step with Free Source Code (4,867)

    Copyright © 2026 UpdateGadh.

    Powered by PressBook Green WordPress theme