SlideShare a Scribd company logo
1 of 21
Introduction to SQL
‫کننده‬ ‫تهیه‬:‫عادل‬ ‫هللا‬ ‫عصمت‬
‫با‬ ‫معرفی‬SQL
Topics:
• What is SQL?
• SQL Commands
• SQL Select Statement
•SQL‫چیست؟‬
•‫دستورات‬SQL
•‫دستور‬Select،SQL
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
2
What is SQL?
• SQL is Structured Query
Language, which is a
computer language for
storing, manipulating and
retrieving data stored in
relational database.
• SQL is an ANSI (American
National Standards
Institute) standard but
there are many different
versions of the SQL
language.
•SQL‫مخفف‬ ‫که‬(Structured
Query Language)‫عبارت‬ ‫است‬
‫ذخی‬ ‫برای‬ ‫کمپیوتر‬ ‫زبان‬ ‫یک‬ ‫از‬‫ره‬
‫بازیاف‬ ‫و‬ ‫کردن‬ ‫دستکاری‬ ،‫کردن‬‫تن‬
‫راب‬ ‫دیتابیس‬ ‫در‬ ‫شده‬ ‫ذخیره‬ ‫دیتا‬‫طه‬
‫میباشد‬ ‫ای‬.
•SQL‫شده‬ ‫قبول‬ ‫معیاری‬ ‫زبان‬ ‫یک‬
‫توسط‬(ANSI)‫نسخه‬ ‫دارای‬ ‫اما‬ ‫بوده‬
‫میباشد‬ ‫مختلف‬ ‫های‬.
Nangarhar University Database1 3
Continue…
• SQL is the standard
language for Relation
Database System. All
relational database
management systems like
MySQL, MS Access, Oracle,
Sybase, Informix, Postgres
and SQL Server use SQL as
standard database
language.
•SQL‫سیست‬ ‫برای‬ ‫معیار‬ ‫زبان‬ ‫یک‬‫م‬
‫میباشد‬ ‫ای‬ ‫رابطه‬ ‫دیتابیس‬.‫تمام‬
RDBMS‫مانند‬ ‫ها‬MySQL،MS
Access،Oracle،Sybase،
Informix،Postgres‫و‬SQL
Server‫زبان‬ ‫از‬SQL‫یک‬ ‫منحیث‬
‫می‬ ‫استفاده‬ ‫دیتابیس‬ ‫معیار‬ ‫زبان‬‫کند‬.
Nangarhar University Database1 4
SQL commands:
• SQL commands are
instructions, coded into SQL
statements, which are used
to communicate with the
database to perform
specific tasks, work,
functions and queries with
data.
• These commands can be
classified into four groups:
•‫دستورات‬SQL‫دستورات‬ ‫از‬ ‫عبارت‬
‫با‬ ‫کردن‬ ‫مکالمه‬ ‫برای‬ ‫که‬ ‫میباشد‬
‫وظ‬ ‫یک‬ ‫تا‬ ‫میرود‬ ‫بکار‬ ‫دیتابیس‬‫یفه‬
‫شود‬ ‫اجرا‬ ‫خاص‬.
•‫تقس‬ ‫بخش‬ ‫چهار‬ ‫به‬ ‫دستورات‬ ‫این‬‫یم‬
‫میتواند‬ ‫شده‬:
.1DDL
.2DML
.3DCL
.4TCL
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
5
1) DDL:
• DDL is abbreviation of Data
Definition Language. It is
used to create and modify
the structure of database
objects in database. The
commands are CREATE,
ALTER, DROP, RENAME, and
TRUNCATE.
•DDL‫اختصار‬Data Definition
Language‫میباشد‬.‫برای‬ ‫که‬
‫ساختار‬ ‫کردن‬ ‫اصالح‬ ‫و‬ ‫ساختن‬
‫ب‬ ‫دیتابیس‬ ‫در‬ ‫دیتابیس‬ ‫اشیای‬‫کار‬
‫میرود‬.
•‫مثال‬ ‫بطور‬:
•Create،Alter،Drop،
Rename‫و‬Truncate
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
6
2) DML:
• DML is abbreviation of Data
Manipulation Language. It
is used to retrieve, store,
modify, delete, insert and
update data in database.
These Data Manipulation
Language commands
are: SELECT, INSERT, UPDAT
E, and DELETE.
•DML‫اختصار‬Data
Manipulation Language
‫میباشد‬.‫ذخی‬ ،‫بازیافتن‬ ‫برای‬ ‫که‬‫ره‬
،‫کردن‬ ‫حذف‬ ،‫کردن‬ ‫اصالح‬ ،‫کردن‬
‫دیتا‬ ‫درآوردن‬ ‫روز‬ ‫به‬ ‫و‬ ‫کردن‬ ‫درج‬
‫میرود‬ ‫بکار‬ ‫دیتابیس‬ ‫در‬.
•‫مثال‬ ‫بطور‬:
•Select،Insert،Update‫و‬
Delete
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
7
3) DCL:
• DCL is abbreviation of Data
Control Language. It is used
to create roles, permissions,
and referential integrity as
well it is used to control
access to database by
securing it. These
commands are GRANT and
REVOKE.
•DCL‫اختصار‬Data Control
Language‫میباشد‬.‫برای‬ ‫که‬
‫جامعیتی‬ ‫و‬ ‫اجازه‬ ،‫اصول‬ ‫ساختن‬
‫کنترول‬ ‫برای‬ ‫همچنان‬ ‫ارجاعی‬
‫منظور‬ ‫به‬ ‫دیتابیس‬ ‫به‬ ‫دسترسی‬‫امن‬
‫میرود‬ ‫بکار‬ ‫آن‬ ‫ساختن‬.
•‫مثال‬ ‫بطور‬:
•Grant‫و‬Revoke
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
8
4) TCL:
• TCL is abbreviation
of Transactional Control
Language. It is used to
manage different
transactions occurring
within a database. These
commands are COMMIT,
ROLLBACK, and SAVEPOINT.
•TCL‫اختصار‬Transactional
Control Language‫میباشد‬.‫که‬
‫های‬ ‫تراکنش‬ ‫کردن‬ ‫اداره‬ ‫برای‬
‫اتفاق‬ ‫دیتابیس‬ ‫در‬ ‫ایکه‬ ‫مختلف‬‫می‬
‫میرود‬ ‫بکار‬ ‫افتد‬.
•‫مثال‬ ‫بطور‬:
•Commit،Rollback‫و‬
Savepoint
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
9
SQL Select Statement:
• The SELECT statement is
used to select data from a
table.
• Syntax:
• SELECT column_name(s)
FROM table_name.
• Note: SQL statements are
not case sensitive. SELECT is
the same as select.
•‫دستور‬select‫کردن‬ ‫انتخاب‬ ‫برای‬
‫میرود‬ ‫بکار‬ ‫جدول‬ ‫یک‬ ‫از‬ ‫دیتا‬.
•‫است‬ ‫ذیل‬ ‫قرار‬ ‫آن‬ ‫ساختار‬:
• SELECT column_name(s)
FROM table_name.
•‫نوت‬:‫دستورات‬SQL‫میتوانید‬ ‫را‬
‫توسط‬ ‫هم‬ ‫یا‬ ‫و‬ ‫کالن‬ ‫حروف‬ ‫توسط‬
‫بنویسید‬ ‫خورد‬ ‫حروف‬.SELECT‫و‬
select‫است‬ ‫چیز‬ ‫عین‬.
Nangarhar University Database1 10
Continue…
• To select the content of
columns named
"LastName" and
"FirstName", from the
database table called
"Persons", use a SELECT
statement like this:
• SELECT LastName,
FirstName FROM Persons
•‫ست‬ ‫محتویات‬ ‫کردن‬ ‫انتخاب‬ ‫برای‬‫ون‬
‫های‬FirstName‫و‬LastName
‫جدول‬ ‫از‬Person‫دستور‬select
‫بنویسید‬ ‫ذیل‬ ‫قرار‬ ‫را‬:
• SELECT LastName,
FirstName FROM Persons
Nangarhar University Database1 11
First Name Last Name
ahmad watan
khyber afghan
Select All Columns:
• To select all columns from
the "Persons" table, use a *
symbol instead of column
names, like this:
• SELECT * FROM Persons
•‫ها‬ ‫ستون‬ ‫تمام‬ ‫کردن‬ ‫انتخاب‬ ‫برای‬‫از‬
‫جدول‬Person‫سمبول‬ ‫از‬*‫به‬
‫ذیل‬ ‫قرار‬ ‫ها‬ ‫ستون‬ ‫نام‬ ‫عوض‬
‫کنید‬ ‫استفاده‬.
• SELECT * FROM Persons
Nangarhar University Database1 12
Name Age Psot Salary
Saif 22 Eng 100
Rishad 23 Doc 200
Mjeeb 32 Guard 300
Momin 33 teacher 400
The SELECT DISTINCT Statement:
• The distinct keyword is used
to return only distinct
(different) values.
• Select distinct company
from orders
•‫کلیدی‬ ‫کلمه‬distinct‫برگشت‬ ‫برای‬
‫یک‬ ‫از‬ ‫متمایز‬ ‫های‬ ‫قیمت‬ ‫دادن‬
‫میرود‬ ‫بکار‬ ‫ذیل‬ ‫قرار‬ ‫جدول‬:
• Select distinct company
from orders
Nangarhar University Database1 13
Company Order Number
AWCC 234234
Roshan 56463
ZACC 4213
Afghan Telecome 6787689
SQL WHERE Clause:
• The WHERE clause is used
to extract only those
records that fulfill a
specified criterion.
• Syntax:
• SELECT column_name,
column_name
FROM table_name
WHERE column_name
operator value;
•‫کردن‬ ‫انتخاب‬ ‫برای‬record‫های‬
‫مشخص‬ ‫شرط‬ ‫یک‬ ‫که‬ ‫میرود‬ ‫بکار‬
‫کند‬ ‫صدق‬ ‫را‬.
•‫ساختار‬:
• SELECT column_name,
column_name
FROM table_name
WHERE column_name
operator value;
Nangarhar University Database1 14
SQL WHERE Clause…
• Examples:
1. SELECT * FROM Customers WHERE Country='Mexico';
2. SELECT * FROM Customers WHERE CustomerID=1;
Nangarhar University Database1 15
Operators in The WHERE Clause:
Nangarhar University Database1 16
SQL AND & OR Operators:
• The AND & OR operators
are used to filter records
based on more than one
condition.
• The AND operator displays a
record if both the first
condition AND the second
condition are true.
• The OR operator displays a
record if either the first
condition OR the second
condition is true.
•‫های‬ ‫عملیه‬and‫و‬or‫فیلتر‬ ‫برای‬
‫کردن‬record‫اضافتر‬ ‫براساس‬ ‫ها‬
‫میرود‬ ‫بکار‬ ‫شرط‬ ‫یک‬ ‫از‬.
•‫عملیه‬and‫وقتی‬ ‫را‬ ‫ریکارد‬ ‫یک‬
‫دو‬ ‫هر‬ ‫صورتیکه‬ ‫در‬ ‫میدهد‬ ‫نشان‬
‫را‬ ‫دوم‬ ‫شرط‬ ‫و‬ ‫اول‬ ‫شرط‬ ،‫شرط‬
‫کند‬ ‫صدق‬.
•‫عملیه‬or‫وقتی‬ ‫را‬ ‫ریکارد‬ ‫یک‬
‫یکی‬ ‫هر‬ ‫درصورتیکه‬ ‫میدهد‬ ‫نشان‬
‫صدق‬ ‫را‬ ‫دوم‬ ‫شرط‬ ‫و‬ ‫اول‬ ‫شرط‬ ‫از‬
‫کند‬.
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
17
Continue…
• Examples:
1. SELECT * FROM Customers WHERE Country='Germany‘ AND
City='Berlin';
2. SELECT * FROM Customers WHERE City='Berlin‘ OR
City='München';
3. SELECT * FROM Customers WHERE Country='Germany'
AND (City='Berlin' OR City='München');
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
18
SQL ORDER BY Keyword:
• The ORDER BY keyword is
used to sort the result-set
by one or more columns.
• The ORDER BY keyword
sorts the records in
ascending order by default.
To sort the records in a
descending order, you can
use the DESC keyword.
•‫کلیدی‬ ‫کلمه‬order by‫مرتب‬ ‫برای‬
‫کردن‬result-set‫و‬ ‫یک‬ ‫اساس‬ ‫بر‬
‫می‬ ‫بکار‬ ‫ستون‬ ‫یک‬ ‫از‬ ‫بیشتر‬ ‫یا‬‫رود‬.
•‫کلیدی‬ ‫کلمه‬order by‫پیش‬ ‫بطور‬
‫شکل‬ ‫به‬ ‫را‬ ‫ها‬ ‫ریکورد‬ ‫فرض‬
‫میکند‬ ‫ترتیب‬ ‫صعودی‬.‫ت‬ ‫برای‬‫رتیب‬
‫کل‬ ‫نزولی‬ ‫بشکل‬ ‫ریکاردها‬ ‫کردن‬‫مه‬
‫کلیدی‬desc‫کنید‬ ‫استفاده‬ ‫را‬.
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
19
Continue…
• Syntax:
• SELECT column_name, column_name FROM table_name
ORDER BY column_name, column_name ASC|DESC;
• Examples:
1. SELECT * FROM Customers ORDER BY Country;
2. SELECT * FROM Customers ORDER BY Country DESC;
3. SELECT * FROM Customers ORDER BY Country,
CustomerName;
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
20
1:57 AM
Gharjistan University Computer Science
Faculty Farah Branch
21

More Related Content

What's hot

Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database DesignSondra Willhite
 
Database Design Slide 1
Database Design Slide 1Database Design Slide 1
Database Design Slide 1ahfiki
 
INTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACE
INTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACEINTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACE
INTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACEMohamed Reda
 
Chapter01 introduction
Chapter01 introductionChapter01 introduction
Chapter01 introductionNgeam Soly
 
Preparing for BIT – IT2301 Database Management Systems 2001b
Preparing for BIT – IT2301 Database Management Systems 2001bPreparing for BIT – IT2301 Database Management Systems 2001b
Preparing for BIT – IT2301 Database Management Systems 2001bGihan Wikramanayake
 
Mi0034 –database management systems
Mi0034 –database management systemsMi0034 –database management systems
Mi0034 –database management systemssmumbahelp
 
Mc0077 – advanced database systems
Mc0077 – advanced database systemsMc0077 – advanced database systems
Mc0077 – advanced database systemsRabby Bhatt
 
[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01AnusAhmad
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Dios Kurniawan
 
Database administrator
Database administratorDatabase administrator
Database administratorTech_MX
 
data abstraction in DBMS
data abstraction in DBMSdata abstraction in DBMS
data abstraction in DBMSBHARATH KUMAR
 
CS828 P5 Individual Project v101
CS828 P5 Individual Project v101CS828 P5 Individual Project v101
CS828 P5 Individual Project v101ThienSi Le
 

What's hot (19)

Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database Design
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
 
Introduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQLIntroduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQL
 
Database Design Slide 1
Database Design Slide 1Database Design Slide 1
Database Design Slide 1
 
DISE - Database Concepts
DISE - Database ConceptsDISE - Database Concepts
DISE - Database Concepts
 
Dbms models
Dbms modelsDbms models
Dbms models
 
INTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACE
INTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACEINTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACE
INTELLIGENT-MULTIDIMENSIONAL-DATABASE-INTERFACE
 
Chapter01 introduction
Chapter01 introductionChapter01 introduction
Chapter01 introduction
 
Chapter02
Chapter02Chapter02
Chapter02
 
Preparing for BIT – IT2301 Database Management Systems 2001b
Preparing for BIT – IT2301 Database Management Systems 2001bPreparing for BIT – IT2301 Database Management Systems 2001b
Preparing for BIT – IT2301 Database Management Systems 2001b
 
Dbms Lecture Notes
Dbms Lecture NotesDbms Lecture Notes
Dbms Lecture Notes
 
Mi0034 –database management systems
Mi0034 –database management systemsMi0034 –database management systems
Mi0034 –database management systems
 
Mc0077 – advanced database systems
Mc0077 – advanced database systemsMc0077 – advanced database systems
Mc0077 – advanced database systems
 
[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
 
Database administrator
Database administratorDatabase administrator
Database administrator
 
data abstraction in DBMS
data abstraction in DBMSdata abstraction in DBMS
data abstraction in DBMS
 
CS828 P5 Individual Project v101
CS828 P5 Individual Project v101CS828 P5 Individual Project v101
CS828 P5 Individual Project v101
 

Viewers also liked

Viewers also liked (19)

Identifiers in database
Identifiers in databaseIdentifiers in database
Identifiers in database
 
Chart media
Chart mediaChart media
Chart media
 
LIL WAYNE ALBUM COVER ANALYSIS
LIL WAYNE ALBUM COVER ANALYSISLIL WAYNE ALBUM COVER ANALYSIS
LIL WAYNE ALBUM COVER ANALYSIS
 
Evaluation question 7
Evaluation question 7Evaluation question 7
Evaluation question 7
 
Ingless
InglessIngless
Ingless
 
Introduction to sql_02
Introduction to sql_02Introduction to sql_02
Introduction to sql_02
 
Relationship in database
Relationship in databaseRelationship in database
Relationship in database
 
Женщины в IT
Женщины в ITЖенщины в IT
Женщины в IT
 
Home Sweet Home
Home Sweet HomeHome Sweet Home
Home Sweet Home
 
MATISYAHU ALBUM COVER ANALYSIS
MATISYAHU ALBUM COVER ANALYSISMATISYAHU ALBUM COVER ANALYSIS
MATISYAHU ALBUM COVER ANALYSIS
 
Music video analysis WEIRD AL
Music video analysis WEIRD ALMusic video analysis WEIRD AL
Music video analysis WEIRD AL
 
WEIRD AL ALBUM COVER ANALYSIS
WEIRD AL ALBUM COVER ANALYSISWEIRD AL ALBUM COVER ANALYSIS
WEIRD AL ALBUM COVER ANALYSIS
 
Construsoft konfoteka 10-11.04.14
Construsoft   konfoteka 10-11.04.14Construsoft   konfoteka 10-11.04.14
Construsoft konfoteka 10-11.04.14
 
Matisyahu Music Video Analysis
Matisyahu Music Video AnalysisMatisyahu Music Video Analysis
Matisyahu Music Video Analysis
 
Mapping in database
Mapping in databaseMapping in database
Mapping in database
 
Enhanced entity relationship model
Enhanced entity relationship modelEnhanced entity relationship model
Enhanced entity relationship model
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Evaluation question 3 WJB
Evaluation question 3 WJBEvaluation question 3 WJB
Evaluation question 3 WJB
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysis
 

Similar to Introduction to sql_01

Natural Language to SQL Query conversion using Machine Learning Techniques on...
Natural Language to SQL Query conversion using Machine Learning Techniques on...Natural Language to SQL Query conversion using Machine Learning Techniques on...
Natural Language to SQL Query conversion using Machine Learning Techniques on...HPCC Systems
 
Querying_with_T-SQL_-_01.pptx
Querying_with_T-SQL_-_01.pptxQuerying_with_T-SQL_-_01.pptx
Querying_with_T-SQL_-_01.pptxQuyVo27
 
Unit1,2 economics best ppt ever made.pptx
Unit1,2 economics best ppt ever made.pptxUnit1,2 economics best ppt ever made.pptx
Unit1,2 economics best ppt ever made.pptxSwastikSharma42
 
Intelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversionIntelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversionIAEME Publication
 
Lecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptxLecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptxShivam481778
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
 
261197832 8-performance-tuning-part i
261197832 8-performance-tuning-part i261197832 8-performance-tuning-part i
261197832 8-performance-tuning-part iNaviSoft
 
SQL Queries
SQL QueriesSQL Queries
SQL QueriesNilt1234
 
Sql server difference faqs- 6
Sql server difference faqs- 6Sql server difference faqs- 6
Sql server difference faqs- 6Umar Ali
 
sql ppt.pptx
sql ppt.pptxsql ppt.pptx
sql ppt.pptxArunT58
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Modelkunj desai
 

Similar to Introduction to sql_01 (20)

Database part2-
Database part2-Database part2-
Database part2-
 
Natural Language to SQL Query conversion using Machine Learning Techniques on...
Natural Language to SQL Query conversion using Machine Learning Techniques on...Natural Language to SQL Query conversion using Machine Learning Techniques on...
Natural Language to SQL Query conversion using Machine Learning Techniques on...
 
PHP - Introduction to Advanced SQL
PHP - Introduction to Advanced SQLPHP - Introduction to Advanced SQL
PHP - Introduction to Advanced SQL
 
Querying_with_T-SQL_-_01.pptx
Querying_with_T-SQL_-_01.pptxQuerying_with_T-SQL_-_01.pptx
Querying_with_T-SQL_-_01.pptx
 
Unit1,2 economics best ppt ever made.pptx
Unit1,2 economics best ppt ever made.pptxUnit1,2 economics best ppt ever made.pptx
Unit1,2 economics best ppt ever made.pptx
 
Intelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversionIntelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversion
 
SQL_NOTES.pdf
SQL_NOTES.pdfSQL_NOTES.pdf
SQL_NOTES.pdf
 
Lecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptxLecture 2.3.26_Conditional Control Structure.pptx
Lecture 2.3.26_Conditional Control Structure.pptx
 
IR SQLite Session #1
IR SQLite Session #1IR SQLite Session #1
IR SQLite Session #1
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
 
261197832 8-performance-tuning-part i
261197832 8-performance-tuning-part i261197832 8-performance-tuning-part i
261197832 8-performance-tuning-part i
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
Sql server difference faqs- 6
Sql server difference faqs- 6Sql server difference faqs- 6
Sql server difference faqs- 6
 
sql-commands.pdf
sql-commands.pdfsql-commands.pdf
sql-commands.pdf
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql commands
Sql commandsSql commands
Sql commands
 
MySQL basics
MySQL basicsMySQL basics
MySQL basics
 
sql ppt.pptx
sql ppt.pptxsql ppt.pptx
sql ppt.pptx
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

Introduction to sql_01

  • 1. Introduction to SQL ‫کننده‬ ‫تهیه‬:‫عادل‬ ‫هللا‬ ‫عصمت‬ ‫با‬ ‫معرفی‬SQL
  • 2. Topics: • What is SQL? • SQL Commands • SQL Select Statement •SQL‫چیست؟‬ •‫دستورات‬SQL •‫دستور‬Select،SQL 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 2
  • 3. What is SQL? • SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database. • SQL is an ANSI (American National Standards Institute) standard but there are many different versions of the SQL language. •SQL‫مخفف‬ ‫که‬(Structured Query Language)‫عبارت‬ ‫است‬ ‫ذخی‬ ‫برای‬ ‫کمپیوتر‬ ‫زبان‬ ‫یک‬ ‫از‬‫ره‬ ‫بازیاف‬ ‫و‬ ‫کردن‬ ‫دستکاری‬ ،‫کردن‬‫تن‬ ‫راب‬ ‫دیتابیس‬ ‫در‬ ‫شده‬ ‫ذخیره‬ ‫دیتا‬‫طه‬ ‫میباشد‬ ‫ای‬. •SQL‫شده‬ ‫قبول‬ ‫معیاری‬ ‫زبان‬ ‫یک‬ ‫توسط‬(ANSI)‫نسخه‬ ‫دارای‬ ‫اما‬ ‫بوده‬ ‫میباشد‬ ‫مختلف‬ ‫های‬. Nangarhar University Database1 3
  • 4. Continue… • SQL is the standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as standard database language. •SQL‫سیست‬ ‫برای‬ ‫معیار‬ ‫زبان‬ ‫یک‬‫م‬ ‫میباشد‬ ‫ای‬ ‫رابطه‬ ‫دیتابیس‬.‫تمام‬ RDBMS‫مانند‬ ‫ها‬MySQL،MS Access،Oracle،Sybase، Informix،Postgres‫و‬SQL Server‫زبان‬ ‫از‬SQL‫یک‬ ‫منحیث‬ ‫می‬ ‫استفاده‬ ‫دیتابیس‬ ‫معیار‬ ‫زبان‬‫کند‬. Nangarhar University Database1 4
  • 5. SQL commands: • SQL commands are instructions, coded into SQL statements, which are used to communicate with the database to perform specific tasks, work, functions and queries with data. • These commands can be classified into four groups: •‫دستورات‬SQL‫دستورات‬ ‫از‬ ‫عبارت‬ ‫با‬ ‫کردن‬ ‫مکالمه‬ ‫برای‬ ‫که‬ ‫میباشد‬ ‫وظ‬ ‫یک‬ ‫تا‬ ‫میرود‬ ‫بکار‬ ‫دیتابیس‬‫یفه‬ ‫شود‬ ‫اجرا‬ ‫خاص‬. •‫تقس‬ ‫بخش‬ ‫چهار‬ ‫به‬ ‫دستورات‬ ‫این‬‫یم‬ ‫میتواند‬ ‫شده‬: .1DDL .2DML .3DCL .4TCL 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 5
  • 6. 1) DDL: • DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database. The commands are CREATE, ALTER, DROP, RENAME, and TRUNCATE. •DDL‫اختصار‬Data Definition Language‫میباشد‬.‫برای‬ ‫که‬ ‫ساختار‬ ‫کردن‬ ‫اصالح‬ ‫و‬ ‫ساختن‬ ‫ب‬ ‫دیتابیس‬ ‫در‬ ‫دیتابیس‬ ‫اشیای‬‫کار‬ ‫میرود‬. •‫مثال‬ ‫بطور‬: •Create،Alter،Drop، Rename‫و‬Truncate 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 6
  • 7. 2) DML: • DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. These Data Manipulation Language commands are: SELECT, INSERT, UPDAT E, and DELETE. •DML‫اختصار‬Data Manipulation Language ‫میباشد‬.‫ذخی‬ ،‫بازیافتن‬ ‫برای‬ ‫که‬‫ره‬ ،‫کردن‬ ‫حذف‬ ،‫کردن‬ ‫اصالح‬ ،‫کردن‬ ‫دیتا‬ ‫درآوردن‬ ‫روز‬ ‫به‬ ‫و‬ ‫کردن‬ ‫درج‬ ‫میرود‬ ‫بکار‬ ‫دیتابیس‬ ‫در‬. •‫مثال‬ ‫بطور‬: •Select،Insert،Update‫و‬ Delete 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 7
  • 8. 3) DCL: • DCL is abbreviation of Data Control Language. It is used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it. These commands are GRANT and REVOKE. •DCL‫اختصار‬Data Control Language‫میباشد‬.‫برای‬ ‫که‬ ‫جامعیتی‬ ‫و‬ ‫اجازه‬ ،‫اصول‬ ‫ساختن‬ ‫کنترول‬ ‫برای‬ ‫همچنان‬ ‫ارجاعی‬ ‫منظور‬ ‫به‬ ‫دیتابیس‬ ‫به‬ ‫دسترسی‬‫امن‬ ‫میرود‬ ‫بکار‬ ‫آن‬ ‫ساختن‬. •‫مثال‬ ‫بطور‬: •Grant‫و‬Revoke 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 8
  • 9. 4) TCL: • TCL is abbreviation of Transactional Control Language. It is used to manage different transactions occurring within a database. These commands are COMMIT, ROLLBACK, and SAVEPOINT. •TCL‫اختصار‬Transactional Control Language‫میباشد‬.‫که‬ ‫های‬ ‫تراکنش‬ ‫کردن‬ ‫اداره‬ ‫برای‬ ‫اتفاق‬ ‫دیتابیس‬ ‫در‬ ‫ایکه‬ ‫مختلف‬‫می‬ ‫میرود‬ ‫بکار‬ ‫افتد‬. •‫مثال‬ ‫بطور‬: •Commit،Rollback‫و‬ Savepoint 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 9
  • 10. SQL Select Statement: • The SELECT statement is used to select data from a table. • Syntax: • SELECT column_name(s) FROM table_name. • Note: SQL statements are not case sensitive. SELECT is the same as select. •‫دستور‬select‫کردن‬ ‫انتخاب‬ ‫برای‬ ‫میرود‬ ‫بکار‬ ‫جدول‬ ‫یک‬ ‫از‬ ‫دیتا‬. •‫است‬ ‫ذیل‬ ‫قرار‬ ‫آن‬ ‫ساختار‬: • SELECT column_name(s) FROM table_name. •‫نوت‬:‫دستورات‬SQL‫میتوانید‬ ‫را‬ ‫توسط‬ ‫هم‬ ‫یا‬ ‫و‬ ‫کالن‬ ‫حروف‬ ‫توسط‬ ‫بنویسید‬ ‫خورد‬ ‫حروف‬.SELECT‫و‬ select‫است‬ ‫چیز‬ ‫عین‬. Nangarhar University Database1 10
  • 11. Continue… • To select the content of columns named "LastName" and "FirstName", from the database table called "Persons", use a SELECT statement like this: • SELECT LastName, FirstName FROM Persons •‫ست‬ ‫محتویات‬ ‫کردن‬ ‫انتخاب‬ ‫برای‬‫ون‬ ‫های‬FirstName‫و‬LastName ‫جدول‬ ‫از‬Person‫دستور‬select ‫بنویسید‬ ‫ذیل‬ ‫قرار‬ ‫را‬: • SELECT LastName, FirstName FROM Persons Nangarhar University Database1 11 First Name Last Name ahmad watan khyber afghan
  • 12. Select All Columns: • To select all columns from the "Persons" table, use a * symbol instead of column names, like this: • SELECT * FROM Persons •‫ها‬ ‫ستون‬ ‫تمام‬ ‫کردن‬ ‫انتخاب‬ ‫برای‬‫از‬ ‫جدول‬Person‫سمبول‬ ‫از‬*‫به‬ ‫ذیل‬ ‫قرار‬ ‫ها‬ ‫ستون‬ ‫نام‬ ‫عوض‬ ‫کنید‬ ‫استفاده‬. • SELECT * FROM Persons Nangarhar University Database1 12 Name Age Psot Salary Saif 22 Eng 100 Rishad 23 Doc 200 Mjeeb 32 Guard 300 Momin 33 teacher 400
  • 13. The SELECT DISTINCT Statement: • The distinct keyword is used to return only distinct (different) values. • Select distinct company from orders •‫کلیدی‬ ‫کلمه‬distinct‫برگشت‬ ‫برای‬ ‫یک‬ ‫از‬ ‫متمایز‬ ‫های‬ ‫قیمت‬ ‫دادن‬ ‫میرود‬ ‫بکار‬ ‫ذیل‬ ‫قرار‬ ‫جدول‬: • Select distinct company from orders Nangarhar University Database1 13 Company Order Number AWCC 234234 Roshan 56463 ZACC 4213 Afghan Telecome 6787689
  • 14. SQL WHERE Clause: • The WHERE clause is used to extract only those records that fulfill a specified criterion. • Syntax: • SELECT column_name, column_name FROM table_name WHERE column_name operator value; •‫کردن‬ ‫انتخاب‬ ‫برای‬record‫های‬ ‫مشخص‬ ‫شرط‬ ‫یک‬ ‫که‬ ‫میرود‬ ‫بکار‬ ‫کند‬ ‫صدق‬ ‫را‬. •‫ساختار‬: • SELECT column_name, column_name FROM table_name WHERE column_name operator value; Nangarhar University Database1 14
  • 15. SQL WHERE Clause… • Examples: 1. SELECT * FROM Customers WHERE Country='Mexico'; 2. SELECT * FROM Customers WHERE CustomerID=1; Nangarhar University Database1 15
  • 16. Operators in The WHERE Clause: Nangarhar University Database1 16
  • 17. SQL AND & OR Operators: • The AND & OR operators are used to filter records based on more than one condition. • The AND operator displays a record if both the first condition AND the second condition are true. • The OR operator displays a record if either the first condition OR the second condition is true. •‫های‬ ‫عملیه‬and‫و‬or‫فیلتر‬ ‫برای‬ ‫کردن‬record‫اضافتر‬ ‫براساس‬ ‫ها‬ ‫میرود‬ ‫بکار‬ ‫شرط‬ ‫یک‬ ‫از‬. •‫عملیه‬and‫وقتی‬ ‫را‬ ‫ریکارد‬ ‫یک‬ ‫دو‬ ‫هر‬ ‫صورتیکه‬ ‫در‬ ‫میدهد‬ ‫نشان‬ ‫را‬ ‫دوم‬ ‫شرط‬ ‫و‬ ‫اول‬ ‫شرط‬ ،‫شرط‬ ‫کند‬ ‫صدق‬. •‫عملیه‬or‫وقتی‬ ‫را‬ ‫ریکارد‬ ‫یک‬ ‫یکی‬ ‫هر‬ ‫درصورتیکه‬ ‫میدهد‬ ‫نشان‬ ‫صدق‬ ‫را‬ ‫دوم‬ ‫شرط‬ ‫و‬ ‫اول‬ ‫شرط‬ ‫از‬ ‫کند‬. 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 17
  • 18. Continue… • Examples: 1. SELECT * FROM Customers WHERE Country='Germany‘ AND City='Berlin'; 2. SELECT * FROM Customers WHERE City='Berlin‘ OR City='München'; 3. SELECT * FROM Customers WHERE Country='Germany' AND (City='Berlin' OR City='München'); 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 18
  • 19. SQL ORDER BY Keyword: • The ORDER BY keyword is used to sort the result-set by one or more columns. • The ORDER BY keyword sorts the records in ascending order by default. To sort the records in a descending order, you can use the DESC keyword. •‫کلیدی‬ ‫کلمه‬order by‫مرتب‬ ‫برای‬ ‫کردن‬result-set‫و‬ ‫یک‬ ‫اساس‬ ‫بر‬ ‫می‬ ‫بکار‬ ‫ستون‬ ‫یک‬ ‫از‬ ‫بیشتر‬ ‫یا‬‫رود‬. •‫کلیدی‬ ‫کلمه‬order by‫پیش‬ ‫بطور‬ ‫شکل‬ ‫به‬ ‫را‬ ‫ها‬ ‫ریکورد‬ ‫فرض‬ ‫میکند‬ ‫ترتیب‬ ‫صعودی‬.‫ت‬ ‫برای‬‫رتیب‬ ‫کل‬ ‫نزولی‬ ‫بشکل‬ ‫ریکاردها‬ ‫کردن‬‫مه‬ ‫کلیدی‬desc‫کنید‬ ‫استفاده‬ ‫را‬. 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 19
  • 20. Continue… • Syntax: • SELECT column_name, column_name FROM table_name ORDER BY column_name, column_name ASC|DESC; • Examples: 1. SELECT * FROM Customers ORDER BY Country; 2. SELECT * FROM Customers ORDER BY Country DESC; 3. SELECT * FROM Customers ORDER BY Country, CustomerName; 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 20
  • 21. 1:57 AM Gharjistan University Computer Science Faculty Farah Branch 21