Check out example codes for "SQL Server get id of inserted row". It will help you in understanding the concepts better.

Code Example 1

-- For Microsoft SQL Server
INSERT INTO Table1(fields...) OUTPUT INSERTED.id VALUES (...)

Learn ReactJs, React Native from akashmittal.com