Module 3: SQL Queries Flashcards
SQL
Structured Query Language
Large data sets.
Tool that makes working with large datasets easier.
Relational Database
A database that contains a series of tables that can be connected to form relationships
Features of SQL
Larger Datasets -
Access tables across a database - can pull information from different sources in the database.
Prepare data for further analysis in another software
Fast and powerful functionality
Great for collaborative work and tracking queries run by all users.
A language used to interact with different databases
Stored across a database
Features of spreadsheets
Smaller data sets - Data that you input.
Enter data manually
Create graphs and visualisations in the same program
Built-in spell check and other useful functions
best when working solo on a project
Generate with a program
Stored locally
Build in functionalities
Commonality between spreedsheets and SQL
Use formulars, use arthimatite. and join data.
INSERT INTO
Allows you to insert a new data entry
UPDATE and SET
Allows you to update a address
DISTINCT in SELECT
Can allow you to remove duplicates
What is one thing you should remember from the FROM statement
Located in a data so in the FROM section of an SQL query, you have to remember that the data is protected by the personal project name therefore the template of the file path structuring the structure:
personalprojectname.customer_data.customer_address
Text Strings
A group of characters within a cell, commonly composed of letter, numbers, or both
How can using Length filter and clean data
You can use length to identify how many text string characters are within a table.
Such as, if the country name is meant 2 characters long you can use length to identify if there are any places where the text string is longer than meant to be for example
WHERE
LENGTH(state) > 2
And any rows with more than two characters will be identified.
OH for example if is a result of the above query then it is known that there is an additional space within the role highlighting in error.
How can TRIM be used to filter and clean data
If the text combo TRIM can be used to only pull the data that is relevant to the command that you provide it.
For example if you use TRIM to eliminate any spaces within both sets of data you can do so by only adding in the text string that you want to receive back, the query will then eliminate any additional characters or strings that you have not provided while still bringing back the relevant information.
CAST()
Can be used to convert anything from one data type to another
Typecasting
Converting data from one type to another