faqts : Computers : Programming : Languages : Sql

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 1 people (100%) answered Yes
Recently 1 of 1 people (100%) answered Yes

Entry

Database: Language: SQL: Table: Operation: Create: How to create a table?

Mar 20th, 2005 02:30
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 20 March 2005 - 04:28 pm ----------------------

Database: Language: SQL: Table: Operation: Create: How to create a 
table?

---

Use the SQL command:

 CREATE TABLE

---
---

General format:

-----------------------------------------------
CREATE TABLE
 <mytablename>
(
 <mycolumnname1> <mycolumndatatype1>,
 <mycolumnname2> <mycolumndatatype2>,
 <mycolumnname3> <mycolumndatatype3>,
 ...
 <mycolumnnameN> <mycolumndatatypeN>
)
;
-----------------------------------------------

---
---

e.g.

-----------------------------------------------
CREATE TABLE
 tableAddressS
(
 columnPrimaryKeyI INT AUTO_INCREMENT PRIMARY KEY,
 columnFirstNameS VARCHAR( 50 ),
 columnLastNameS VARCHAR( 100 ),
 columnStreetS VARCHAR( 100 ),
 columnCityS VARCHAR( 100 ),
 columnZipCodeS VARCHAR( 10 ),
 columnCountryS VARCHAR( 30 ),
 columnTelephoneS VARCHAR( 20 ),
 columnFaxS VARCHAR( 20 ),
 columnRemarkS VARCHAR( 255 )
)
;
-----------------------------------------------

---
---

Internet: see also:

---

Database: Language: SQL: Overview: Can you give an overview of links 
about SQL?
http://www.faqts.com/knowledge_base/view.phtml/aid/32811/fid/54

----------------------------------------------------------------------