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

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.…

Contents