You are on page 1of 34

SQL (Structured Query Language)

SQL is a standard language used for accessing and manipulating database. It stores data in a very structural way. It is
very useful in managing relational database (RDBMS)

Goal of SQL is to have a Query Language which is powerful, simple and efficient for:

• Adding data to the database


• Pulling out some data
• Modifying the data

MySQL provides a multi-user access to database. MySQL is an RDBMS (Relational database management system)
which uses SQL to perform operations such as storing, retrieving and modification of database.

SQL MySQL
It needs to be learnt and worked on to make sure it can It is a readily available software which can be
be used effectively. downloaded and installed.

WHY SQL?
We live in an era where data is an important asset and it is being used for every decision-making process that’s why it
become important for us to learn SQL so that we can mine data very easily and also with greater efficiency.

WHAT IS DATABASE?
A database is an electronic system which allow us to easily access and manipulate the data.

HOW DATABASE ARE MANAGED?


Database is managed by using database management systems. (DBMS)

DBMS is a system software for creating and managing database. Basically, it provides programmers a systematic way to
create, retrieve data, update and manage data.

TYPES OF DATABASE ARCHITECTURE:

1) File Server
2) Client Server

File Server the files are located in local system and only 1 person at a time can access it.

Client Server In these multiple users can access the database at the same time simultaneously.

Tables in SQL comprise of rows and columns where rows are known as Record and Columns is known as Fields.

SYNTAX: -
Creating database syntax: -
CREATE DATABASE databaseName;

To Select the Existing Database: -


USE [DatabaseName];

To delete/ drop database: -


DROP DATABASE databaseName;
Data Types in SQL: - It defines what type of data a column can hold.
Create a Table:-

1) Name the table


2) Define the columns
3) Assign data types of columns
INSERT into Table: -

SELECT data from the Table: -

Filter the records: -


OPERATORS: -

LIKE OPERATOR: -
FUNCTIONS IN SQL: -
STRING FUNCTIONS: -
ORDER BY AND TOP: -
GROUP BY: -
HAVING CLAUSE: -

UPDATE STATEMENT: -
DELETE Statement: -
TRUNCATE STATEMENT: -

INNER JOIN: -
LEFT JOIN: -
RIGHT JOIN: -
FULL JOIN:
UPDATE USING JOIN: -
DELETE USING JOIN: -

UNION OPERATOR: -
UNION ALL OPERATOR: -
EXCEPT OPERATOR: -

INTERSECT OPERATOR: -

VIEWS: -
AFTER TABLE: -
AFTER TABLE – DROP COLUMN: -

MERGE: -
TYPES OF USER DEFINED FUNCTIONS: -
TEMPORARY TABLE: -

IIF() FUNCTION: -
STORED PROCEDURE IN SQL: -

EXCEPTION HANDLING: -

TRY/CATCH: -
TRANSACTION IN SQL: -

DATA BASE ADMINISTOR: -


MS SQL SERVER: -
INSTANCES IN SQL SERVER: -

SQL QUESTIONS: -
OLTP = online transactions processing. Designed for large
audiences who conduct short transactions.
OLAP = online Analytical processing.
11. What is normalization?

Normalization is the process of minimizing redundancy and dependency by organizing


fields and table of a database. The main aim of Normalization is to add, delete or modify
field that can be made in a single table.

12. What is Denormalization.

Denormalization is a technique used to access the data from higher to lower normal forms
of database. It is also process of introducing redundancy into a table by incorporating data
from the related tables.

13. What are all the different normalizations?

The normal forms can be divided into 5 forms, and they are explained below -.

• First Normal Form (1NF): -

This should remove all the duplicate columns from the table. Creation of tables for the
related data and identification of unique columns.

• Second Normal Form (2NF): -

Meeting all requirements of the first normal form. Placing the subsets of data in separate
tables and Creation of relationships between the tables using primary keys.

• Third Normal Form (3NF): -


This should meet all requirements of 2NF. Removing the columns which are not
dependent on primary key constraints.

• Fourth Normal Form (4NF): -

Meeting all the requirements of third normal form and it should not have multi- valued
dependencies.

14. What is a View?

A view is a virtual table which consists of a subset of data contained in a table.

You might also like