Database design question
Posted
by Lijo
on Stack Overflow
See other posts from Stack Overflow
or by Lijo
Published on 2010-04-28T05:39:58Z
Indexed on
2010/04/28
5:43 UTC
Read the original article
Hit count: 212
rdbms
Hi Team,
I have an interesting database design problem that I formulated while travelling by a bus, coming back from my home.
Design a normalized database for a bus ticketing system (not reservation system). In each trip, the conductor of the bus will give tickets to its passengers after collecting fare from them. Passengers travel from a various source places to various destination places.
The system must be able to give a report of the places for which the number of passengers was more than 2.
Suppose the stops for the bus are L1,L2, L3 and L4 Suppose passenger P1 travels from L1 to L4. P2 travels from L2 to L4. P3 travels from L3 to L4.
The report should list only (L3-L4) for which it has more than 2 travelers.
Can you please help me to solve the following problems
1) Design a normalized database
2) Write a query for the report
3) Is there any site that gives these kinds of interesting database design questions and answers?
Thanks
Lijo
© Stack Overflow or respective owner