By using this query i am getting document creator and created date
SELECT distinct n.audit_creator as creator,p.string_value as document_name,date(n.audit_created) as created_on From alf_node AS n,alf_qname AS q,alf_node_properties as p WHERE n.type_qname_id=q.id AND p.node_id=n.id AND p.qname_id IN (SELECT id FROM alf_qname WHERE local_name='name') AND n.audit_creator not in('admin') AND n.audit_creator not in('System') AND q.local_name='content' AND p.string_value NOT LIKE '%.xml' order by created_on ASC;
First of all, it is really not recommended to access the Alfresco database at a low level. What is wrong with just using the APIs that Alfresco provides for accessing the creator, creation date and name of a document? You can even use Alfresco query features to filter out any documents created by the System or admin users...
There is - by default and without any customisation - no tracking of the "most viewed" documents, so you cannot query for that out-of-the-box. The "like" rating is stored as a property on the document itself, so you can simply to a query for that and sort based on the value. The property in question should be cm:likesRatingSchemeCount.