sql-select Flashcards
What is SQL and how is it different from languages like JavaScript?
SQL is a declarative programming language.
How do you retrieve specific columns from a database table?
By using “select” keyword and the column’s name within double quote.
How do you filter rows based on some specific criteria?
Using the “where” keyword followed by a comparison.
What are the benefits of formatting your SQL?
Readability.
What are four comparison operators that can be used in a where clause?
=
!=
>
How do you limit the number of rows returned in a result set?
Using the “keyword” limit and a number for the limit.
How do you retrieve all columns from a database table?
Using * with the “select” keyword.
How do you control the sort order of a result set?
By adding a “desc” for descending or leave blank of ascending.