How to create a train schedule in SQLite3?

Go To StackoverFlow.com

-3

I have a class project. I have to make a database with tables that shows the time tables of a train.

The minimum requirements is

There is a Train going South and another going North. There are 10 stops for both trains. No 2 trains are at any stop at the same time. North bound and south bound trains are never at the same stop at the same time.

Each stop is 30 minutes from each other.

Train A is the south bound train Train B is the north bound train

  1. Design a table(s) for the trains
  2. Create an SQL Query to show what time Train A will arrive at the final stop if it leaves at 7:10AM from the origination.

The database is SQLite3.

I just need help with designing the tables.

I tried

>ID (Autonumber) INT
>StopName Text
>ArrivalStopTime Date/Time
>DepartureStopTime Date/Time
2012-04-04 19:38
by Cocoa Dev
What exactly is your question? (Hint: Please do the assignment for me is not a question) - Larry Lustig 2012-04-04 19:44
I just need help with how to design a database. Like what the columns and data type. I can figure out the SQL Querie - Cocoa Dev 2012-04-04 19:48
If you want someone to do your homework for you at least try to disguise it. Maybe even take a stab at it, post your schema and ask why X isn't doing Y, or if there's a more efficient approach than the one you've sketched out. You'll get much better responses and the q&a might actually end up being useful to other people out there trying to design tables for the first time - George Mandis 2012-04-04 19:55
I think the idea is that you propose a database schema and then people will help you improve it. You're asking for the schema itself and if someone else does it for you, then you won't learn how to do them. Give the task a try and then ask for specific doubts you encounter. I think most of the people will help you if you do that : - Mosty Mostacho 2012-04-04 19:58
I've tried several things but it didn't work out. (professor said my database table wasn't normalized - Cocoa Dev 2012-04-04 19:58


2

First do this.

Then do this.

2012-04-04 20:00
by Tim Lehner
Ads