VisualBuilder
  Home > Database > Tutorials > Data Types in SQL - SQL tutorial
Tell a friend
Link to us
Total Members
      Members: 84648
     
Sitemap Forum Chat
Home
SQL Tutorial Tutorial Home
1 . History of SQL
2 . SQL Components: An Overview
3 . Data Types in SQL
4 . Planning a Database: An Example: -
5 . Creating Tables
6 . Inserting Data using Insert
7 . Getting Data with Select Statement
8 . Working with Operators
9 . Selecting Unique rows with Distinct
10 . Arraging Data with Order by
11 . Working with Strings
12 . SQL AND
13 . Basic SQL Funtion
14 . Sub-Queries, Nested Queries
15 . Constraints in the Table
16 . SQL UPDATE
17 . View
18 . Relationships in a RDBMS
19 . Structure Modification,Updation and Deletion
 
Database Group Home
Database Discussion
Database Members (506)
Database Resources
Database Source Code (0)
Database Articles (0)
Database Blogs
Database Jobs
Database Components (0)
Database Books
Database Websites (0)
Database News (0)
Database Q & A (14)
- Database Ask Question
- Database Questions
- Database Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (436 )
Source Code (3275 )
Articles (11 )
Components (1589 )
News (888 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Database sql Tutorial
 Data Types in SQL
  << Prev: SQL Components: An Overview Next: Planning a Database: An Example: - >>

The following are the datatypes used in SQL: -


Character Data Types in SQL: -


CHAR( size)[BYTE | CHAR] Fixed-length character data of length size bytes. Maximum size is 2000 bytes. Default and minimum size is 1 byte. BYTE and CHAR have the same semantics as for VARCHAR2.


NCHAR( size) Fixed-length character data of length size characters. Maximum size is determined by the national character set definition, with an upper limit of 2000 bytes. Default and minimum size is 1 character.


VARCHAR2( size) [BYTE | CHAR] Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2. BYTE indicates that the column will have byte length semantics; CHAR indicates that the column will have character semantics.


NVARCHAR2( size) Variable-length character string having maximum length size characters. Maximum size is determined by the national character set definition, with an upper limit of 4000 bytes. You must specify size for NVARCHAR2.


Numeric Data Types in SQL: -


NUMBER( p,s) Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127.


LONG Character data of variable length up to 2 gigabytes, or 2 31 -1 bytes.


Date, Time and Interval Data Types: -


DATE Valid date range from January 1, 4712 BC to December 31, 9999 AD. 180


TIMESTAMP ( fractional_ seconds_precision) Year, month, and day values of date, as well as hour, minute, and second values of time, where fractional_seconds_precisionis the number of digits in the fractional part of the SECOND datetime field. Accepted values of fractional_ seconds_precision are 0 to 9. The default is 6.


TIMESTAMP ( fractional_ seconds_precision) WITH TIME ZONE All values of TIMESTAMP as well as time zone displacement value, where fractional_ seconds_precisionis the number of digits in the fractional part of the SECOND datetime field. Accepted values are 0 to 9. The default is 6. 231


TIMESTAMP ( fractional_ seconds_precision) WITH LOCAL TIME ZONE All values of TIMESTAMP WITH TIME ZONE, with the following exceptions: n Data is normalized to the database time zone when it is stored in the database. n When the data is retrieved, users see the data in the session time zone.


INTERVAL YEAR ( year_precision) TO MONTH Stores a period of time in years and months, where year_precision is the number of digits in the YEAR datetime field. Accepted values are 0 to 9. The default is 2.


INTERVAL DAY (day_ precision) TO SECOND ( fractional_ seconds_precision) Stores a period of time in days, hours, minutes, and seconds, where n day_precision is the maximum number of digits in the DAY datetime field. Accepted values are 0 to 9. The default is 2. n fractional_seconds_precision is the number of digits in the fractional part of the SECOND field. Accepted values are 0 to 9. The default is 6.


Raw and Long Raw Data Types: -


RAW( size) Raw binary data of length size bytes. Maximum size is 2000 bytes. You must specify size for a RAW value.


LONG RAW Raw binary data of variable length up to 2 gigabytes.


RowID Data Types: -


ROWID Base 64 string representing the unique address of a row in its table. This datatype is primarily for values returned by the ROWID pseudocolumn.


UROWID [( size)] Base 64 string representing the logical address of a row of an index-organized table. The optional size is the size of a column of type UROWID. The maximum size and default is 4000 bytes.


Large Object Data Types (LOB's): -


CLOB A character large object containing single-byte characters. Both fixed-width and variable-width character sets are supported, both using the CHAR database character set. Maximum size is 4 gigabytes.


NCLOB A character large object containing Unicode characters. Both fixed-width and variable-width character sets are supported, both using the NCHAR database character set. Maximum size is 4 gigabytes. Stores national character set data.


BLOB A binary large object. Maximum size is 4 gigabytes.


BFILE Contains a locator to a large binary file stored outside the database. Enables byte stream I/O access to external LOBs residing on the database server. Maximum size is 4 gigabytes.


  << Prev: SQL Components: An Overview Next: Planning a Database: An Example: - >>
Database Sql Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
conference calls
VoIP Internettelefonie
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising