Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6187873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:08:02+00:00 2026-05-24T02:08:02+00:00

I am doing college project in winform, mysql ,c#. for that I have created

  • 0

I am doing college project in winform, mysql ,c#.

for that I have created mysql table with this structure,..

CREATE TABLE `attendance_monthly_rpt` (
  `id` int(15) NOT NULL AUTO_INCREMENT,
  `student_no` varchar(50) NOT NULL,
  `student_name` varchar(50) NOT NULL,
  `day1` varchar(15) NOT NULL,
  `day2` varchar(15) NOT NULL,
  `day3` varchar(15) NOT NULL,
  `day4` varchar(15) NOT NULL,
  `day5` varchar(15) NOT NULL,
  `day6` varchar(15) NOT NULL,
  `day7` varchar(15) NOT NULL,
  `day8` varchar(15) NOT NULL,
  `day9` varchar(15) NOT NULL,
  `day10` varchar(15) NOT NULL,
  `day11` varchar(15) NOT NULL,
  `day12` varchar(15) NOT NULL,
  `day13` varchar(15) NOT NULL,
  `day14` varchar(15) NOT NULL,
  `day15` varchar(15) NOT NULL,
  `day16` varchar(15) NOT NULL,
  `day17` varchar(15) NOT NULL,
  `day18` varchar(15) NOT NULL,
  `day19` varchar(15) NOT NULL,
  `day20` varchar(15) NOT NULL,
  `day21` varchar(15) NOT NULL,
  `day22` varchar(15) NOT NULL,
  `day23` varchar(15) NOT NULL,
  `day24` varchar(15) NOT NULL,
  `day25` varchar(15) NOT NULL,
  `day26` varchar(15) NOT NULL,
  `day27` varchar(15) NOT NULL,
  `day28` varchar(15) NOT NULL,
  `day29` varchar(15) NOT NULL,
  `day30` varchar(15) NOT NULL,
  `day31` varchar(15) NOT NULL,
  `tot_persent` int(15) NOT NULL,
  `tot_absent` int(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

I update this table columns day1 to day31 with P,Ab,OD. Now i want to Update tot_persent in the logic of tot_absent to sum of Ab and sum of P and OD.

For example…

IHM22557001, Jegadeeswaran , Ab , P, Ab , OD, 0, 0 , OD , Ab , 0 , 0 , 0, Ab

tot_persent is 3
tot_absent is 4..

thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:08:03+00:00Added an answer on May 24, 2026 at 2:08 am

    I’m going to suggest a different schema; day-based. If you have day-based, i.e.

    Id, StudentNumber, Date, Status
    

    Note that the Update tot_persent etc don’t exist in pre-calculated form, since they are trivially available in the data.

    Then the data can be obtained by the pretty clean:

    SELECT   Date, Status
    FROM     StudentAttendance
    WHERE    StudentNumber = @no
    AND      Date >= @start AND Date <= @end
    ORDER BY Date
    

    and for the aggregates

    SELECT   Status, COUNT(1)
    FROM     StudentAttendance
    WHERE    StudentNumber = @no
    AND      Date >= @start AND Date <= @end
    GROUP BY Status
    

    More-over, working with day-based records would also make it trivial to do the aggregates in your app layer rather than trying to do everything at the database – if you have the data for the days, you don’t need the DB to do the aggregates (LINQ-to-Objects would be good, since you mention C#).

    Personally I’d use an integer-based Status, but that is subjective. But mapping it to a C# enum would work very well, i.e.

    public enum AttendanceStatus : byte {
        Present= 1,
        Absent = 2,
        ...your other values etc...
    }
    

    which would presumably by tinyint or similar at the DB. Most ORM/micro-ORM will map that for you automatically so you don’t have to do anything clever there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am doing a library project for my college. in that, i have table
I'm a college student doing a Java homework. I've created this program that allows
I'm doing a project for college and have create a panel with a simple
I'm doing my college's task. I wrote like this int debut[10][100]; char ngroup[10][100]; do
I am doing Student Attendance project for college in win form with MySQL(C#). see
I am doing a college attendance project (Winforms, Mysql, C#) I want to update
I am doing Student Attendance project for college in win form with MySQL(C#). I
Hi Im doing a project for college and have a JTable in my GUI.
I'm doing work for college and I have to determine, which of the three
I'm doing a project for a college class I'm taking. I'm using PHP to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.