How to check SQL Server Database compatibility after sp_dbcmptlevel is deprecated?

select name, compatibility_level , version_name = 
CASE compatibility_level
    WHEN 65  THEN 'SQL Server 6.5'
    WHEN 70  THEN 'SQL Server 7.0'
    WHEN 80  THEN 'SQL Server 2000'
    WHEN 90  THEN 'SQL Server 2005'
    WHEN 100 THEN 'SQL Server 2008/R2'
    WHEN 110 THEN 'SQL Server 2012'
    WHEN 120 THEN 'SQL Server 2014'
    WHEN 130 THEN 'SQL Server 2016'
    WHEN 140 THEN 'SQL Server 2017'
    WHEN 150 THEN 'SQL Server 2019'
    ELSE 'new unknown - '+CONVERT(varchar(10),compatibility_level)
END
from sys.databases

select compatibility_level from sys.databases where name ='myDB'

Thought this would be useful here...

65 = SQL Server 6.5
70 = SQL Server 7.0
80 = SQL Server 2000
90 = SQL Server 2005
100 = SQL Server 2008/R2
110 = SQL Server 2012
120 = SQL Server 2014
130 = SQL Server 2016