sql-select Flashcards

1
Q

What is SQL and how is it different from languages like JavaScript?

A

powerful way to retrieve, create, and manipulate data in a relational databases.
(structured query language)

SQL is a declarative programming language. meaning the programmers describe the results they want and the programming environment comes up with its plans to get that result. (example: CSS and HTML) –> example: you put the property and value to make the font bigger.

relational databases interpret SQL and comes up with the most efficient plan to get the results from the programmers command lines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you retrieve specific columns from a database table?

A

using the keyword “select” and “from”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you filter rows based on some specific criteria?

A

WHERE CLAUSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the benefits of formatting your SQL?

A

readability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are four comparison operators that can be used in a where clause?

A

=, < , > and !=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you limit the number of rows returned in a result set?

A

limit Clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you retrieve all columns from a database table?

A

select * (astrix)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you control the sort order of a result set?

A

order by (option descending)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly