sql-select-Q&A Flashcards
What is SQL and how is it different from languages like JavaScript?
SQL is a declarative programming language, 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 of column”
How do you filter rows based on some specific criteria?
where “Name of column” = “Name of row”
What are the benefits of formatting your SQL?
Database tables in large systems can contain millions of rows. As humans we cannot really understand that much information all at once. Plus, the types of problems that we are solving usually involve a few pieces of data at a time.
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 (number of rows)
How do you retrieve all columns from a database table?
The * (asterisk) operator
How do you control the sort order of a result set?
Order by