From the course: Intermediate SQL for Data Scientists
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Reformat numeric data
From the course: Intermediate SQL for Data Scientists
Reformat numeric data
- [Instructor] When we work with numbers, we sometimes need to reformat them. And this is especially common when we're doing operations like division or other functions on numbers which result in a large number of decimal places. And it's great that we have that precision, but oftentimes, say when we're printing something out or we're just looking at a report, we might only need a couple of decimal places of precision. So let's look at different ways in which we can reformat data. So let's work with the salary column. So let's select salary from the data size schema and that's from the employee's table. And we'll start very simply and build our select statement. So we have a number of values here. These are all whole numbers, so that's not a problem. I don't need to reformat anything there. But let's assume I want everything to be, you know, like two decimal places or something like that. That's what I'm shooting for.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Reformat character data8m 24s
-
Extract strings from character data6m 26s
-
(Locked)
Filter with regular expressions7m 14s
-
(Locked)
Reformat numeric data4m 11s
-
(Locked)
Use SOUNDEX with misspelled text7m 50s
-
(Locked)
Challenge: Prepare a data set for analysis26s
-
(Locked)
Solution: Prepare a data set for analysis32s
-
(Locked)
-
-
-
-