Difference between revisions of "CREATE a new table"

From SQLZOO
Jump to: navigation, search
(Created page with "CREATE a new table <div class='ht'> <div class=params>schema:gisq</div> <div> The following are examples of field types: <table><tr><td>INTEGER</td><td>A whole number</td></t...")
 
Line 21: Line 21:
 
  ,b VARCHAR(10)
 
  ,b VARCHAR(10)
 
  )
 
  )
 
 
</source>
 
</source>
 
<div class="ecomm e-access" style="display: none">
 
<div class="ecomm e-access" style="display: none">

Revision as of 15:50, 12 July 2012

CREATE a new table

schema:gisq

The following are examples of field types:

INTEGERA whole number
VARCHAR(10)Up to 10 characters.
CHAR(10)Fixed number of characters
DATEA date
TIMESTAMPDate and time
FLOATFloating point numbers
DROP TABLE t_test
 
CREATE TABLE t_test
 (a INTEGER NOT NULL PRIMARY KEY
 ,b VARCHAR(10)
 )
CREATE TABLE t_test
 (a INTEGER PRIMARY KEY
 ,b VARCHAR2(10)
 )
CREATE TABLE t_test
 (a INTEGER PRIMARY KEY
 ,b VARCHAR(10)
 )
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense