So I just started sql. There is int for integers, character for character string and varchar for either integer or character. Is there a datatype using which I can input both the types together( e.g., A10) ? If not is there an alternative way of doing so?
2 Answers
You can use CHAR , VARCHAR , VARCHAR 2 , NVARCHAR as datatype for your field(in MsSQL). They all have some different properties but they all store alphanumeric values(i.e A10).
the difference between these datatypes are well explained in the below article:
http://www.orafaq.com/faq/what_is_the_difference_between_varchar_varchar2_and_char_data_types
A10?A10in aninteger(or evendecimal) column. So you do not have the choice in the first place. (Plus you should always mention the DBMS you are using. "SQL" is just a query language, not a DBMS product)