Skip to content

priti-chimanpure921/SQL-with-Express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠️ SQL with Express — CRUD Operations with SQL DB

A backend project that demonstrates how to use Node.js, Express.js, and SQL together to perform CRUD operations (Create, Read, Update, Delete) on a database. This application shows how to build RESTful API routes that interact with an SQL database using standard SQL queries.

🚀 Project Overview

This project connects a Node.js server with an SQL database and enables:

✔ Creating new records

✔ Reading data

✔ Updating existing data

✔ Deleting records

It is a typical full-stack backend pattern where the server accepts requests and executes SQL queries to modify the database accordingly.

🛠️ Technologies Used

Node.js – JavaScript runtime

Express.js – Web framework

SQL – Relational database queries

EJS – Templating engine for rendering views

npm – Dependency management

📌 Prerequisites

Before you get started, make sure you have:

✔ Node.js installed

✔ A SQL database installed (like MySQL, SQL Server, or PostgreSQL)

✔ Basic SQL knowledge (queries like SELECT, INSERT, UPDATE, DELETE)

You can use local SQL installations or cloud databases depending on what you prefer.

📘 How It Works

Each route uses SQL queries to interact with the database:

Create — INSERT INTO ...

Read — SELECT * FROM ...

Update — UPDATE ... SET ... WHERE ...

Delete — DELETE FROM ... WHERE ...

Your code sends a query to the database for each request and returns results as JSON.

🧠 Learning Outcomes

With this project you’ll learn:

✔ How to connect a SQL database with Node.js & Express

✔ How to write SQL queries for CRUD operations

✔ How to create RESTful API endpoints

✔ How to send database results back to the client

🚀 Possible Enhancements

Here are some ways you could improve it:

✨ Add input validation (e.g., with Joi or Yup)

✨ Use environment variables for database credentials

✨ Add authentication (JWT / sessions)

✨ Use ORM like Sequelize or Knex for cleaner database code

✨ Add pagination for list results

👩‍💻 Author

Priti Chimanpure

Backend & Full Stack Developer

About

CRUD operations with SQL DB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors