Coding Assignment for TrakLabs Bootcamp
- Express JS
- PostgreSQL
- Node JS
- Creating the DB
CREATE DATABASE trakinvest;
- Add the
uuid-ossp
extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
- Create
departments
table
CREATE TABLE IF NOT EXISTS departments( id uuid NOT NULL DEFAULT uuid_generate_v4(), name VARCHAR(100) NOT NULL, created_on DATE NOT NULL, PRIMARY KEY (id) );
- Create
employees
table
CREATE TABLE IF NOT EXISTS employees( id uuid NOT NULL DEFAULT uuid_generate_v4(), email VARCHAR(100) UNIQUE NOT NULL, name VARCHAR(100) NOT NULL,department uuid DEFAULT NULL, created_on DATE NOT NULL, PRIMARY KEY (id), FOREIGN KEY (department) REFERENCES departments(id) ON DELETE SET NULL );
- Clone the repository
- Navigate to the directory
- Run
npm i
- Run
npm start