top of page

Snack-Sized Data Basics
Database Language: SQL

A couple years ago, my then five year old daughter asked me what I did for work. I wasn’t sure how to explain it to her, so I said, “I tell computers what I need.

She looked at me, confused, so I explained: "You know how you and I speak English? When you need something, you tell me in English so I understand. Well, computers don’t always understand English the way we do, so I have to tell them what I need in their own special language so they can help me. They understand some English words, but they use them a little differently.​

do you understand.gif

We turned it into a fun little game. I pretended to be a robot and gave her a list of special words I could understand. Her task was to only use those words to ask me for a cup of water. It was fun and a little messy, but in the end, I think it was a good intro.

typing.gif

That “special language” I was referring to, for databases, is called SQL (pronounced Sequel or S-Q-L). SQL stands for Structured Query Language. There are different database systems that use SQL, such as PostgreSQL, MySQL and Microsoft SQL Server. While they sometimes use SQL a little differently, they all follow the same basic principles.

MurielLiguori-1.jpg

From our Day 1 example (table shown above), if we want to get the names of all students in our school, we can write the following SQL query to get that information from our database. â€‹

 

  SELECT first_name, last_name

  FROM demographics;

Notice that we specified the column names (first_name, last_name) and the table name (demographics), so the database knows exactly what to retrieve.​

bottom of page