Sample Header Ad - 728x90

Why are scalar functions special? A case study of trying to understand database terminology as a beginner

0 votes
2 answers
446 views
I am trying to learn the basics of databases, but I am finding the terminology especially impenetrable compared to other things I have learned. Most of the database tutorials and documentation I have looked at explain everything in terms of other database terminology. Most examples only show code but not actual output, so I am often unclear as to what the expected output is. I am usually even less clear on what the intended use case is. For example, take the term "scalar function" which I recently come across. It is defined here similarly to other definitions I found. https://raima.com/database-terminology/ : > Scalar Function – Either a built-in SQL function or a user-defined > function that returns a single value computed only from the values of > any required arguments at the time the function is called. Why is that special? How is that different from just a function that outputs one value? Why is the fact that the arguments are "required arguments" a noteworthy distinction? Why, in practical terms, would it be important to specify that a scalar function is to be used? I would appreciate both an answer to this specific question and references to database (preferably Postgres) learning materials that make a point to explain each technical term in the least technical way possible.
Asked by Stonecraft (125 rep)
Jul 27, 2022, 08:52 PM
Last activity: Jul 27, 2022, 10:16 PM