SELECT

SELECT = tons of things!

  • select(), rename(), and relocate()
planes |> 
  select(tailnum, type, manufacturer, model, year) |>
  show_query()
## <SQL>
## SELECT tailnum, "type", manufacturer, model, "year"
## FROM planes
planes |> 
  select(tailnum, type, manufacturer, model, year) |> rename(year_built = year) |> 
  show_query()
## <SQL>
## SELECT tailnum, "type", manufacturer, model, "year" AS year_built
## FROM planes
planes |> 
  select(tailnum, type, manufacturer, model, year) |>
  relocate(manufacturer, model, .before = type) |> 
  show_query()
## <SQL>
## SELECT tailnum, manufacturer, model, "type", "year"
## FROM planes

Not shown: mutate(), summarize() are also SELECT