Skip to content

Select

SELECT

  • SELECT lists all the mentioned attributes from the result of a query
  • corresponds to project (\(\Pi\)) from relational algebra
  • note that names are case-insensitive
  • by default, select chooses duplicate entries as well
  • use DISTINCT to specify that duplicates should not be selected, and ALL to specify that they ahould be
  • an asterisk denotes all attributes

Slightly more funky stuff

  • the select parameter can be a literal. If it is so, then it will return a table with one column and one row for each entry in the table, and each entry is filled with the given literal
  • you can perform arithmetic operations on attributes while selecting them
  • use the AS keyword to rename anything you want to select