Results 1 to 15 of 15
  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Unanswered: Help Needed... Urgent

    Hi,

    I am working on a College Attendance management project..

    Can anyone please provide me with the tables necessary for the attendance database..

    Thanx

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Have you read through he assignment? Either you need to come up with them yourself, or the professor has a script of them for download somewhere.

  3. #3
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Quote Originally Posted by aarthi9c View Post
    I am working on a College Attendance management project..

    Can anyone please provide me with the tables necessary for the attendance database.
    And when you're at it, also a debugged and working program (preferably GPL or just donated to aarthi9c), the necessary hardware, and software licenses (preferably Windows 7 and SQL Server 2008 R2 (latest patches)), delivered by tomorrow morning between 10:00 am and 11:30 am at aarthi9c's place. Thanx.

    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by aarthi9c View Post
    Hi,

    I am working on a College Attendance management project..

    Can anyone please provide me with the tables necessary for the attendance database..

    Thanx
    Here it is:

    Code:
    CREATE TABLE attendance
    (
        attendance_information VARCHAR(max)
    )

  5. #5
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Aarthi9c,

    We don't mind helping people, but as MCrowley already stated, we do expect you do do some of the work yourself.

    Show us what you got so far and we will gladly help you further.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  6. #6
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Shammat,

    That's a complete spoiler. That way he'll never learn.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  7. #7
    Join Date
    Nov 2011
    Posts
    4
    Quote Originally Posted by Wim View Post
    Aarthi9c,

    We don't mind helping people, but as MCrowley already stated, we do expect you do do some of the work yourself.

    Show us what you got so far and we will gladly help you further.
    can anyone suggest a query for finding the attendance of reg no:143

    regno | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
    ---------------------------------
    140 | P | A | P | P | A | P | P |
    141 | A | A | A | A | A | A | P |
    143 | P | A | P | P | P | P | P|


    or should i change the structure of the table...?????

  8. #8
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by Wim View Post
    Shammat,

    That's a complete spoiler. That way he'll never learn.
    The answer is on the same level of information as the question...

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    shammat, you forgot to declare a primary key
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Doesn't SQL Server 2008 R2 allow a PK on a VARCHAR(max) column? What if we upgrade to Denali?
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  11. #11
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    can anyone suggest a query for finding the attendance of reg no:143

    regno | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
    ---------------------------------
    140 | P | A | P | P | A | P | P |
    141 | A | A | A | A | A | A | P |
    143 | P | A | P | P | P | P | P|
    Code:
    SELECT *
    FROM Attendance
    WHERE RegNo = 143
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  12. #12
    Join Date
    Nov 2011
    Posts
    4
    Quote Originally Posted by Wim View Post
    Code:
    SELECT *
    FROM Attendance
    WHERE RegNo = 143
    i just want the count of no of P in that row...
    thanx

  13. #13
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by aarthi9c View Post
    i just want the count of no of P in that row...
    thanx
    you wouldn't do that with sql, you'd do that with your application language (perl, asp, php, whatever)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  14. #14
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    aarthi9c,

    I'm looking at your table design and saying to myself, if every day of attendance is a column, with a value of 'P' or 'A', and if SQL Server normally has a column limit of 1,024 columns, then you've designed a system that, after three years, would run out of space. Or, you'd have to do a lot of purging and shifting. Or, you are assuming that this school is not going to last that much longer.

    Bottom line, you have a bad table design there.

    Can you think of another table design that would offer an unlimited number of attendance days?
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  15. #15
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    or should i change the structure of the table...?????
    Yes.

    Have a look at Normalisation (Google). Your table is not normalised. Not normalised tables are hard to query in SQL, hard to maintain, hard to ...

    i just want the count of no of P in that row...
    When you have normalised the table, this query will give you your required output:
    Code:
    SELECT COUNT(*)
    FROM Attendance
    WHERE RegNo = 143 AND
       IndPresentAbsent = 'P'
    Read up about normalisation and give it a try.
    Last edited by Wim; 11-21-11 at 12:03. Reason: added IndPresentAbsent = 'P'
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

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