Giter Site home page Giter Site logo

amazon-like-store's Introduction

amazon-like-store

Use CLI to run program

open second final

The SQL Statments and Inquirer

  • I wanted to show how to join tables so I created a departments table and used the ID of that department in the products table. I then created a view to join the tables together. My CLI app uses this view instead of coding a join statment in my node.js server.

  • I included a seeds.sql file that will create the database, tables, populate the tables and create the view nessesary for my CLI App to run.

  • Instead of console.loging a table or using an NPM console.table, I present the user with a list of items they can buy.

  • I then take the line number and use it for the ID since the ID I put as the line number when it was displayed in the CLI.

Project goals

The app should then prompt users with two messages.

  • The first should ask them the ID of the product they would like to buy.
  • The second message should ask how many units of the product they would like to buy.
  1. Once the customer has placed the order, your application should check if your store has enough of the product to meet the customer's request.

    • If not, the app should log a phrase like Insufficient quantity!, and then prevent the order from going through.
  2. However, if your store does have enough of the product, you should fulfill the customer's order.

    • This means updating the SQL database to reflect the remaining quantity.
    • Once the update goes through, show the customer the total cost of their purchase.

amazon-like-store's People

Contributors

sayex avatar dependabot[bot] avatar

Watchers

James Cloos avatar  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.