Week 4 - Ins and Outs of Core Data Tools Flashcards

1
Q

SQL (Structured Query Language)

A

It can help you investigate huge databases, track down text (referred to as strings) and numbers, and filter for the exact kind of data you need—much faster than a spreadsheet can.

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

Query

A

a request for data or information from a database. When you query databases, you use SQL to communicate your question or request

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

Syntax

A
  • unique set of guidelines followed by SQL.
  • is the predetermined structure of a language that includes all required words, symbols, and punctuation, as well as their proper placement.
  • e.g.
    SELECT - choose the column you want to return
    FROM - choose the tables where the columns you want are located
    WHERE - to filter for certain information.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

WHERE

A

WHERE field1 = ‘Chavez’

However, if you are looking for all customers with a last name that begins with the letters “Ch,” the WHERE clause would be:

WHERE field1 LIKE ‘Ch%’

You can conclude that the LIKE clause is very powerful because it allows you to tell the database to look for a certain pattern! The percent sign (%) is used as a wildcard to match one or more characters. In the example above, both Chavez and Chen would be returned. Note that in some databases an asterisk (*) is used as the wildcard instead of a percent sign (%).

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

ALIASES

A
  • can also make it easier on yourself by assigning a new name or alias to the column or table names to make them easier to work with (and avoid the need for comments).
  • This is done with a SQL AS clause. In the example below, the alias last_name has been assigned to field1 and the alias customers assigned to table.
  • These aliases are good for the duration of the query only. An alias doesn’t change the actual name of a column or table in the database.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly