Ⅰ 資料庫 創建表的命令是什麼
CREATE TABLE
[ database_name.[ owner ] .| owner.] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > ::= [ CONSTRAINT constraint_name ] }
| [ { PRIMARY KEY | UNIQUE } [ ,...n ]
)
[ ON { filegroup | DEFAULT } ]
[ TEXTIMAGE_ON { filegroup | DEFAULT } ]
< column_definition > ::= { column_name data_type }
[ COLLATE < collation_name > ]
[ [ DEFAULT constant_expression ]
| [ IDENTITY [ ( seed , increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL]
[ < column_constraint > ] [ ...n ]
< column_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ NULL | NOT NULL ]
| [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
[ WITH FILLFACTOR = fillfactor ]
[ON {filegroup | DEFAULT} ] ]
]
| [ [ FOREIGN KEY ]
REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
]
| CHECK [ NOT FOR REPLICATION ]
( logical_expression )
}
< table_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
{ ( column [ ASC | DESC ] [ ,...n ] ) }
[ WITH FILLFACTOR = fillfactor ]
[ ON { filegroup | DEFAULT } ]
]
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
| CHECK [ NOT FOR REPLICATION ]
( search_conditions )
}
Ⅱ visual foxpro 創建表的命令
create form是創建表單(窗口)命令
create table是創資料庫的表,但是後面要跟參數,加上相應表的欄位名字、類型與長度
create命令是創建表命令
Ⅲ MySQL創建資料庫的命令、創建表的命令、插入語句的命令
1.創建資料庫
CREATE DATABASE IF NOT EXISTS RUNOOB DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
#如果資料庫不存在則創建,存在則不創建
#創建RUNOOB資料庫,設定編碼為utf8
2.刪除資料庫
drop database RUNOOB;
3.選擇資料庫
use RUNOOB;
#使用資料庫RUNOOB
4.數據類型
5.創建數據表
CREATE TABLE table_name (column_name column_type , column_name2 column_type2);
<etc>
CREATE TABLE IF NOT EXISTS `runoob_tbl`(
`runoob_id` INT UNSIGNED AUTO_INCREMENT,
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` DATE,
PRIMARY KEY ( `runoob_id` ) #主鍵
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
來自 <http://www.runoob.com/mysql/mysql-create-tables.html>
</etc>
# 表明、欄位名字外面的符號是反引號,為了區分mysql關鍵字和普通字元
6.刪數據表
DROP TABLE table_name;
#刪除表內數據
delete from 表明 where runoob_title = 「exam」;
#清除表內數據,保留表結構
truncate table 表名;
#刪除後立刻釋放磁碟空間
optimize table 表名;
7.增 插入數據到表
INSERT INTO table_name ( field1,field2,…) VALUES ( value1,value2,"value"… );
#字元類型,value需要使用單/雙引號。
Ⅳ 資料庫中創建數據表的命令是啥
create table 表名(
列名 列的類型(長度) 約束,
列名2 列的類型(長度) 約束
);
Ⅳ MYsql資料庫怎樣創建表
進到mysql 客戶端,或者使用phpmyadmin,執行如下命令:
DROP TABLE IF EXISTS `tblTable1`;
CREATE TABLE `tblTable1` (
`iNo` int(11) NOT NULL auto_increment,
`strFieldName` varchar(255) NOT NULL,
`intOrder` tinyint(4) default 0,
PRIMARY KEY (`iNo`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='數據表1';
Ⅵ 建立表的sql命令是什麼
create table 表名(欄位名1 類型,欄位名2 類型…);
create table 表名1 as select *from 表2 where 1=2