I wrote my first SQL queries today. I have had some exposure to them and know the basic idea of what they are doing, but I have never actually written a SQL query. Now that I am diving deeper into the world of backend development I am learning some SQL to help in my work with databases.
So far it is actually really fun to work with databases. It feels like with the constraints of the query language one has less to worry about than when programming in something like Javascript while still having the power to do some impressive things.
We have all had those moments where we impress ourselves with our creativity or ingenuity in finding a solution.
What is a time you did that when writing a SQL query? What was the query? Why did you need to write it? What are you most proud of in how you wrote it?
I would say, the latest big one was written 2-3 weeks ago, for ReportViewer as data source, in an MS SQL database stored procedure.
It collects invoice data from aproximately 5 tables and then makes a detailed select using all data. It uses parameters, and sub-queries that return values to local variables in the stored procedure, that are used in the final query.