Bonus PDF: This ERD, descriptions of each table and column with sample data, and SQL scripts to create all of the tables on your own database: www.databasestar.com/dbdesign/?
The diagram looks amazing! I am developing a train travel webapp, I did it in a different way but your diagram helps me improve my system, I have already taken into consideration that the user can buy several tickets at the same time
Great diagram and walkthrough, Ben! One thing to note: You'll want to be sure to capture "Origin" and "Destination" or a directional equivalent on the Journey table, as the station stops along the NY > BOS journey may not be the exact same sequence as the BOS > NY journey in the reverse order.
Great stuff. Thanks for the awesome content! I'd be interested to see how you solve for the seating capacity being adjusted by an overlapping route. For example a route from station A -> B -> C. How would you account for a booking of the route from station B -> C? There should be one less seat available from station A -> B -> C, right?
You're welcome! That's a good question. I'm not sure. It may be best to break the routes into station by stations, and when a booking is made for a start and end station, then it's stored as occupied for those stations but not for other stations.
Amazing video but i believe you made a mistake. DepartureTime is not the same as Arrival time so you're suffering integrity issues. Also, there is alot of normal form violations which makes this table insufficient. If im wrong or overlooking something please let me know, thanks.
Thanks for the feedback! Yes you’re right, this design assumes arrival and departure are at the same time, but in reality they aren’t, so we could add another column. What are the other normal form violations that you see?
these are fantastic. any chance of providing a design with auditable tables? im a chronic sufferer of 'YAGNI' and lose sleep and time mostly over features noone asked for but that little voice in my head says is a good idea. case in point, when i see this design i think it could be further enhanced by somehow allowing for the ability to have an audit trail of sorts to backtrack through booking status changes, payment/refund changes, etc. trying to find good and scaleable solutions to auditing that doesn't include an expensive third party are few and far between sadly....definately lookin forward to that on this channel. keep up the solid work these are awesome
Thanks! Yes I do have a video on audit tables coming up soon. I had another comment recently about it (perhaps it was you as well) so I'll create it soon. I think this design could be enhanced with audit tables as you have said - it's a good point.
This video is really amazing, Would like to know more on how we can enhance this if seat_id is selected by passanger and not assigned internally by management app
Bonus PDF: This ERD, descriptions of each table and column with sample data, and SQL scripts to create all of the tables on your own database: www.databasestar.com/dbdesign/?
The diagram looks amazing! I am developing a train travel webapp, I did it in a different way but your diagram helps me improve my system, I have already taken into consideration that the user can buy several tickets at the same time
That's good to hear you've found this video useful and have used it to improve your own design!
Good stuff. I am learning system design from your playlist. Thanks!
Great to hear!
Great diagram and walkthrough, Ben! One thing to note: You'll want to be sure to capture "Origin" and "Destination" or a directional equivalent on the Journey table, as the station stops along the NY > BOS journey may not be the exact same sequence as the BOS > NY journey in the reverse order.
Thanks! That's a great point, something to definitely consider and to probably update the diagram to allow.
hi Ben , the diagram is amazing. So simple and clear. Could you please add performance tuning for SQLs in future?
Thanks! Sure, I do have some videos on my channel already about SQL performance and I’ll create more in the future.
Thank you so much for this video!
You're welcome!
Great stuff. Thanks for the awesome content!
I'd be interested to see how you solve for the seating capacity being adjusted by an overlapping route. For example a route from station A -> B -> C. How would you account for a booking of the route from station B -> C? There should be one less seat available from station A -> B -> C, right?
You're welcome!
That's a good question. I'm not sure. It may be best to break the routes into station by stations, and when a booking is made for a start and end station, then it's stored as occupied for those stations but not for other stations.
Amazing video but i believe you made a mistake. DepartureTime is not the same as Arrival time so you're suffering integrity issues. Also, there is alot of normal form violations which makes this table insufficient.
If im wrong or overlooking something please let me know, thanks.
Thanks for the feedback! Yes you’re right, this design assumes arrival and departure are at the same time, but in reality they aren’t, so we could add another column.
What are the other normal form violations that you see?
thanks, im developing train booking ticket right now. Student exercise
Glad it has helped!
these are fantastic. any chance of providing a design with auditable tables? im a chronic sufferer of 'YAGNI' and lose sleep and time mostly over features noone asked for but that little voice in my head says is a good idea. case in point, when i see this design i think it could be further enhanced by somehow allowing for the ability to have an audit trail of sorts to backtrack through booking status changes, payment/refund changes, etc. trying to find good and scaleable solutions to auditing that doesn't include an expensive third party are few and far between sadly....definately lookin forward to that on this channel. keep up the solid work these are awesome
Thanks! Yes I do have a video on audit tables coming up soon. I had another comment recently about it (perhaps it was you as well) so I'll create it soon. I think this design could be enhanced with audit tables as you have said - it's a good point.
@@DatabaseStar oh dang that was me. completely forgot about that. alright ill stop nagging for an audit table video now
No problem! Thanks for giving me more info about what you need anyway.
Request to make a Db design for udemy like LMS platform!
Thank you for your awesome contents 🖤
yes please, that would be great..
There, we can include features like Quiz - MCQs, % completion of the course, locking the new videos, etc.
@@shobhitmittal77 Yes
Thanks for the request! Sure I can make a video about designing a database for a LMS.
@@DatabaseStar thanks for taking my request into your consideration... looking forward to it 🖤
Great video! I was just wondering to what extent is the database normalized? Is it FN3?
Thanks! Yes it should be in third normal form.
Very interesting exercise thanks
Glad you enjoyed it
tnx man, is there any way to download this pdf?
Yes, you can get the PDF here: www.databasestar.com/dbdesign/
This video is really amazing, Would like to know more on how we can enhance this if seat_id is selected by passanger and not assigned internally by management app
Thanks! Yeah you may have to add seat numbers or seat id to a carriage and have the application run a query to show available seat numbers.
Can please help or make project train database access
What do you mean? This video is about a train database.
@DatabaseStar full project database access please 🙏
I still don’t understand what you mean. Have you watched this video you’re commenting on?
Yes
Great
Thanks!