Functional Programming in…SQL? • Sam Roberton • YOW! 2019

Sam Roberton

Learn how to harness the power of functional programming concepts in SQL, such as pure functions, referential transparency, and immutability, to write more efficient and maintainable code.

Key takeaways
  • The speaker argues that functional programming concepts can be applied to SQL, and that it’s a good idea to do so, but it’s not always easy or straightforward.
  • SQL functions can be treated as pure functions, with no side effects, which can make it easier to reason about their behavior.
  • The speaker discusses the concept of referential transparency in functional programming, and how it can be applied to SQL.
  • He shows examples of how to use SQL functions to perform data transformations, such as concatenating tables and applying filters.
  • The speaker argues that treating SQL as a programming language, rather than just a query language, can make it easier to reason about and write efficient code.
  • He discusses the importance of immutability in functional programming, and how it can be applied to SQL.
  • The talk concludes with the idea that SQL can be used as a functional programming language, but that it’s not always easy to do so, and that there are limitations to how far this approach can be taken.