Database Design for a Food Delivery App (Example & Walkthrough)

  Рет қаралды 30,249

Database Star

Database Star

Күн бұрын

Пікірлер: 47
@arbazadam3407
@arbazadam3407 Жыл бұрын
Hello Ben. I encourage you to create more videos on designing databases for applications. We can easily pick syntax from the documentation but when the need to design the databases arises. Thats where we struggle.
@DatabaseStar
@DatabaseStar Жыл бұрын
Hey! Thanks for the suggestion, that’s a good idea. Are there any domains or systems that you would like to see a database design created for? I’ve got a few on my list but want to see if there are any you’d like to see.
@chethanb6406
@chethanb6406 Жыл бұрын
Quora
@mickeymittal-j1b
@mickeymittal-j1b 9 сағат бұрын
Thank you for the wonderful video! For the task of adding ingredients, I was able to create a list of available ingredients for a specific menu item by setting up an ingredients table. Since the relationship between menu items and ingredients is many-to-many, I also created a junction table that stores the IDs of both the menu items and the ingredients. However, I'm unsure how to store the ingredients that a user selects in the order_menu_item table. Could you please guide me on how to approach this?
@VaibhavKarbhajan
@VaibhavKarbhajan 8 ай бұрын
Very simple and good design ! The design can be extended to add more things such as currency for instance.
@DatabaseStar
@DatabaseStar 8 ай бұрын
Thanks! Yes that’s a good point, it can be.
@oracle_professor
@oracle_professor Жыл бұрын
Really helpful for my students
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad to hear it!
@irshadahmed6801
@irshadahmed6801 Жыл бұрын
Great video!!. What about having reviews in a separate table. Because we might have index reviews based on just resturant or delivery driver
@DatabaseStar
@DatabaseStar Жыл бұрын
Yes, you could have reviews in a separate table, if you wanted to review just the restaurant or just the delivery driver.
@thuongngo8010
@thuongngo8010 11 ай бұрын
you are really good teacher , hope u make more video like this
@DatabaseStar
@DatabaseStar 11 ай бұрын
Thanks!
@-.-smile
@-.-smile Жыл бұрын
Amazing videos!
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@trishulcurtis1810
@trishulcurtis1810 7 ай бұрын
Excellent Video!
@DatabaseStar
@DatabaseStar 7 ай бұрын
Thanks!
@jayjoshi1366
@jayjoshi1366 8 ай бұрын
Great video and content displayed. Can you specify which database can be used for Food Delivery apps and websites like Doordash or Uber eats, and how can the DB be queried if any customer searches specific restaurant or any food item universally which may go to any restaurant ? Your response will be appreciated.
@DatabaseStar
@DatabaseStar 8 ай бұрын
Thanks! You can use any relational database for this concept such as MySQL or Postgres or SQL Server. You would write Select queries to get the data you need from the tables.
@hanhthien2948
@hanhthien2948 5 ай бұрын
Hello sir, I have a question, why not combine the customer table and delivery_driver table in one table? I see they have the same row, why not just combine and have a column named 'role' in the user table?
@DatabaseStar
@DatabaseStar 5 ай бұрын
Good question. Essentially it’s because they are different things. But if they share enough of the same details and you want to have a single profile with different roles then yes that could work.
@MohammadLsk
@MohammadLsk Жыл бұрын
Awesome , can you design database for a travel agency and reservation app
@DatabaseStar
@DatabaseStar Жыл бұрын
Great idea! I'll create a video in the future.
@coastalcruise1345
@coastalcruise1345 Жыл бұрын
Hey Ben, very helpful video thanks. Regarding the order_menu_item table, could we use a composite primary key from its two foreign keys: order_id and menu_item_id ?
@DatabaseStar
@DatabaseStar Жыл бұрын
Hey, yes you could use that for the primary key instead.
@nicholassmith6412
@nicholassmith6412 Жыл бұрын
Love your videos as an SQL newbie! Quick question: for requirement 5, why can’t the food_order table just have an order_status column rather than have a separate order_status table?
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks! Good question. The reason is that there is a specific list of statuses that are allowed. For example, "Ordered", "In Progress", "Out for Delivery", "Delivered". These are stored in the separate order_status table so that there is consistent data for the orders. The alternative would be having an order_status column in the food_order table. This could work, however there is a chance of different values appearing. You could have a value of "Ordered", or "ordered", or "order placed" or "Done", or anything else that doesn't match the defined list. This makes the data hard to work with. You could put a check constraint on the column, but there are different issues with that (e.g. harder to make changes). Hope that answers your question.
@nicholassmith6412
@nicholassmith6412 Жыл бұрын
@@DatabaseStar that's the exact answer I was looking for - makes sense, thank you!
@hyderoxxx
@hyderoxxx Жыл бұрын
@@DatabaseStar thank you for the amazing video, I really appreciate it! Regarding the status question, what do you think about using an ENUM type in the food_order table for the status? It would restrict the possible values to a specified list. It would probably make it more error prone to compare status values between tables though. It is a topic that comes up often during my work and it would be helpful to see what you think.
@theroadbacktonature
@theroadbacktonature Жыл бұрын
Great Video, thank you. Curious, why do we need two separate tables - order_menu_item and food_order, can we not merge them together into single table?
@DatabaseStar
@DatabaseStar Жыл бұрын
You're wleocme! The reason for two separate tables is because the food_order represents the whole order that was place: a reference to the restaurant, who placed the order, when it was placed, and so on. The order_menu_item is a list of all of the items included in the order, because there can be many. For example, a food_order from McDonald's could contain an order_menu_item of 1 cheeseburger, and another order_menu_item for 1 large fries.
@rohith7929
@rohith7929 5 ай бұрын
Can i assume order_menu_item table similar to cart
@DatabaseStar
@DatabaseStar 5 ай бұрын
Yeah that’s right, it’s a similar concept.
@0xmahabub07
@0xmahabub07 Жыл бұрын
can you plz make a video on train ticket online reservation system Where trains can have different different routes and common too. Also how can I calculate the point to point price calculation Assuming the railway all routes as a undirected graph edges 😢
@DatabaseStar
@DatabaseStar Жыл бұрын
Good idea! I can create a video on this kind of design.
@0xmahabub07
@0xmahabub07 Жыл бұрын
@@DatabaseStar 💚 waiting 🙂
@mr.adamprince4853
@mr.adamprince4853 5 ай бұрын
what application to make the table relation? thanks
@DatabaseStar
@DatabaseStar 5 ай бұрын
I used a program called LucidChart
@mr.adamprince4853
@mr.adamprince4853 5 ай бұрын
@@DatabaseStar thank you
@puBo-ik9uw
@puBo-ik9uw Жыл бұрын
Hello, I would like to ask if you want to add a column called totalprice (including the total price of the order and delivery fee), where should it be added? And how to use the syntax to achieve the purpose of calculating the price? follow the syntax is how I try, but I can't insert into the totalPrice Successfully SELECT SUM(order_item.ORD_ITEM_QTY*menu_item.MENU_ITEM_PRICE) as total FROM order_item INNER JOIN menu_item ON menu_item.MENU_ITEM_ID = order_item.MENU_ITEM_ID GROUP BY ORD_ID; This has bothered me for a long time and I can't figure it out Thank you in advance
@DatabaseStar
@DatabaseStar Жыл бұрын
Hi, good question. I believe the column "totalamount" in the food_order table would do this. What error are you getting with that query?
@razhirsangasary
@razhirsangasary 7 ай бұрын
what happens if the customer update address after place order?
@DatabaseStar
@DatabaseStar 7 ай бұрын
Good question. I think the app would have to handle that, and perhaps we need some kind of history associated with the order.
@fnoodes
@fnoodes 4 ай бұрын
can I have a code for this example?
@DatabaseStar
@DatabaseStar 4 ай бұрын
I haven't created SQL code this example.
@IamDoQtorNo
@IamDoQtorNo 10 ай бұрын
Great videos/content. Your deliveries are SPOT ON, to include your following on comments from your subs. I want to setup a mysql server box off site from client for replication. Do you have a video about those setup?
@DatabaseStar
@DatabaseStar 10 ай бұрын
Thanks, I'm glad you like it! I don't have a video on that setup, unfortunately.
The Best Way to Store Phone Numbers in an SQL Database
6:25
Database Star
Рет қаралды 17 М.
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 1,9 МЛН
Je peux le faire
00:13
Daniil le Russe
Рет қаралды 22 МЛН
SCHOOLBOY. Мама флексит 🫣👩🏻
00:41
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 7 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 56 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 6 МЛН
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 76 М.
20 Years of SQL Advice in 11 Minutes
11:01
Database Star
Рет қаралды 7 М.
DoorDash & The Myth of Profitable Food Delivery
26:46
Modern MBA
Рет қаралды 996 М.
System Design: Food Delivery - BayOne Technical Bootcamp
1:39:31
BayOne Solutions
Рет қаралды 9 М.
How to Design a Database
10:57
Database Star
Рет қаралды 58 М.
What is DATABASE SHARDING?
8:56
Gaurav Sen
Рет қаралды 927 М.
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1,1 МЛН
Design Uber Eats - iOS System Design Interview
14:00
Andrey Tech
Рет қаралды 20 М.
Je peux le faire
00:13
Daniil le Russe
Рет қаралды 22 МЛН