Save
Databases Final
ORDER BY LIMIT
Save
Share
Learn
Content
Leaderboard
Learn
Created by
tiana okane
Visit profile
Cards (18)
Databases
A collection of data organized and structured to provide efficient retrieval, manipulation, and management of information
View source
Structure
Query Language (SQL)
A programming language used to manage and manipulate
relational
databases
View source
ORDER
BY
Ordering results from the database, sorting using
Ascending
or
Descending
View source
ORDER
BY
SELECT columns
FROM
table
WHERE condition ORDER BY column direction
View source
ORDER
BY -
ascending
SELECT *
FROM Pet ORDER
BY Age
ASC
View source
ORDER
BY -
ascending
SELECT
* FROM Pet ORDER BY
NAME
ASC
View source
ORDER BY - Descending
SELECT * FROM Pet ORDER BY Age DESC
View source
Multiple ORDER Fields
1. ORDER BY
firstName
,
lastName
2. ORDER BY
Age
ASC,
BankBalance
DESC
View source
ORDER
BY -
ascending
SELECT * FROM Pet ORDER
BY Type
,
Name
ASC
View source
LIMIT
Restricting
the number of
records
in the returned set
View source
LIMIT
- NO Offset
SELECT * FROM Pet LIMIT
0, 3
SELECT * FROM Pet LIMIT
3
View source
LIMIT
- with Offset
SELECT * FROM Pet LIMIT
1
,
3
View source
Pets
in Threes
View source
LIMIT
- NO Offset
SELECT * FROM Pet LIMIT
0, 3
View source
LIMIT - Offset 3 Rows
SELECT * FROM Pet LIMIT 3, 3
View source
LIMIT
- Offset 6 Rows
SELECT * FROM Pet LIMIT
6, 3
View source
LIMIT
- Offset
9
Rows
SELECT * FROM Pet LIMIT 9,
3
View source
LIMIT
- Typical query
SELECT Name, Age FROM Pet WHERE Type = 'Dog' ORDER BY Age DESC LIMIT 0,
1
View source