How to Code (just a little bit)

I learned a little bit of SQL, Python, HTML, CSS in college. As a disclaimer, I’m not very good at any of those, but coding is not as complicated as you might think. You just need to pull it apart and distill it.

Here is a little bit of SQL. It helps you access and manipulate databases. It’s sometimes called sequel.

Data is valuable to businesses to examine market trends, customer trends, and to streamline their products. Predictive analytics help businesses project outcomes and make good decisions.

Below is a table showing data of 5 people. It shows their ID, their last name, and their favorite food.

This table is pretty simple, so you could certainly streamline the information without any code. But if you’re dealing with thousands or millions of data points in a table, SQL can help you filter out what you need.

Let’s say you would like to find only employees who like strawberries and you would like to see them ordered alphabetically by last name.

The code for that is in pink.

Here is how to understand each piece.

  • Select means select
  • * means all
  • FROM goes in front of the table you are selecting from
  • WHERE goes in front of the variable or column you are filtering from
  • favorite_food is the name of the column variable (no spaces in variable names)
  • = ‘Strawberry’ means the column variable needs to have the word ‘Strawberry’ in it.
    • Strawberry is in quotes because it is a string. Programming languages don’t use words, they just consider them a string of letters that don’t change.
    • To identify something as a string of letters(or word), put it in quotes
  • ORDER_BY means put the identified variable in alphabetical order.
  • last_name is the column ORDER_BY will alphabetize

Here is the outcome of this code.

Notice the person with the last name Davidson got filtered out because his favorite food is not strawberries.

Also, the last_name column is alphabetized, so the corresponding ID numbers are out of order.

I hope this is simple enough to enjoy.

And I hope you are finding ways to support Ukraine and each other.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s