From the course: SQL Queries Made Easy

Unlock the full course today

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

Datatypes for columns in tables

Datatypes for columns in tables - SQL Tutorial

From the course: SQL Queries Made Easy

Start my 1-month free trial

Datatypes for columns in tables

- [Instructor] In this video, we will learn about the various data types we can define for columns in tables. We will also understand which data type to use in which scenario. Data type specifies the kind of values that are inserted into each column. First one is VARCHAR2. We use this when we have a character data, but with variable length. The size specifies the maximum number of characters that can be given in that column. Minimum size can be one, maximum size can be up to 4,000. The size has to be specified. CHAR is also for character data, but with fixed length. Minimum size is one, and maximum size is only 2000. If the size is not specified, it takes the default value as one. We generally use VARCHAR2 when we are uncertain about the number of characters in the data that is inserted in the table. NUMBER is for numeric data with variable length. P stands for precision, and S stands for scale. P specifies the…

Contents