Giter VIP home page Giter VIP logo

assignment_weekdays's Introduction

Assignment - Delivery System (Food)

Solution to question 2 Table Screenshot

Whenver someone Creates Order

  1. We add order to DB . ex - {order1, userid, timestamp, distance, restaurantID} . inserting user first - INSERT INTO user(userId, username) VALUES (‘1001’, ‘Mukesh'); INSERT INTO restaurnat(restaurnatid, slots) VALUES (‘1011’, '10');

adding orders INSERT INTO Order(Orderid, userid,timestamp,distance,restaurantID,completed) VALUES (‘901’, '1001','12-12-12:00','10','1011','false');

like this we will insert orders

  1. If user updates order we pick it up by unique orderID

first lets we add meal to order INSERT INTO meal(mealid, mintime,slots,orderid,mealname,restaurantID) VALUES ('1990', '18','3','901','yummy','1011');

SELECT * from order from order INNER JOIN meal ON order.orderID = meal.orderID;

  1. User can modify future orders as we can check them by timestamps or if they are not processed by checking their completed column SELECT * from order ORDER BY timestamp ASC;

  2. We pick orders one by one from DB according to their timestamp

We can checkif order is completed or not as we have column for it. and we pick them one by one if cant be completed we update the table for completed = false. If order is modifed then we update the timestamp to current time and add it to queue again at the end. in our app we have queue to maintain all the incoming orders.

assignment_weekdays's People

Contributors

mukeshbasira 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.