Question: what difference between scalar-valued function and table-valued function in sql?
Answer: A scalar function returns a single value. It might not even be related to tables in your database. A tabled-valued function returns your specified columns for rows in your table meeting your selection criteria. An aggregate-valued function returns a calculation across the rows of a table -- for example summing values.