tags:

views:

25

answers:

2

i have a table as show

StudentTable

S.no StudentName Marks
1    Stud1       100
2    Stud2       350
3    Stud3       400

Here the marks column for each student will get updated upon each test.

lets Consider Stud1, Stud1 got 50 Marks in 1st Test and 50 Marks in 2nd Test. Totally 100.

I know the dates when the tests are held.

Is there any way to get the 1st Test Mark of Stud1 from the above table.

Does MySql has any way to get the value.

DB design cannot be changed having a separate table for marks along with Test date

*Not a homework

+1  A: 

There is no data in the example you provided that would allow you to extract information specific to a date. If you have further information, you'll need to provide it. But given what you've provided, I can confidently say no.

The only remotely-possible idea I can think of is a record of queries, and their date of execution. This would allow you (following some parsing) to find out this type of information. But any log keeping a complete history of queries would fill up quickly in many environments. I'm not sure if this is the case with yours.

Jonathan Sampson
Yup. But is there any way with the help of MySql?
Sri Kumar
Sri, MySQL is a tool, not a Genie. It grants data, not wishes. :)
Jonathan Sampson
Ha Ha Ha Just i need to confirm :)
Sri Kumar
Sri, I updated my answer with a possible idea concerning a record of queries.
Jonathan Sampson
Thanks for the update! That is really great idea to dig the history! Yeah your right i don't have any query history.
Sri Kumar
A: 

No, this isn't possible. You'd need to modify your database schema to include another table, which would record each individual test instance.

Once you change a field (in this case, "Marks"), the previous value is lost. There's no way to dig through its history.

Trevor Johns