Ⅰ 数据库 创建表的命令是什么
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