Today I got a concern from my colleague, how to find the size of database file using sql query. Here is query, you can alter this query according to your need.
SELECT DB_NAME(database_id) AS DatabaseName,
Name AS Logical_Name,
Physical_Name, (size*8)/1024 SizeMB
FROM sys.master_files
WHERE DB_NAME(database_id) = ‘master’
GO