Check out example codes for "convert .mdf to .bak". It will help you in understanding the concepts better.

Code Example 1

BACKUP DATABASE [NameOfDatabase] TO  DISK = N'D:\path\filename.bak' WITH NOFORMAT, NOINIT,  NAME = N'NameOfDatabase-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

Learn ReactJs, React Native from akashmittal.com