Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to check data type in SQL?

1 Answer

0 votes
by (119k points)

You can use the following syntax to check the data type of a specific column in a table.

SELECT DATA_TYPE

FROM INFORMATION_SCHEMA.COLUMNS

WHERE

     TABLE_NAME = 'table_name' AND

     COLUMN_NAME = 'column_name' 

You can also use the describe statement to check the datatypes of all the columns of the table as follows: 

DESCRIBE table_name;

If you are interested in SQL, then check out this SQL Course by Intellipaat that offers instructor-led training, certification, and job assistance. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Oct 20, 2020 in SQL by dev_sk2311 (45k points)
0 votes
1 answer
asked Dec 9, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
asked May 4, 2020 in SQL by Sudhir_1997 (55.6k points)

Browse Categories

...