Skip to content

codebuildervaibhav/student-crud-api-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

just check up with your databse creation part i am pasting the db setup i have used -- Create database CREATE DATABASE student_management; USE student_management;

-- Create students table CREATE TABLE students ( roll_no INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(100) NOT NULL, address TEXT, class VARCHAR(50), section VARCHAR(10) );

-- Insert sample data with Indian names INSERT INTO students (name, address, class, section) VALUES ('Shreya Sharma', '123 MG Road, Delhi', '10', 'A'), ('Aman Gupta', '456 Connaught Place, New Delhi', '10', 'B'), ('Akshit Patel', '789 Marine Drive, Mumbai', '9', 'A'), ('Akash Singh', '321 Park Street, Kolkata', '11', 'C'), ('Vaibhav Rana', '654 Brigade Road, Bangalore', '9', 'B'), ('Priya Verma', '987 Churchgate, Mumbai', '10', 'A'), ('Rahul Kumar', '555 Jubilee Hills, Hyderabad', '11', 'B'), ('Neha Joshi', '222 Koregaon Park, Pune', '9', 'C'), ('Sneha ', '888 Anna Salai, Chennai', '10', 'A'), ('Rohan Malhotra', '444 Salt Lake, Kolkata', '11', 'B');

SELECT * FROM students;

then chek the .env DB_HOST=localhost DB_USER=root DB_PASSWORD=root DB_NAME=student_management DB_PORT=3306 PORT=3000 my password was empty now just open postman to test API Endpoints Method Endpoint Description GET /api/students Get all students GET /api/students/:id Get student by ID POST /api/students Create new student PUT /api/students/:id Update student DELETE /api/students/:id Delete student

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published