Dashboard Report - Top Uploads

This is an SQL version of the Dashboard Report for Top Uploads.

This report provides a detailed list of files uploaded by users within a specific date range. It includes the user ID associated with each upload, the file extension, the size of the file in megabytes, and the original filename.

--[params]
-- date :start_date
-- date :end_date

SELECT 
    user_id, 
    extension,
    ROUND((filesize/1048576.00),1)||'MB' AS "File size",
    original_filename Filename
FROM uploads
WHERE created_at::date BETWEEN :start_date AND :end_date
ORDER BY filesize DESC

Parameters

  • :start_date: The beginning of the date range for the report.
  • :end_date: The end of the date range for the report.

Both date parameters accept the format of YYYY-MM-DD .

Example Results

user extension File size filename
user_1 mp4 26.8MB uploadname012345.mp4
user_2 mp4 26.4MB example_mp4name.mp4
user_3 mov 23.3MB screenrecordingofanerror.mov
6 Likes