sql-select Flashcards
What is SQL and how is it different from languages like JavaScript?
It’s the primary way of interacting with relational databases. It is a powerful way of retrieving, creating, and manipulating data in a relational database.
JS is an imperative programming language where you basically tell the JavaScript runtime what to do and how to do it.
SQL is a declarative programming language. In declarative languages, programmers describe the results they want and the programming environment comes up with its own plan for getting those results.
HTML and CSS are declarative
How do you retrieve specific columns from a database table?
select
How do you filter rows based on some specific criteria?
where
What are the benefits of formatting your SQL?
SQL does not have to be indented, but you should do it anyway for consistent style and therefore readability.
Style and 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
How do you retrieve all columns from a database table?
- or asterisk
How do you control the sort order of a result set?
order by