Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Dealing With Data
What is SQL?
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Employees File:
• You have to write code and loops.
To Get • Slow process
All Female • Slow performance
Employees
• You Use SQL Query
• Simple and fast.
Select * from Employees
Where Gender = ‘F’
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
What is SQL
• SQL stands for Structured Query Language
• Pronounced as “S-Q-L” or sometimes as “See-Quel”.
• SQL is used to communicate with a database.
• SQL lets you access and manipulate databases
• Database management systems that use SQL are: Oracle, Sybase, Microsoft SQL
Server, Access, Ingres, etc.
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
What Can You Do With SQL?
• SQL can execute queries against a database
• SQL can retrieve data from a database
• SQL can insert records in a database
• SQL can update records in a database
• SQL can delete records from a database
• SQL can create new databases
• SQL can create new tables in a database
• SQL can create stored procedures in a database
• SQL can create views in a database
• SQL can set permissions on tables, procedures, and views
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Examples Of SQL Statements:
• SELECT * FROM Employees WHERE Salary < 1000;
• SELECT FirstName , LastName FROM Employees WHERE Salary < 1000 and Gender=‘M’;
• SELECT * FROM Employees WHERE Salary between 500 and 1000;
• Select Count(*) from Employees;
• Select Sum(Salary) from Employees;
• Select Avg(Salary) from Employees;
• Delete from Employees where ID=10;
• Update Employees set FirstName = ‘Amjad’ where ID = 10;
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Examples:
• CREATE DATABASE MyDatabase;
• DROP DATABASE MyDatabase;
• CREATE TABLE Employees (
ID int,
FirstName varchar(255),
LastName varchar(255),
Address varchar(255),
City varchar(255)
);
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Types of SQL Statements:
Create
• Data Definition Language (DDL) Drop
DDL
Alter
• Data Manipulation Language (DML)
Truncate
• Data Control Language (DCL)
Insert
• Transaction Control Language (TCL) DML Update
SQL Command
• Data Query Language (DQL) Delete
Grant
DCL
Revoke
Commit
TCL Rollback
Savepoint
DQL Select
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Copyright© 2023 Mohammed Abu-Hadhoud
[Link] MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience