SQL For Spreadsheet Users Series — PART 3

How To Excel in SQL With Your Existing Spreadsheet Skills

Kamaro Lambert
3 min readJan 3, 2024
Photo by Jan Antonin Kolar on Unsplash

I recommend you go through SQL for spreadsheet users — PART 2 if you haven’t read it yet.

Your first Data Read From SQL database

We need a database to use! Luckily, you don’t have to install one on your computer.

Just go to https://sqliteonline.com/ and there you go! You have a free database set up for you to practice without risking real data corruptions. SQLiteonline.com lets you work with different types of databases like MariaDB (MySQL), SQLite, and more.

You can either register or just use guest users. You don’t have to register to follow along, but keep in mind you’ll lose your data each time you log out or close the window. After you’ve successfully logged in, you should see a window that looks like the following.

  1. It Is called a query editor. It’s an open field text editor in which you compose your queries. Don’t worry, I will be giving you examples.
  2. A button to press and get results from database based on what you’ve written in the field #1.
  3. Tabulated results returned from the database table?

You might have noticed that even if we are using SELECT, we are adding FROM, a new keyword to indicate that you need results from a specific database table. Unlike the spreadsheet we used in the previous section, SQL queries expect you to indicate the table containing the data you want to retrieve.

So, SELECT * FROM demo; can be explained as follows:

  • SELECT: This part of the query is like saying, “I want to see something.” It’s like choosing what information you want to look at.
  • *: The asterisk (*) means “everything” or “all.” So, SELECT * means “I want to see all the information.”
  • FROM demo: This part tells the computer where to look for the information. In this case, it says, “Look in the table called ‘demo’.”

When you put it all together, the statement is saying, “Show me all the information from the ‘demo’ table.” In simpler terms, it’s like asking a database to display everything it has in a specific table called ‘demo’. This is a common way to retrieve information from an SQL database.

We found the “demo table” already created for us by SQLiteonline. So don’t worry about it. To read SQL data for your first time, go to the editor, then write SELECT * FROM demo and click the run button to see the results. It should look like the result on the previous screen.

In the previous section, we’ve seen that you can instruct SQL on what columns to return in the results. Now, you can go ahead and modify SELECT * FROM demo to return only names from the demos table.

If you’ve been following along, you should be able to write SELECT name FROM demo; and that should return results like the following. As you can see, only the name column is returned.

--

--

Kamaro Lambert

I write about principles to maximize your potential as an individual by sharing lessons from my experience and top 10% leaders. CTO