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 - 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…
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)
Ask for data with SELECT4m 40s
-
(Locked)
Narrow down a query with WHERE4m 24s
-
(Locked)
Adding more criteria to a statement4m 17s
-
(Locked)
Broadening and limiting responses4m 11s
-
(Locked)
Organize responses with ORDER BY3m 2s
-
(Locked)
Find information about the data3m 47s
-
(Locked)
Solution: Retrieve data from the database1m 6s
-
(Locked)
-
-
-
-