Oracle SQL in 10 Minutes - Asim Abbasi

CH1: SQL Basics | CH2:  SQL Operators | CH3:  SQL Built-in Functions | CH4: SQL Joins | CH5: UPDATE, INSERT & DELETE Statements | CH6: CREATE, ALTER & DROP Statements | CH7: Constraints | CH8: Linking Tables vs Joining Tables | CH9: SQL Statements for Other Database Objects | CH10: SQL Statements for Database Security

Chapter 6: CREATE, ALTER & DROP Statement

Page #: 1 | 2 | 3 | 4

 

CHAR (size):

A fixed-sized field of characters. Max 2000 bytes/characters.

VARCHAR2 (size):

A variable-sized field of characters. Max 4000 bytes/characters.

LONG: A variable-sized field of characters. Max 2GB.

NUMBER (precision, scale):

A variable-sized number. A NUMBER datatype with only one parameter is NUMBER (precision), where the parameter specifies the precision of the number. The precision can range from 1 to 38 and the scale can range from -84 to 127. A NUMBER datatype with no parameters is set to its maximum size.

DATE:

A fixed-sized 7 bit field that is used to store dates. One thing to note is that the time is stored as part of the date.

RAW (size):

A variable-sized field of raw binary data. Max 2000 bytes.

LONG RAW:

A variable-sized field of raw binary data. Max 2 GB.

BLOB:

The Binary Large Object is a field that holds unstructured binary data. Max 4 GB.

CLOB:

The Character Large Object is a field that holds single byte character data. Max 4 GB.

BFILE:

An external binary file. The maximum size for this file is 4 GB. The size is also limited by the operating system.

Example:

CREATE TABLE album(
id NUMBER(6),
title VARCHAR2(100),
artist VARCHAR2(100),
activity DATE
);

Chapter 6: CREATE, ALTER & DROP Statement

Page #: 1 | 2 | 3 | 4

CH1: SQL Basics | CH2:  SQL Operators | CH3:  SQL Built-in Functions | CH4: SQL Joins | CH5: UPDATE, INSERT & DELETE Statements | CH6: CREATE, ALTER & DROP Statements | CH7: Constraints | CH8: Linking Tables vs Joining Tables | CH9: SQL Statements for Other Database Objects | CH10: SQL Statements for Database Security

Share with others: