DEV Community

Cover image for Introduction to SQL: Day 1 - A Beginner's Guide to Databases
MInhTriet
MInhTriet

Posted on

Introduction to SQL: Day 1 - A Beginner's Guide to Databases

It is known in the programming world that there are a variety of languages for a diversity of tasks. We, as humans, can’t master every single programming language out there. We can just look at each of them and learn the basics.

So, over the next 15 days, I will guide you through SQL to build a solid foundation. This will be beneficial for you should you decide to continue further learning after this series.


1. History

SQL was developed in 1974, nearly 50 years prior to the writing of this article. SQL, which stands for Structured Query Language, serves as a standard language for managing and manipulating relational databases.

Over the years, SQL has gained widespread adoption thanks to its robust capabilities in managing large datasets and its adaptability across various applications, including:

  • Data analysis
  • Backend development

When you look up SQL tables online, you'll find various examples. In this series, we will create our own identical tables for practical understanding.


2. Overview

What are databases?

Databases store organized information in a structured format. Among these, Relational Databases (RDBMS) are the most widely used type.

Key Components of an RDBMS:

  • Tables: Store data in rows (records) and columns (fields).
  • Rows: Each row represents a single record.
  • Columns: Define the attributes or properties of the data.

Popular SQL-Compatible RDBMS:

  • MySQL
  • PostgreSQL
  • SQLite
  • Microsoft SQL Server
  • Oracle Database

Variety of Uses:

  1. Data Retrieval for Reporting

    Fetching data to generate reports and dashboards.

    Example: A sales report showing monthly revenue trends.

  2. Data Management for Businesses

    Managing large datasets, such as customer databases or inventory systems.

    Example: An e-commerce platform tracking product stock levels.

  3. Data Analysis

    Performing complex queries and analyses.

    Example: Identifying customer purchasing patterns or market trends.

  4. Backend Development

    Storing and retrieving user data for web applications.

    Example: Managing login credentials or user preferences.

  5. Transaction Processing

    Handling transaction data and ensuring accuracy and consistency.

    Example: Banking transactions or online payment processing.


3. Syntax

Here is the basic syntax of the language. You can probably look at it and make some guesses.

At the moment, I’m not gonna focus on it too much as it will be explained in the next lessons. something like this:

SELECT * FROM Customers;
Enter fullscreen mode Exit fullscreen mode

Paste this in the W3Schools SQL editor, you can see the following results:

Screen of the W3school SQL editor

Wrapping Up Day 1

The amount of content above is for day 1. Specifically, it provided a brief time lapse history of when and who created SQL, an overview of some of its practical uses, and finally, the code. While some will say that this is maybe useless, in my opinion, it provides you with a solid knowledge of what you are going to learn and use. You don’t want to learn something and don’t know what you will use it for, right?

As we move forward, the next lesson will focus on setting up the database system on your computer and setting up an SQL database for future use. I hope you found this article informative and enjoyable. At this point, there isn’t much for you to know and learn, however, stay tuned for more exploration and learning in the upcoming lessons.

Top comments (0)