Loan details
I want to create a table called loans and a table called loans details, in loans details I wants show the day an item was loaned and also the type media was loaned , I'm not sure how to put this in a stored procedure, where if that item was loaned it should tell me it was loaned to who and when that person loaned it
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Amira BedhiafiRank #601 · 4K reputationPosted May 6, 2025, 4:36 AM EDT
Simply try :
CREATE PROCEDURE GetLoanInfoByItem @ItemID INT AS BEGIN SELECT ld.ItemID, ld.ItemName, ld.MediaType, l.BorrowerName, l.LoanDate FROM LoanDetails ld INNER JOIN Loans l ON ld.LoanID = l.LoanID WHERE ld.ItemID = @ItemID; END;