GITTA-Logo
PDF Version of this document Search Help

Lesson Navigation IconAnfragesprache SQL

Unit Navigation IconSQL Overview

Unit Navigation IconBasic database queries

LO Navigation IconSelect-From-Where

LO Navigation IconMultiple conditions

LO Navigation IconComplex conditions

LO Navigation IconArithmetische Operatoren

LO Navigation IconNon-relational constructs

LO Navigation IconSet operators

LO Navigation IconUsage of SQL

LO Navigation IconDatabase queries

Unit Navigation IconSQL Insert, Delete and Update

Unit Navigation IconSummary

Unit Navigation IconRecommended Reading

Unit Navigation IconBibliography

Unit Navigation IconMetadata


GITTA/CartouCHe news:


Go to previous page Go to next page

Pattern matching and arithmetical operators

Pattern matching using LIKE

The LIKE condition allows you to use wildcards in the WHERE clause of an SQL statement. This allows pattern matching.
The patterns that you can choose from are:

  • "%" allows you to match any string of any length (including zero length)
  • "_" allows you to match on a single character
Pattern matching using LIKE

Arithmetical operators

The arithmetical standard operators for addition (+), subtraction (-), multiplication (*) and division (/) can all be used for numerical constant or for attributes with a numerical domain.

Arithmetical operations query

In the above example the result is a relation with three attributes. The third attribute is named "Usury" since "Price/Size" is not a good name and stands for the price per unit. We define that if it lies over 15, it is overpriced ("Usury").

Top Go to previous page Go to next page