I have a dataset featuring four fields: Identifier, Letter, Expression, and Amount. Below is an example layout:
-- Sample data structure
Record Ltr Calculation Amt
GroupA X 30
GroupB Y 15
GroupC Z X + Y
GroupD W Z + X + Y
Only the amounts for letters X and Y are provided. How can I design a SQL Server stored procedure to compute the amounts for GroupC and GroupD based on the given calculations?