Skip to content

mahirtantod/30-Days-of-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

70 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

30-Day-SQL-Challenge

DALLΒ·E 2024-12-27 14 33 38 - A minimalist banner for a '30 Days of SQL' repository  The design includes clean and bold text '30 Days of SQL' in a modern font, centered within the

  1. What Is SQL?
  2. Why Learn SQL?
  3. Prerequisites
  4. What You'll Learn Today
  5. Tasks for Day 1
  6. SQL Installation Guide
  7. Key Takeaways
  8. Additional Resources
  9. Conclusion

30 Days Of SQL: Day 1 - Introduction

Welcome to Day 1 of your SQL learning journey! Today, we'll cover the basics, setting the foundation for understanding Structured Query Language (SQL). By the end of this session, you’ll have a clear idea of what SQL is and why it's so crucial in modern data management.

πŸ“š What Is SQL?

SQL (Structured Query Language) is a standard language used to manage and manipulate relational databases. It allows you to:

  • Retrieve data efficiently from databases.
  • Insert, update, or delete data in databases.
  • Define and manage database structures (schemas).
  • Control access and permissions in database systems.

SQL is the backbone of many database systems, including MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.

🌟 Why Learn SQL?

SQL is a critical skill for anyone involved in data-related fields such as:

  • Data Science
  • Data Analytics
  • Software Development
  • Web Development
  • Database Administration

SQL is also highly sought after in the job market, making it an essential skill for your career growth.

πŸ›  Prerequisites

Before starting, ensure you have:

  1. Basic Computer Knowledge: Familiarity with basic programming concepts is a plus but not mandatory.
  2. A Database Tool Installed:
    • MySQL Workbench
    • PostgreSQL
    • SQLite
    • Any other SQL environment (like online SQL playgrounds).

SQL Installation Guide

Before diving into SQL, it’s important to set up a SQL environment on your system. Below are the installation instructions for various popular SQL database management systems.

1. MySQL Installation

Windows

  1. Download MySQL Installer from the official website.
  2. Run the installer and follow the installation wizard. Choose "Developer Default" to install MySQL Server and MySQL Workbench.
  3. Set a root password when prompted during installation.
  4. Complete the installation and launch MySQL Workbench to interact with your database.

macOS

  1. Download MySQL DMG Archive from the official website.
  2. Follow the instructions to install it.
  3. Open System Preferences and click on the MySQL icon to start the server.
  4. Use the Terminal to access the MySQL server by typing mysql -u root -p.

Linux (Ubuntu/Debian)

  1. Open a terminal and run:
    sudo apt update
    sudo apt install mysql-server
  2. Secure your MySQL installation:
    sudo mysql_secure_installation
  3. After installation, log into MySQL using:
    sudo mysql -u root -p

2. PostgreSQL Installation

Windows

  1. Download the PostgreSQL installer from EnterpriseDB.
  2. Run the installer and follow the on-screen instructions.
  3. Set a password for the default postgres role.
  4. Open pgAdmin or use the command line to interact with your database.

macOS

  1. Install PostgreSQL using Homebrew:
    brew install postgresql
  2. Start the PostgreSQL service:
    brew services start postgresql
  3. Access PostgreSQL through the terminal:
    psql postgres

Linux (Ubuntu/Debian)

  1. Open a terminal and install PostgreSQL:
    sudo apt update
    sudo apt install postgresql postgresql-contrib
  2. Switch to the PostgreSQL user:
    sudo -i -u postgres
  3. Access PostgreSQL:
    psql

3. SQLite Installation

SQLite is a lightweight, file-based SQL database, useful for smaller projects or testing.

Windows

  1. Download the precompiled binaries from SQLite Downloads Page.
  2. Extract the downloaded file and place it in a folder (e.g., C:\sqlite).
  3. Add the SQLite directory to your system’s PATH for easy access.
  4. Open Command Prompt and type sqlite3 to interact with SQLite.

macOS

  1. SQLite is pre-installed on macOS. Open Terminal and type:
    sqlite3

Linux (Ubuntu/Debian)

  1. Install SQLite via the terminal:
    sudo apt update
    sudo apt install sqlite3
  2. Run SQLite:
    sqlite3

4. SQL Server Installation (Microsoft SQL Server)

Windows

  1. Download the SQL Server installer from the Microsoft website.
  2. Run the installer and choose "Basic" or "Custom" installation.
  3. Set up your SQL Server instance and authentication settings.
  4. Use SQL Server Management Studio (SSMS) to manage your databases.

macOS (Using Docker)

  1. Install Docker for macOS from the Docker website.
  2. Pull the SQL Server Docker image:
    docker pull mcr.microsoft.com/mssql/server
  3. Run the SQL Server container:
    docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourPassword123' -p 1433:1433 --name sql_server_container -d mcr.microsoft.com/mssql/server
  4. Use a SQL client like Azure Data Studio or connect via sqlcmd to manage your database.

5. Oracle Database Installation

Windows/macOS/Linux

  1. Download Oracle Database Express Edition (XE) from the Oracle website.
  2. Follow the instructions to install it based on your operating system.

6. MariaDB Installation

MariaDB is a community-driven fork of MySQL, often used as a drop-in replacement for MySQL.

Windows

  1. Download the MariaDB installer from the official website.
  2. Run the installer and follow the installation wizard.
  3. Set a root password and configure MariaDB as required.

macOS

  1. Install MariaDB using Homebrew:
    brew install mariadb
  2. Start MariaDB:
    brew services start mariadb

Linux (Ubuntu/Debian)

  1. Install MariaDB from the terminal:
    sudo apt update
    sudo apt install mariadb-server
  2. Secure MariaDB:
    sudo mysql_secure_installation

Once you've selected your SQL database system and followed the installation instructions, you’ll be ready to begin writing and executing SQL queries. Make sure to confirm that everything is set up correctly by testing your installation with a simple SQL query!

πŸš€ What You'll Learn Today

Today’s focus is understanding:

  1. What is a Database?
    • A collection of data organized for easy access and management.
  2. Types of Databases:
    • Relational Databases (SQL-based, e.g., MySQL, PostgreSQL).
    • Non-Relational Databases (NoSQL, e.g., MongoDB).
  3. SQL Syntax:
    • A sneak peek into SQL's syntax, such as:
      SELECT * FROM table_name;
  4. Key SQL Concepts:
    • Tables, Rows, and Columns.
    • Data Types and Primary Keys.

πŸ“ Tasks for Day 1

  1. Read and Research:
    • Explore what SQL is and its applications.
    • Research the different types of databases.
  2. Install and Set Up:
    • Install a database tool like MySQL or SQLite.
    • Test the installation by opening the tool.
  3. Run Your First SQL Query:
    • Use an online SQL editor or your database tool to run:
      SELECT 'Hello, SQL!';
      Output:
      Hello, SQL!
      

πŸ›‘ Key Takeaways

  • SQL is essential for managing and manipulating data in relational databases.
  • Relational databases organize data into tables with rows and columns.
  • Understanding SQL opens doors to numerous career opportunities.

πŸ”— Additional Resources

🌟 Conclusion

You’ve just taken the first step in mastering SQL! Day 1 is all about building awareness and setting up your environment. Tomorrow, we’ll dive deeper into Data Definition Language (DDL).

Next: Day 2 - Filtering Data with WHERE πŸ”œ

About

πŸ“Š 30 Days of SQL is a daily challenge guiding you from SQL basics to advanced skills! Dive into πŸ“š examples, πŸ”§ exercises, and 🎯 projects to master databases. Perfect for beginners or pros! πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors