Sitemap
Faisol Abdulwaheed

Faisol Abdulwaheed

I write to think. I read to learn. I learn to share.

4 min readSep 11, 2023

--

Press enter or click to view image in full size
INTRODUCTION TO SQL

SELECT SQL!

Hi, Tech enthusiasts! I am Faisol, an emerging Data Scientist. As I set out to learn SQL, I want to share two things with my fellow learners. The first item is a short homework I did about SQL, and the second is what I learned from DataCamp’s “Introduction to SQL” course.

(1)

In plain text, Structured Query Language (SQL) is a programming language that communicates and interacts with a database. A database is a storage system made up of collections of data, and the compatible software application for managing its workload is the Database Management System. Like other Programming Languages, SQL also has its syntax of codes and commands, but what sets it apart from others is that it strictly works with databases, and not just any type of database, but a RELATIONAL DATABASE. A Relational Database is a structured and organized assortment of data arranged in tables as rows and columns. In SQL, the rows are called RECORDS and the columns are called FIELDS

With this basic understanding of SQL, a question that piques our curiosity is: “If SQL works with databases, what does it do with data?”

· DATA RETRIEVAL: SQL helps us specify what we want to extract from a database by querying it (asking questions) with statements that request data that from the database.

· DATA MODIFICATION: with the right commands, SQL can make changes to our data, such as adding to columns or deleting from rows.

· DATA MANIPULATION: SQL helps perform arithmetic operations and calculations on our data, and also provides functions for performing summary statistics

· DATA CONTROL: SQL helps to manage and secure our data and let us control and manage its accessibility.

After these findings, it came to my mind that spreadsheets can also do what a database does, but a deeper dive into the subject matter revealed the following distinctions to me:

1. Databases provide more storage while spreadsheets like Microsoft Excel and Google Sheets are more limited in space.

2. Databases secure data by encryption while the usage of passwords is common in spreadsheets

3. Databases are used for complex, large, and big data while spreadsheets are suitable for simple and small datasets.

4. Although databases and spreadsheets provide multi-accessibility, databases are more robust.

(2)

Now, Let’s explore the DataCamp’s “Introduction to SQL” course together in the rest of this writeup.

The course introduces learners to the fact that while SQL is the standard, there are different flavors that also speak the language of SQL but in different but similar dialects. These include T-SQL, MYSQL, PostgreSQL, among others. The vendors of various Database Management Systems (DBMS) are responsible for the slight variations in these flavors by blending the SQL language in its syntax, functionality, or features into another version. I learnt that all SQL versions all work with relational databases, share the majority of keywords, and follow the same universal standard.

SOME KEYWORDS I LEARNT:

Get Faisol Abdulwaheed’s stories in your inbox

Join Medium for free to get updates from this writer.

v SELECT: one of the most instrumental keywords in SQL, if not the most common. It’s primarily used to retrieve information from tables, but is can also function along with other keywords to filter, aggregate, sort, alias or join data

v FROM: it indicates the source of data where we want to perform our operations.

v AS: it’s used to assign a new name to a column or table. I think of this as nicknaming.

v DISTINCT: it’s used to get non-duplicated/unique values in our output.

KEY TAKEAWAYS FROM THE COURSE (INTRODUCTION TO SQL):

- Understand the data schema: it shows the relationship among tables.

- Use unique identifiers or keys to distinguish records from one another.

- The names of tables should be in lowercase.

- Use underscores in place of spaces.

- The field name should be in singular rather than plural.

- Fields should never share a name with the table where they belong.

- When a table is created, each field must have a specified datatype.

- You can use an asterisk (*) to select all fields

- In other languages. it’s a string; In SQL, it’s the CHARACTER datatype, housing VARCHAR, TEXT and others.

- In other languages, it’s an integer; In SQL, it’s the NUMERIC datatype, housing INT, FLOAT, SERIAL and others.

As a beginner, I learned a few best practices to write SQL like a pro:

- Although, SQL does not follow strict indentation rules, make your code clean by using new line.

- End the query with a semicolon

- Capitalize the keywords such as SELECT, FROM among others.

--

--

Faisol Abdulwaheed
Faisol Abdulwaheed

Written by Faisol Abdulwaheed

I write to think. I read to learn. I learn to share.