Dropbox security needs a review list of unused public file links.
Return links where access_scope is public, download_count is 0, and expires_at is either NULL or earlier than 2025-07-01. A link expiring on 2025-07-01 is not included. Return link_id, team_name, file_name, and expires_at, in that order. Keep NULL expires_at values as NULL.
access_scope
public
download_count
0
expires_at
NULL
2025-07-01
link_id
team_name
file_name
Sort by team_name descending, then file_name ascending, then link_id descending.
shared_links
INTEGER
VARCHAR(120)
VARCHAR(255)
VARCHAR(20)
DATE
101
Brand Studio
Autumn Campaign Brief.pdf
2025-06-30
102
Launch Asset Archive.zip
103
Legal Operations
Supplier Addendum.docx
104
Signed Vendor Terms.pdf
team
105
Product Research
Interview Clips.mp4
2025-06-18
4
Links 101 and 102 qualify because both are public, unused, and either expired before 2025-07-01 or have no expiration date. Link 103 is excluded because its expiration date is exactly 2025-07-01. Link 104 is not public, and link 105 has downloads.
DROP TABLE IF EXISTS shared_links; CREATE TABLE shared_links ( link_id INTEGER, team_name VARCHAR(120), file_name VARCHAR(255), access_scope VARCHAR(20), expires_at DATE, download_count INTEGER ); INSERT INTO shared_links VALUES (101, 'Brand Studio', 'Autumn Campaign Brief.pdf', 'public', '2025-06-30', 0), (102, 'Brand Studio', 'Launch Asset Archive.zip', 'public', NULL, 0), (103, 'Legal Operations', 'Supplier Addendum.docx', 'public', '2025-07-01', 0), (104, 'Legal Operations', 'Signed Vendor Terms.pdf', 'team', NULL, 0), (105, 'Product Research', 'Interview Clips.mp4', 'public', '2025-06-18', 4);