Cars table spring posgresql

Note: we’ll create a backend in java Spring Boot with postgreSQL.

Tutorial base

Let’s start!

  1. Go to java project and open server folder and run Application.java this listen the app on port 8083 full url should be http://localhost:8083.

  2. Get all cars path - Read

    • /car/allcars
  3. Register car path - Create

    • /register/car
  4. Delete car path - Celete

    • /delete/car/{regdNum}
  5. Update car path - Update

    • /update/car

DataBase postgreSQL - cars

CREATE TABLE cars(
   id serial PRIMARY KEY,
   brand VARCHAR (50) NOT NULL,
   name VARCHAR (50) NOT NULL,
   model VARCHAR (10) NOT NULL,
   year INT NOT NULL,
   price DECIMAL NOT NULL,
   UNIQUE(brand,name,model,year)
);