Well, currently I am into the third week of mongodb node course
"M101JS: MongoDB for Node.js Developers" and I am pretty
enjoying it.
Lots of personal learning into node and mongodb.
The third week subject of "Patterns, Case Studies &
Tradeoffs" is really interesting.
Here is a list of topics, I learned about:
- Mongodb rich documents concept.
- Mongodb schema use cases.
- Mongodb one:one, one:many, many:many use cases.
- How to select schema based on the usage like whether you want
max performance
or it may be a tradeoff.
One important point, I learned during the course is:
"While relational databases usually go for the normalised 3rd
form so that data usage is agnostic to application, but mongodb
schema arrangement is very closely related to application usage
and varies accordingly."
In this article I’m showing how to retrieve result based on today, week and month using mysql query. To learn the techniques just visit http://thinkdiff.net/mysql/getting-rank-today-this-week-and-this-month/
In my previous article I’ve shown how to get rank using mysql query. Now I’m showing how to retrieve result based on today, week and month using mysql query. Actually I also implemented this in my quiz project so I’m sharing this with you.
For the table structure please look my previous article http://thinkdiff.net/mysql/how-to-get-rank-using-mysql-query/
Task 1: I’ve to retrieve those users rank who played the game
today.
Solution: Look at the query
SELECT uid, participated, correct, wrong from quiz_user WHERE DAYOFMONTH(CURDATE())=extract(day from updated) ORDER BY correct DESC, participated ASC limit 30
So the above query returns the result of those users who played today. Here
CURDATE() …[Read more]