sql-select Flashcards

1
Q

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

A

SQL is a declarative language like HTML and CSS where we give input and receive output .. where with javascript we give it step by step instruction

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

SELECT “columnName”

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 “columnName” comparison “specificCriteria”

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

makes code easy to read

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

equals
less than
greater than
not equal to

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

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 *

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 “whatever column name is” ASC/DESC

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