SQL Tutorial

SQL Tutorial SQL Introduction SQL Syntax SQL Data Types SQL OPERATORS SQL COMMANDS SQL Queries

SQL Database

SQL Create Database SQL DROP Database SQL SELECT Database

SQL Table

SQL TABLE SQL CREATE TABLE SQL COPY TABLE SQL ALTER TABLE SQL DELETE SQL TRUNCATE TABLE SQL DROP TABLE SQL UPDATE TABLE SQL INSERT TABLE

SQL SELECT

SQL SELECT Statement SQL SELECT WHERE Clause SQL SELECT IN Operator SQL BETWEEN Operator SQL SELECT BETWEEN Operator SQL SELECT AND Operator SQL SELECT OR Operator SQL SELECT LIKE Operator SQL SELECT DISTINCT SQL SELECT SUM SQL SELECT MAX SQL SELECT MIN SQL SELECT AVG

SQL Clause

SQL WHERE Clause SQL GROUP BY CLAUSE SQL ORDER BY Clause SQL HAVING Clause

SQL INSERT

SQL INSERT Statement SQL INSERT INTO Statement SQL INSERT INTO Values SQL INSERT INTO SELECT SQL Insert multiple rows

SQL JOIN

SQL JOIN SQL Inner Join SQL Left Join SQL Right Join SQL Full Join SQL CROSS Join

SQL OPERATOR

SQL Comparison SQL LOGICAL Operator SQL Cast Operator SQL Arithmetic

Difference

SQL vs NOSQL WHERE vs HAVING DELETE vs DROP GROUP BY vs ORDER BY DROP vs TRUNCATE SQL IN vs SQL EXISTS Difference between Delete, Drop and Truncate in SQL

MISC

SQL SubQuery SQL CASE Commit and Rollback in SQL Pattern Matching in SQL DDL Commands in SQL DML Commands in SQL Types of SQL Commands SQL COUNT SQL Primary Key SQL FOREIGN KEY SET Operators in SQL Check Constraint in SQL SQL EXCEPT SQL VIEW SQL WHERE Statement SQL CRUD Operation Where Condition in SQL TCL Commands in SQL Types of SQL JOINS SQL Nth Highest Salary SQL NOT OPERATOR SQL UNION ALL SQL INTERSECT SQL Data Definition Language SQL Data Manipulation Language SQL Data Control Language SQL CONSTRAINTS SQL Aggregate Operators SQL KEYS Codd’s Rules in SQL What is SQL Injection? Trigger In SQL SQL WHERE Multiple Conditions Truncate function in SQL SQL Formatter WEB SQL SQL Auto Increment Save Point in SQL space() function in SQL SQL Aggregate Functions SQL Topological Sorting SQL Injection SQL Cloning Tables SQL Aliases SQL Handling Duplicate Update Query in SQL Grant Command in SQL SQL SET Keyword SQL Order BY LIMIT SQL Order BY RANDOM

How To

How to use the BETWEEN operator in SQL How To Use INNER JOIN In SQL How to use LIKE in SQL How to use HAVING Clause in SQL How to use GROUP BY Clause in SQL How To Remove Duplicates In SQL How To Delete A Row In SQL How to add column in table in SQL ? How to drop a column in SQL? How to create a database in SQL? How to use COUNT in SQL? How to Create Temporary Table in SQL? How to Add Foreign Key in SQL? How to Add Comments in SQL? How To Use Group By Clause In SQL How To Use Having Clause In SQL How To Delete Column In Table How To Compare Date In SQL How index works in SQL How to calculate age from Date of Birth in SQL How to Rename Column name in SQL What are single row and multiple row subqueries?

Introduction to SQL

SQL Introduction

  • SQL is Standard Query Language.
  • This language is used to communicate or interact with database.
  • In other words, SQL is used to access and manage data or information in the database by performing many different operations on data or tables or database.
  • According to the ANSI (American National Standards Institute), SQL is a standard language for RDBMS.
  • With the help of SQL, each user can get a different view of data as per their need.
  • SQL retrieves same data from a database and represents it in many different ways so that user can understand easily.
  • SQL is not case-sensitive.
  • In most of the cases, SQL syntax differs as the database changes.
  • Some most popular databases are: MySQL, ORACLE, DB2, SQL SERVER, MS ACCESS etc.

What is Database?

  • Database is a Data structure which stores organized data or information in the form of tables or files.
  • Database is nothing but a collection of tables/files/data.
  • Database is a collection of related data, which is organized in such a way so that storing, accessing, managing, modifying/updating of data becomes easier.
For example: Microsoft Excel is example of desktop database programs, which allows user to insert /enter data, store data and access that data whenever required.

What is DBMS?

DataBase Management System (DBMS) is a set of programs or software which allows creation, modification of database and at the same time it allows many different users to perform operations on database like store, modify, access etc.

RDBMS

Relational Database Management System is based on Relational model.
  • In RDBMS, everything is present in the form of relations.
  • Relation means Table.
  • Data is present in a tabular form.
  • Tables are interrelated with each other.
  • Dependencies/ Relationship between two tables is also represented through relation/table.

What is Difference Between DBMS and RDBMS ?

  • RDBMS applications store data in a tabular form whereas DBMS applications store data in the form of files.
  • DBMS can have Tables but there is no relation present in between tables.