As part of my personal development, I recently decided to take a refresher on SQL by testing out a Datacamp subscription. The Associate Data Analyst in SQL track, Associate Data Engineer in SQL track , and SQL fundamentals all start with an Introduction to SQL course and so that’s the first course I took. Topics covered included what is SQL, what are relational databases, what are flavors, how to write a query, and some keywords. After taking the course, I felt the knowledge would be best shared and reinforced by sharing a recap!
So what is SQL?
SQL (can be pronounced like sequel or as its letters S-Q-L) stands for Structured Query Language and it is a programming language that is used by many companies in the US and around the world to manage data and update relational databases.
SQL standards were established by the American National Standards Institute (ANSI) in 1986 and the International Organization for Standardization (ISO) in 1987 to ensure consistency and interoperability across different database systems. Standards are constantly being updated
What is a relational database?
A database stores data in a table, which is information organized in rows and columns and a relational database represents a collection of tables and defines the relationship between the tables. Within a table, the rows are oftentimes referred to as records and columns are referred to as fields. Through the relationship between tables, we can draw conclusions about data housed in separate tables in the same database.
When compared to a spreadsheet, a database has multiple advantages which include but are not limited to storage capacity and security through encryption. Multiple users can also access and write queries from the data at the same time – this is because when the data inside the database is queried, the data does not overwrite or get altered, the data is pulled and presented according to how the data is queried.
What are flavors?
While SQL provides a common foundation as set by the ISO and ANSI, different database management systems have been developed over the years by various organizations such as Microsoft to address specific needs or provide additional features. These different versions of SQL are called SQL flavors. When it comes to SQL flavors, while the core of SQL remains the same across these systems (like how you write a basic query), each "flavor" might offer additional tools, syntax, or optimizations that make it unique.
What is a query?
A query is a request you make to a database to access and get or manipulate the data, similar to asking the database a question or providing instructions.
To write a query, there are certain keywords that are used across the different flavors, such as SELECT and FROM. SELECT indicates which fields should be selected while FROM indicates the table where these fields are located. For example, let’s say there’s a database with a table named ‘sales’ that contains information about orders in a superstore. This table might include columns or fields like ‘Order_ID’,’Customer_Name’, ‘Product’, etc. To see all the products sold in the superstore, a simple SQL query might be ‘SELECT Product FROM Sales’.
Wrapping Up
Whether you’re a beginner looking to get started or someone brushing up on your skills, grasping the fundamentals of SQL is essential for anyone working with data. I’m excited to continue my journey with SQL and explore more advanced topics in the courses ahead. If you're interested in diving into SQL or enhancing your existing skills, I highly recommend taking a course or experimenting with different SQL flavors. There’s always more to learn, and each new skill adds another tool to your data toolkit. Please look forward to my next blog in this series and happy querying!