Which SQL Server license is appropriate for my use case? Can I use a free license? Mod note: This question is a poor fit or dba.se, but I am leaving this question because the number of people who are new to the field on an annual basis is still high, and licensing is always the hardest thing to navigate. Sometimes a helpful hand is all that we need to guide us on our journey. Sometimes we need to pay someone to teach us or review our work. Every journey will be different, and so occasionally we make exceptions. ~ jcolebrand


I have couple of databases that are used for training classes every now and then. Do I have to host these on a production server with SQL licenses or can they be treated as a non-production databases for licensing reasons?
Free Edtions
SQL Server 20xx Express Editions
SQL Server 2019 Express Edition is free for production, non-production, and redistribution.  After install you'll find the license terms at
C:\Program Files\Microsoft SQL Server\150\License Terms\SQLServer2019_License_EXPR_1033.rtf
SQL Server 20xx Developer Editions
If you install the free SQL Server 2019 Developer Edition, you'll find the license terms at
C:\Program Files\Microsoft SQL Server\150\License Terms\SQLServer2019_License_DEV_1033.rtf
Which reads in relevant part:

Non-free Editions
For for the non-free editions of SQL Server refer to the licensing guide here.
You can also run these editions of SQL Server for non-production purposes if you have an appropriate Visual Studio Subscription (formerly called MSDN).