sql-select Flashcards
What is SQL and how is it different from languages like JavaScript?
Declarative language, we tell it what to do and it figures out how to do it
How do you retrieve specific columns from a database table?
Select statement, select keyword, columns
How do you filter rows based on some specific criteria?
where clause followed by condition
column and table names: “”
values: ‘’
What are the benefits of formatting your SQL?
- standardized
- legible
- easier to debug
What are four comparison operators that can be used in a where clause?
! = , <> Not equal
> , > = Greater than, greater than or equal to
< , < = Less than, less than or equal to
BETWEEN … AND … Inclusive of two values
How do you limit the number of rows returned in a result set?
limit clause
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
order by
will sort by default A-Z/0-9
-use desc to reverse