SQL Select Flashcards
What is SQL and how is it different from languages like JavaScript?
SQL is a programming language used for interacting with relational database management systems. It is different from JavaScript because it is a declarative language.
How do you retrieve specific columns from a database table?
You use the select keyword with the names of the columns.
How do you filter rows based on some specific criteria?
You use a where clause and the name of the attribute compared against the value you want to filter for.
What are the benefits of formatting your SQL?
It makes your code easier to read.
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?
You use the limit keyword and then number of rows to limit to.
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
You use the order by clause and the attribute you want to order by. Default is ascending order