multiple record sets

Results 1 to 2 of 2

Thread: multiple record sets

  1. #1
    dataman Guest

    Default multiple record sets

    Okay, kind of a tough one here. <BR><BR>I want to pull a selection from a field from table1 and another selection from a field from table 2 and then allow the user to enter in some information into a form. Then, all the information is saved into table3. Then later on, information is referenced off of the info that was pulled from table1 & table2. For instance, table1 holds all the information about classes. Table2 holds all the information about location that class can be held. Table3 is going to be the table that holds the information of when classes will be. They will see alist that will display dates & times and when they click on a location, it will display information from table2 and when they click to read more about the class, it will pull information from table1.<BR><BR>Does this make sense? Please let me know if clarification is needed.<BR><BR>Thank You in advanced!<BR>-Da DataMan

  2. #2
    Join Date
    Dec 1969

    Default Just a many-to-many table...

    *Not* "kind of a tough one." If you&#039;re going to be "Da DataMan", you need to go get a good book on DB design and read up on this kind of stuff.<BR><BR>Table 1 has a primary key. Can be an autonumber field or one that you assign yourself.<BR><BR>Table 2 has a primary key. Can be an autonumber field or one that you assign yourself.<BR><BR>Table 3 has *TWO* foreign keys. One references a record in Table 1. One references a record in Table 2.<BR><BR>Presto. You are done.<BR><BR>Example table layouts:<BR><BR>Table: Classes<BR>&nbsp; &nbsp; ClassID -- autonumber<BR>&nbsp; &nbsp; ClassName -- text<BR>&nbsp; &nbsp; ClassDesc -- text<BR>&nbsp; &nbsp; ClassUnits -- integer<BR><BR>Table: Locations<BR>&nbsp; &nbsp; LocationID -- autonumber<BR>&nbsp; &nbsp; Campus -- text<BR>&nbsp; &nbsp; Room -- text<BR><BR>Table: Sessions<BR>&nbsp; &nbsp; SessionID -- autonumber [optional, but a good idea]<BR>&nbsp; &nbsp; ClassID -- foreign key to Classes<BR>&nbsp; &nbsp; LocationID -- foreign key to Locations<BR>&nbsp; &nbsp; SessionTime -- Date/Time ?? [probably not? more like "Tues, 2PM-4PM"?]<BR><BR>******************<BR><BR>If you are going to use these tables for scheduling classes, you will actually need something somewhat more complex. You&#039;ll probably need a table that holds "SessionTimes" [e.g., the session meets Tues, 2PM to 4PM, *and* Thurs, 2PM to 5PM -- you don&#039;t want to try to capture that in a single field in the Sessions table]. And another table that holds "LocationTimes", perhaps, that shows when a given location is scheduled so you don&#039;t put two sessions into it at the same time. You don&#039;t *have* to have the LocationTimes table, since you can always dynamically construct it via a JOIN of Classes, Sessions, and SessionTimes. Simpler without it, actually. <BR><BR>Anyway, this is all pretty basic DB design, honest.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts