Join Dan Sullivan for an in-depth discussion in this video Reformatting numeric data, part of Advanced SQL for Data Scientists.
- [Instructor] Sometimes we will need to reformat numbers.…This is especially true when we use calculations…that have results with large numbers of decimal digits.…For example, when we calculate the average salary…by department, we will get a default format…which produces more digits than really are necessary.…Let's see that for an example.…We'll select departments and the average salary.…We'll select this from the staff table,…and because we're using an aggregate function,…in this case the average, we're going to want to make sure…we have a group by statement, and in this case,…we're going to group by department.…
When we execute this, we'll see we get a department list,…and for each department, we have an average.…Typically we would expect to see two decimal places…when we're dealing with currencies,…but in this case, we get more than is needed.…There are a few different ways we can address this.…If we're only interested in working with…whole dollar amounts, then one option is…to use the truncate function, or trunc.…
The course begins with a brief overview of SQL. Then the five major topics a data scientist should understand when working with relational databases: basic statistics in SQL, data preparation in SQL, advanced filtering and data aggregation, window functions, and preparing data for use with analytics tools.
- Data manipulation
- ANSI standards
- SQL and variations
- Statistical functions in SQL
- String, numeric, and regular expression functions in SQL
- Advanced filtering techniques
- Advanced aggregation techniques
- Windowing functions for working with ordered data sets
Skill Level Advanced
1. SQL as a Tool for Data Science
SQL data definition features5m 32s
2. Basic Statistics with SQL
3. Data Munging with SQL
4. Filtering, Joins, and Aggregation
5. Window Functions and Ordered Data
6. Preparing Data for Analytics Tools
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.