Day[20] Is SQL Real?

We began learning a language called SQL today (pronounced “Sequel”) and it seems too good to be true. As far as I can tell, there are no loops, no switches, no mind-bending access modifiers, getters, setters, or constructors.

SQL stands for Structured Query Language. It is the computer language used to communicate with data bases. It’s a declarative language, meaning that you’re not trying to tell a computer what to do, but what you want from it. In C#, I had gotten used to telling the computer to loop through a list looking for certain variables with certain qualities and then to display them in the way of my choosing. SQL’s not about that life. SQL’s a no drama language.

For example, in C#, if we tried to find cities in Pennsylvania with a population over a million, it would be two for-loops, probably, going through each list to find the information and a “Console.WriteLine()” to write it to the console. Maybe ten lines of code.

In SQL, it might look like this:

SELECT city FROM list WHERE population > 1000000

That’s it. It’s practically English.

To me, C# is a language that you must speak at a high level to do anything at all and SQL is like talking slowly and loudly because you think the computer can’t understand you. It reminds me of going to Costa Rica and subjecting the Costa Ricans to my terrible Spanish. They can understand me as far as ordering a beer or asking where the bathroom is, but we’re not going to launch a rocket to the moon with this level of communication.

I’m sure it will get ten times as complicated in the coming days, but as for today, it was the easiest homework we’ve had in 21 days of difficult homework. Thank you for keeping it simple, SQL.

Leave a comment