Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

SQL

Queries

-By By-
SRIDHARSHAN A SANJAY M
B.E - CSE B.TECH - AI&DS
CONTENT
01 INTRODUCTION

02 WHAT IS SQL

03 INSTALLATION

04 CREATING DATABASES

05 OPERATIONS

06 INNER JOINS

07 SELF JOINS
Introduction
to
SQL
WHAT IS SQL?

Structured query language (SQL) is a programming


language for storing and processing information in a
relational database. A relational database stores
information in tabular form, with rows and columns
representing different data attributes and the various
relationships between the data values.
BASIC COMMANDS.

CREATE DROP
ALTER TRUNCATE

RENAME
OPERATORS:
1. The AND, OR, and NOT Operators
2. The IN Operator
3. The BETWEEN Operator
4. The LIKE Operator
5. The REGEXP Operator
6. The IS NULL Operator
7. The ORDER BY Operator
8. The LIMIT Operator
The BETWEEN Operator

The BETWEEN operator selects values within a given range.


The values can be numbers, text, or dates.

The BETWEEN operator is inclusive: begin and end values


are included.

Query:
SELECT * FROM Products
WHERE Price BETWEEN 10 AND 20;
JOINING:
1. Inner Joins
2. Joining Across Databases
3. Self Joins
INNER JOIN

The INNER JOIN keyword selects records that have


matching values in both tables.

Query :-

SELECT ProductID, ProductName, CategoryName


FROM Products
INNER JOIN Categories ON Products.CategoryID =
Categories.CategoryID;

You might also like