sql-select Flashcards
What is SQL and how is it different from languages like JavaScript?
SQL statements specify what data operations should be performed rather than how to perform them.
In declarative languages, programmers describe the results they want and the programming environment comes up with its own plan for getting those results
How do you retrieve specific columns from a database table?
select “name”
from “table name”
How do you filter rows based on some specific criteria?
where “name” = ‘name’
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?
limit 15;
can use ‘offset’ to skip rows
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
order by “price” desc