Skip to content

hfang821/Employee_Tracker_BE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee_Tracker_BE

Inquirer & SQL queries Backend

Description:

  • This program is designed to build a employee database using mysql && the functionality of modifying the database in the terminal window using inquirer.js.
  • This project was completed based on the Node.js, inquirer.js and mysql database, and can be run once installed.
  • I have learned the ways to work at the server-side of javaScript database development, so that the front-end can retrieve the data by a set of query statements.

Built By:

  • JavaScript
  • Node.js
  • npm (inquirer.js)
  • npm (mysql2)
  • npm (console.table)

Wall-Around Installation Video

How to Install:

  • Open Gitbash/terminal, navigate towards your project location from your root by using "cd ./ project location"
  • Choose a clone option from the "Employee_Tracker_BE" repository (either HTTPS or SSH should work)
  • In Gitbash, type "git clone HTTPS or SSH"
  • Once the clone is successful, navigate to the root directory of this repo.
  • Enter npm init into the terminal.
  • Enter npm install inquirer into the terminal to install the inquirer.js package, Enter npm install console.table --save into the terminal to install the console.table package and enter npm install mysql2 to install the mysql2 package and you are good to go!

How to initialize the database:

  1. In your command window/gitbash shell, enter mysql -u root -p and then type your password of your sql account. image

  2. Now in your sql command window, type in source db/db.sql to create a new database called employee_tracker_db

    image

  3. type in source db/schema.sql to feed the relational tables into the database. image

  4. type in source db/seeds.sql to seed some customized data into the tables.

    image

  5. Type in SELECT * FROM employee Your initial-stage employee table should look like: image

How to Use:

  1. Navigate (cd) to the root directory in your terminal. Enter node index.js, if the question prompts started to appear, you can proceed. image

  2. After each task, you can answer 'Y' or 'y' to the followUp question to return to the main menu or say 'N' or 'n' to exit. image\


©️2022 Kevin (Haoyu) Fang

About

Inquirer & SQL queries Backend

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published