From the course: Learning SQL Programming

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Data types in SQL

Data types in SQL - SQL Tutorial

From the course: Learning SQL Programming

Start my 1-month free trial

Data types in SQL

- [Instructor] Fields in a database represent specific kinds of data, like a name, a date, an ID number, or an amount of points in a competition. Depending on how we use these fields, we may not really care what kind of information they represent. But most databases require us to define what kind of data a particular field will hold when we build a table. Different kinds of data are stored in different ways, and that's something the database software mostly takes care of. But these different kinds of information storage, these data types offer us certain abilities when writing SQL statements. For example, it doesn't make sense to ask the database to add up the value of all the names in a table. But it might make sense to add up all the points won in a game. Generally speaking, SQL has a few categories of data types you should be aware of, those dealing with binary information, with dates and times, with numbers, and with text. Within each of those general categories, there are…

Contents