Section 4 - Exchanging Data Flashcards
SQL
What does SQL stand for?
Structured Query Language
SQL
What type of language is SQL and what is it used for?
A declarative
language used for querying and updating tables
SQL
Name each statement used in SQL
4 statements
- SELECT
- FROM
- WHERE
- ORDER BY
SQL
What does the SELECT statement do?
List the fields to be displayed
SQL
What does the FROM statement do?
List the table or tables the data will come from
SQL
What does the WHERE statement do?
List the search criteria
SQL
What does the ORDER BY statement do?
List the fields that the results are to be sorted on (default is Ascending order)
SQL
Name each condition used in SQL
- Python conditions
- IN
- LIKE
- BETWEEN…AND
- IS NULL
- AND
- OR
- NOT
Python conditions: =, >, <, !=, >=, <=
SQL
What does the IN condition do?
Equal to a value within a
set of values
SQL
What does the LIKE condition do?
Similar to
SQL
What does the IS NULL condition do?
Field does not contain
a value
SQL
What does the BETWEEN…AND condition do?
Within a range, including
the two values which
define the limits
SQL
What does the AND condition do?
Both expressions must
be true for the entire
expression to be judged
true
SQL
What does the OR condition do?
If either or both of the
expressions are true,
the entire expression is
judged true
SQL
What does the NOT condition do?
Inverts truth
SQL
What does the JOIN statement do?
Provides an alternative method of combining rows from two or more tables, based on a common field between them
SQL
How do you combine data with the JOIN statement?
SELECT Song.SongTitle, Artist.ArtistName, Song.MusicType
FROM Song
JOIN Artist
ON Song.ArtistID = Artist.ArtistID
WHERE Song.MusicType = “Art Pop”
SQL
How do you combine data without the JOIN statement?
SELECT Song.SongTitle, Artist.ArtistName, Song.MusicType
FROM Song, Artist
WHERE (Song.ArtistID = Artist.ArtistID) AND (Song.MusicType = “Art Pop”)
Compression, Encryption and Hashing
What are the two types of compression?
Lossy and Lossless
Compression, Encryption and Hashing
What are the differences between lossless and lossy compression?
- Data lost in lossy, none lost in lossless
- Lossy compression cannot be done on text, but lossless compression can be on done any file