From the course: Learning SQL Programming

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Find information about the data

Find information about the data - SQL Tutorial

From the course: Learning SQL Programming

Find information about the data

- [Instructor] Instead of just getting back records that match our queries, we can use some other functions and commands to find out more about the data itself. Let's take a look at ways of describing the data by finding out how long the values and fields are, how many distinct values a field contains, and how many values match some criteria. I'll write a simple query here to get the first name of everyone in our database. And let's add the first_name field here in the SELECT clause again. But this time I'll wrap it in a function called LENGTH, which will tell us how long the information in the given field is in characters, rather than the value of the field itself. And checking just a little bit here, I can see that this matches up with what I'd expect. Janice is six characters long. Wanda is five characters long. Jack and Ryan are both four characters long, and so on. We can use that on some other fields too if we wanted to explore a little bit. It can be helpful to get a listing of…

Contents