Chapter 6 - Introduction To SQL
Chapter 6 - Introduction To SQL
Database Systems: 9th Ed, Coronel et al. 3 Database Systems: 9th Ed, Coronel et al. 4
Logical Operators: Using the AND operator Logical Operators: Using the NOT operator
Database Systems: 9th Ed, Coronel et al. 9 Database Systems: 9th Ed, Coronel et al. 10
Database Systems: 9th Ed, Coronel et al. 11 Database Systems: 9th Ed, Coronel et al. 12
The IS NULL special operator The LIKE special operators
Database Systems: 9th Ed, Coronel et al. 15 Database Systems: 9th Ed, Coronel et al. 16
Database Systems: 9th Ed, Coronel et al. 17 Database Systems: 9th Ed, Coronel et al. 18
The LIKE special operator The LIKE special operator
Using the [abc] wildcard Using the [^abc] wildcard
Database Systems: 9th Ed, Coronel et al. 19 Database Systems: 9th Ed, Coronel et al. 20
Database Systems: 9th Ed, Coronel et al. 21 Database Systems: 9th Ed, Coronel et al. 22
Used to tally the number of non-null values of an Use to get the Highest (Maximum) and Lowest
attribute. (Minimum) value respectively.
SELECT MIN(UnitPrice)
FROM Products
Database Systems: 9th Ed, Coronel et al. 25 Database Systems: 9th Ed, Coronel et al. 26
It computes the total sum for any specified It computes for the average of any specified
attribute, using whatever conditions imposed attribute
Database Systems: 9th Ed, Coronel et al. 27 Database Systems: 9th Ed, Coronel et al. 28
Database Systems: 9th Ed, Coronel et al. 29 Database Systems: 9th Ed, Coronel et al. 30
The GROUP BYs HAVING clause
SELECT OrderDate
,AVG(Freight) AS AverageFreight
FROM Orders
GROUP BY OrderDate
,ShipRegion
HAVING ShipRegion IS NULL
ORDER BY OrderDate
Database Systems: 9th Ed, Coronel et al. 31