Results 1 to 2 of 2

Thread: Sql query

  1. #1
    Join Date
    Jan 2004
    Posts
    153

    Unanswered: Sql query

    Hi All,

    I have two tables as below:

    Table : Teacher

    Teacher Code Teacher Name
    --------------- ----------------
    1 Jack
    2 John


    Table : Subject
    Class_no Subject Time
    ----------- --------- -------
    1 English 08:00
    2 Maths 08:00
    3 Geography 09:00
    4 Economics 09:00
    5 Geology 10:00
    6 Physics 10:00
    7 Sociology 11:00
    8 GK 11:00

    I would like to allocate class to each teacher equally as follows and store data into another table called Allocation:

    Table : Allocation
    Teacher Code Class_no
    -------------- -----------
    1 1
    2 2
    1 3
    2 4
    1 5
    2 6
    1 7
    2 8

    It would be nice if you can help me on this.

    Thanks with advance,
    JD

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Due to the fact that this is homework 101, you should try doing it yourself. Otherwise it would be "cheating".

    Code what you can and maybe some good Samaritan will help you out.

    Besides, your requirements are incomplete, what do you mean by "allocate class to each teacher equally": equally based on what? You need to be more specific and describe the rules to get the expected result from the source data.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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