sql-select Flashcards
What is SQL and how is it different from languages like JavaScript?
SQL is a language used in querying relational databases. It is a powerful way of retrieving, creating, and manipulating data in a relational database.
It is declarative because you describe to the computer what you want to do and it carries it out for you in the best way it can while JavaScript is imperative.
How do you retrieve specific columns from a database table?
select columns from the table
How do you filter rows based on some specific criteria?
where
What are the benefits of formatting your SQL?
It helps narrow down only the information of import at the time we need it as databases can contain millions of rows
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?
By using the universal selector ‘*’
How do you control the sort order of a result set?
order by desc (descending) or order by (ascending)