Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    1

    Unanswered: Multiple table Query

    Hello,

    I have got 4 tables student, course, enroloment, exam fees
    A student can be enrolled on a course and the course has a fee associated with it. I can produce a query that will select all students on a course with the course fee and the enrolment date as follows

    Name course date fee
    Paul Maths 2003-12-01 30.00

    The question I have, is as the database becomes bigger and more students are enrolled. I need to be able to add all the fees together and include a single total at the end of the query whilst still displaying all the four fields above with all the records. Can anyone help as I am new to MySQL and I am at a dead end. I have heard of away using sum by in the where clause but I do not know if this is correct as i cannot find any info on this

    Many Thanks

    Paul

  2. #2
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188

    Thumbs up Re: Multiple table Query

    Hi Paul,

    it seems you know very little about query and DBMS as well. Normally, people use query to base their reports. what you need to do now is to create a report that is based on your existing query and then add a SUM field at report footer. thats it. I dont know what software have you used to access your data so cant give more details on how.

    hope this help

    qha

    Originally posted by paulspn1
    Hello,

    I have got 4 tables student, course, enroloment, exam fees
    A student can be enrolled on a course and the course has a fee associated with it. I can produce a query that will select all students on a course with the course fee and the enrolment date as follows

    Name course date fee
    Paul Maths 2003-12-01 30.00

    The question I have, is as the database becomes bigger and more students are enrolled. I need to be able to add all the fees together and include a single total at the end of the query whilst still displaying all the four fields above with all the records. Can anyone help as I am new to MySQL and I am at a dead end. I have heard of away using sum by in the where clause but I do not know if this is correct as i cannot find any info on this

    Many Thanks

    Paul

Posting Permissions

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