Sybase Datatypes
Sybase Datatypes: Datatypes are used to specify the type of to be stored in a column of table. Few of the following datatypes, we have to give the size. We can convert one datatype to other using conversion functions.
Datatype | Range | Storage Size(Bytes) |
---|---|---|
tinyint | 0 to 255 | 1 |
smallint | 32,767 to -32768 | 2 |
int | 2,147,483 to -2,147,483,648 | 4 |
float | machine dependent | 4 to 8 |
double precision | machine dependent | 8 |
real | machine dependent | 4 |
money | 922,337,203,685,477.5807 to -922,337,203,685,477.5808 |
8 |
smalldatetime | January 1, 1900 to June 6, 2079 | 4 |
datetime | January 1, 1753 to December 31, 9999 | 8 |
char(n) | pagesize | |
varchar(n) | apgesize | |
nchar(n) | pagesize | |
nvarchar(n) | pagesize | |
text | 2,147,483,647 | |
binary | pagesize | |
varbinary | pagesize | |
image | 2,147,483,647 | |
bit | 0 or 1 | 1 |
Examples:
create table table_name
(column1 datatype, column2 datatype2,
columnn datatype)
create table emp(
empno int, empname varchar(30),
joining_date datetime, salary money, deptno int)