Make sure to join the Telegram Grop to recieve all Topic Notes as well as Regular Jobs & Internship Updates.

1) SQL Introduction

In this chapter, we delve into the world of Structured Query Language (SQL). Discover how SQL enables you to interact with databases, retrieve data, and perform essential tasks. 

1.1 What Is SQL?

SQL is a short-form of the structured query language, and it is pronounced as S-Q-L or sometimes as See-Quell.

This database language is mainly designed for maintaining the data in relational database management systems. It is a special tool used by data professionals for handling structured data (data which is stored in the form of tables). It is also designed for stream processing in RDSMS.

You can easily create and manipulate the database, access and modify the table rows and columns, etc. This query language became the standard of ANSI in the year of 1986 and ISO in the year of 1987.

1.2 Why Should We Learn SQL?

  1. Data Manipulation: SQL lets data professionals insert, update, and delete records in relational databases.

  2. Data Retrieval: It allows users to retrieve data from relational database management systems.

  3. Database Management: SQL helps create, modify, and manipulate databases, tables, views, stored procedures, and functions.

1.3 History Of SQL?

In 1970, computer scientist E.F. Codd published “A Relational Model of Data for Large Shared Data Banks.”

    • IBM researchers Raymond Boyce and Donald Chamberlin developed SEQUEL (later known as SQL) based on Codd’s ideas.
    • Relational Software Inc. (now Oracle Corporation) introduced the first SQL implementation, Oracle V2, in 1979, operating on VAX computers.

1.4 Execution Process & Components of SQL?

  1. SQL Execution:

    • When we run an SQL command on a Relational Database Management System (RDBMS), the system automatically selects the best way to execute our request.
    • The SQL engine interprets the command and carries out the desired operation.
  2. Components of SQL:

    • SQL consists of several key components:
      • Query Dispatcher: Routes queries to the appropriate execution engine.
      • Optimization Engines: Optimize query execution plans.
      • Classic Query Engine: Handles query processing.
      • SQL Query Engine: Executes the actual SQL commands.

1.5 Syntax Of SQL?

  1. SQL syntax is like a set of rules for talking to databases. When you write an SQL command, it reads like natural language. You start with a verb (like SELECT, INSERT, UPDATE, or DELETE), followed by conditions (predicates) that determine what data you want to work with

Simple Example of SQL statement:

Here we are selecting column name which i want to display from Table name .

Make sure the semicolon is important here in case you’re using multiple statements.

					SELECT "column_name" FROM "table_name";

1.6 SQL Data Types ?

In SQL, we use various data types to define what kind of data can be stored in a column. Here are some common ones:

  1. String Data Types:

    • CHAR: Fixed-length string (e.g., names, codes).
    • VARCHAR: Variable-length string (e.g., addresses, descriptions).
    • TEXT: Holds large amounts of text (e.g., blog posts, articles).
  2. Numeric Data Types:

    • INT: Whole numbers (e.g., IDs, quantities).
    • DECIMAL: Exact numeric values (e.g., prices, percentages).
    • FLOAT: Approximate numeric values (e.g., scientific measurements).
  3. Date and Time Data Types:

    • DATE: Stores year, month, and day.
    • TIMESTAMP: Includes date and time down to seconds.
  4. Binary Data Types:

    • BINARY: Stores binary byte strings (e.g., images, files).
    • BLOB: For large binary objects (e.g., multimedia content).

1.7 SQL Operators ?

SQL operators are essential for crafting powerful queries. Let’s explore some key types:

  1. Arithmetic Operators:

    • +: Add
    • -: Subtract
    • *: Multiply
    • /: Divide
    • %: Modulo
  2. Comparison Operators:

    • =: Equal to
    • >: Greater than
    • <: Less than
    • >=: Greater than or equal to
    • <=: Less than or equal to
    • <> or !=: Not equal to
  3. Logical Operators:

    • AND: True if all conditions are met
    • OR: True if any condition is met
    • NOT: Negates a condition
  4. Bitwise Operators:

    • &: Bitwise AND
    • |: Bitwise OR
    • ^: Bitwise exclusive OR

These operators help you manipulate and analyze data efficiently! 

1.8 SQL Operator Precedence ?

In SQL, operator precedence determines the order in which operators are evaluated within an expression. Here’s a quick overview:

  1. Parentheses: Expressions within parentheses are evaluated first. For example:

    SELECT 2 * (4 + 5); -- Evaluates to 2 * 9, resulting in 18. 
  2. Unary Operators: These include positive (+) and negative (-). They operate on a single value.

  3. Multiplication, Division, Modulus: These arithmetic operators have higher precedence than addition and subtraction.

  4. Addition and Subtraction: These are evaluated left to right within an expression.

  5. Comparison Operators: These include =, >, <, >=, <=, <>, and !=. They compare values.

  6. Logical Operators: AND, OR, and NOT are used for combining conditions.

Remember, parentheses can override the default precedence, ensuring your expressions are evaluated correctly!

					SELECT *  FROM Your_Time
WHERE focus <> 0;

Why Choose Codepect for SQL Learning?

SQL is a fundamental tool for any data professional. At Codepect, we provide comprehensive resources, mentorship, and practical experience for mastering SQL. Our course is designed to take you from beginner to an intermediate level. With our hands-on approach and real-life tasks, you’ll get the hang of SQL in no time. Learn from industry experts and stay one step ahead in your career with Codepect.

What You'll Learn in This SQL Course

Whether you’re a beginner or looking to enhance your skills, SQL opens doors to data manipulation and analysis!

Querying Data and Filtering Results

Whether you’re a beginner or looking to enhance your skills, SQL opens doors to data manipulation and analysis!

Joining Multiple Tables

The JOIN operation allows you to merge rows from two or more tables based on a common column.

Real-Life Projects and Scenarios

 SQL projects provide practical experience and enhance your skills. 

Who Can Benefit from This Course?

Whether you’re a data analyst, data scientist, programmer, software engineer, or even a cybersecurity specialist, learning SQL is highly valuable. It allows you to interact with databases, retrieve and manipulate data, and create insightful reports. Don’t hesitate—start your SQL journey today!


Master SQL with Codepect Today

Are you struggling to learn SQL on your own? Look no further than Codepect. Our expert instructors provide comprehensive resources and mentorship to help you excel in SQL. With our hands-on approach and real-life tasks, you’ll be able to apply your skills to real-world situations. Don’t wait, enroll in our SQL course today!
Completed Course
Our team of experts is dedicated to providing you with the best SQL learning experience. We offer a hands-on approach and real-life tasks to help you apply your skills to real-world situations. Join us today and become a SQL master!


SQL Developer, Codepect

Connect With Us

Let Us Know Your Suggestions/Queries or Contributions