GithubHelp home page GithubHelp logo

paulstgermain / node-db3-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bloominstituteoftechnology/node-db3-project

0.0 0.0 0.0 12.21 MB

Starter Code for Node DB 3 Project

JavaScript 100.00%

node-db3-project's Introduction

Node DB3 Project Starter Code

Instructions

Task 1: Project Setup

There are two possible ways to submit your project. Your instructor should have communicated which method to use for this project during the Guided Project and in your cohort's Slack channel. If you are still unsure, reach out to Lambda Staff.

Option A - Codegrade

  • Fork and clone the repository.
  • Open the assignment in Canvas and click on the "Set up git" option.
  • Follow instructions to set up Codegrade's Webhook and Deploy Key.
  • Push your first commit: git commit --allow-empty -m "first commit" && git push.
  • Check to see that Codegrade has accepted your git submission.

Option B - Pull Request

  • Fork and clone the repository.
  • Implement your project in a firstname-lastname branch.
  • Create a pull request of firstname-lastname against your main branch.
  • Open the assignment in Canvas and submit your pull request.

Task 2: Minimum Viable Product

For this project you will:

  • write SQL statements against the northwind.db3 database.
  • write the middleware functions for the schemes router in api/schemes/scheme-middleware.js.
  • write the db helper functions for the schemes resource in api/schemes/scheme-model.js.

Multi Table Queries

Use a graphical tool like SQLite Studio to open ./data/northwind.db3 and execute the following queries:

(Write the queries inside ./queries.sql under the corresponding comment)

  • Display the ProductName and CategoryName for all products in the database. Returns 77 records.
  • Display the order Id and shipper CompanyName for all orders placed before August 9 2012. Returns 429 records.
  • Display the name and quantity of the products ordered in order with Id 10251. Sort by ProductName. Returns 3 records.
  • Display the OrderID, customer's Company Name and the employee's Last Name for every order. All columns should be labeled clearly. Returns 16,789 records.

Middleware Functions

Write middleware functions in api/schemes/scheme-middleware.js following the instructions inside that file:

  • checkSchemeId
  • validateScheme
  • validateStep

Database Functions

Write db access functions in api/schemes/scheme-model.js following the instructions inside that file:

  • find
  • findById
  • findSteps
  • add
  • addStep

Schemes Schema

field data type metadata
scheme_id unsigned integer primary key, auto-increments, generated by db
scheme_name string required, unique

Steps Schema

field data type metadata
step_id unsigned integer primary key, auto-increments, generated by db
scheme_id unsigned integer foreign key referencing scheme.scheme_id, required
step_number unsigned integer required
instructions string required

API

Open api/schemes/scheme-router.js and study the specification for each endpoint.

You do not need to make any changes to this file.

  • [GET] /api/schemes
  • [GET] /api/schemes/:scheme_id
  • [GET] /api/schemes/:scheme_id/steps
  • [POST] /api/schemes
  • [POST] /api/schemes/:scheme_id/steps

Notes

  • Run tests locally executing npm test.
  • Reset the data in the data/schemes.db3 database executing npm run seed.
  • You are welcome to create additional files but do not move or rename existing files or folders.
  • Do not alter your package.json file except to install additional libraries or add additional scripts.
  • In your solution, it is essential that you follow best practices and produce clean and professional results.
  • Schedule time to review, refine, and assess your work.
  • Perform basic professional polishing including spell-checking and grammar-checking on your work.

Task 3: Stretch Problems

In SQL Try Editor at W3Schools.com:

  • Find the number of shipments by each shipper.
  • Find the top 5 best performing employees measured in number of orders.
  • Find the top 5 best performing employees measured in revenue.
  • Find the category that brings in the least revenue.
  • Find the customer country with the most orders.
  • Find the shipper that moves the most cheese measured in units.

node-db3-project's People

Contributors

ericathompson avatar ladrillo avatar luishrd avatar mixelpixel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.