For me the first time we dabbled with SQL was in a 3rd year Software Engineering course where the focus of the class was a single group project that we managed among ourselves by splitting tasks, conducting code reviews and handling the build and release in teams.
I recall one group doing the project login which went much along the lines of what the OP's article touched on. Their code was esseentially
var success = false
var query = SELECT * FROM users
while query.read
{
if query(user) == input_user && query(password) == input_pass
{
success = true
}
}
Yes. They selected the
entire user table.
Yes. They iterated over the entire result (even if first returned result was valid)
Yes. That was "shipped" for the project
No. My complaints notion they should be leveraging the database for all the things they're doing wrong were ignored. It was performant! Look! It logs in instantly! YEah, because there's 8 users on the database for this project, what about when it ""ships"" and there's 100,000? More?
---
My first real job dealing with a database wasn't much better. We were using a MS Access database with no normalized data. Our client's primary transaction data was across a table with 70 some columns, many of which were often duplicated values in some form or utilizing very bad practices. Since joining this company I've sped up queries in almost immeasurable ways and done things my older coworkers initially derided because they couldn't understand the syntax.
TL;DR SQL, for some stupid reason, is still treated as second class to core langauges and it is a god damn shame