file TABLE
file_id - unique
file_url
file_service
file_thumbnailurl
file_width
file_height
file_userid – person who add this file
file_datetime – datetime file added, using mysql timestamp, like this “2012-02-02 13:11:24”
info TABLE
info_file_id – unique, refer to file_id in file TABLE
info_title – varchar, title of the file...
info_description – text, description of the file...
info_category1 – one value, for example “3”
info_category2 – one value, for example “1”
info_tag – tag list, it looks like “michael jackson, rock, favorite star”
info_userid – person who add this
info_datetime – info added, using mysql timestamp, like this “2012-02-02 13:11:24”
info_safemode – 1 is on, 0 is off .
counter TABLE
counter_file_id – unique, refer to file_id in file TABLE
counter_view – number of views
counter_comment – number of comments
counter_like – number of likes
counter_share - number of shares
counter_point – a total point for sum all the value(for example 1 view = 1 point, 1 comment = 20 points, 1 like = 10 points, 1 share = 20 points)
We need YOU to provide 13 SQL queries
- all result must be unique (file_id)
- able to apply paging (currently i use LIMIT offset, row-per-page)
- all datetime base on server, and refer to the info TABLE, not file TABLE.
[login to view URL] the last 30 days records sort by counter_point desc, that means the highest point come first
[login to view URL] the last 30 days records with specific category sort by counter_point desc, that means the highest point come first, the category match either category 1 & category 2.
[login to view URL] get any 4 records
[login to view URL] the latest 4 records with specific category sort by latest come first
[login to view URL] all records sort by counter_point desc.
[login to view URL] records with specific category sort by counter_point desc.
[login to view URL] all the latest records sort by latest come first
[login to view URL] the latest records with specific category sort by latest come first
[login to view URL] all the records with specific keyword(the search thru – title, description, tag) sort by latest come first
[login to view URL] all the records with specific keyword(the search thru – title, description, tag) sort by counter_point desc, highest point come first
[login to view URL] all the records with specific tag, sort by latest come first
[login to view URL] all the records with specific tag, sort by highest point come first
[login to view URL] all the result similar to one of them. for example this record, fileid= eg. 123, category1=”music”, category2=”mtv” & tag=”michael jackson, album, tribute”. So, we need to get the revelent records that similar to this. (if it is slow&heavy, we will do/update this records via “cronjob” every hour that store the revelent list in another table)
I'd like to work on you project and provide you with the SQL queries you require. I have been writing SQL's for over 5 years and this is my first time on this site so my ratings may be low.
Give me 1 day to prove to you what I'm capable of.