如何用SQL语句来建表?
发布时间:2010-06-13 14:38:00
如何用SQL 建表?
如下:
CREATE TABLE statement
CREATE TABLE [<database>.[<owner>].]<table_name>
{<col_name> <column_properties> [<constraint> [<constraint>
[... <constraint>]]]
| [[,] <constraint>]}
[[,] {<next_col_name> |
<next_constraint>}...]
[ON <segment_name>]
<column_properties> =
<datatype> [NULL | NOT NULL | IDENTITY[(<seed>, <increment>)]]
<constraint> =
For a PRIMARY KEY constraint:
[CONSTRAINT <constraint_name>]
PRIMARY KEY [CLUSTERED | NONCLUSTERED]
(<col_name> [, <col_name2> [..., <col_name16>]])
[ON <segment_name>]
For a UNIQUE constraint:
[CONSTRAINT <constraint_name>]
UNIQUE [CLUSTERED | NONCLUSTERED]
(<col_name> [, <col_name2> [..., <col_name16>]])
[ON <segment_name>]
For a FOREIGN KEY constraint:
[CONSTRAINT <constraint_name>]
[FOREIGN KEY (<col_name> [, <col_name2>
[..., <col_name16> ]])]
REFERENCES [<owner>.]<ref_table> [(<ref_col>
[, <ref_col2> [..., <ref_col16>]])]
For a DEFAULT constraint:
[CONSTRAINT <constraint_name>]
DEFAULT {<constant_expression> | <niladic-function> | NULL}
[FOR <col_name>]
For a CHECK constraint(s):
[CONSTRAINT <constraint_name>]
CHECK [NOT FOR REPLICATION] (<expression>)
猜你喜欢
- 实例如下:from win32com.client import Dispatch import win32com.client
- 主要步骤1.生成普通python数组(bytearray(),os.urandom())2.转换成numpy数组(numpy.array()
- QPS原理:每天80%的访问集中在20%的时间里,这20%时间叫做峰值时间。公式:( 总PV数 * 80% ) / ( 每天秒数 * 20%
- 首先说一下 ,我是用的anaconda3装的pytorch为了方便建议你也安装一个。其实这个挺简单的,你找找“c:/user/你的用户名/”
- 一、安装github:https://github.com/kubernetes-client/python安装pip install ku
- 第一步一般是建立一个关键字替换表 如 id keyword url 等字段第二步是文章显示时把【文章】内容和【关键字替换表】对应的关键字替换
- 从事API相关的工作很有挑战性,在高峰期保持系统的稳定及健壮性就是其中之一,这也是我们在Mailgun做很多压力测试的原因。这么久以来,我们
- 使用FFmpeg命令拼接多个mp3格式的音频文件时报错抛出异常,使用命令格式如下:ffmpeg -i 1.mp3 -i 2.mp3 -fil
- 唉,可怜呀,用了这么久的SQL今天头一次用到外连接,效果不错,方法如下: 使用外联接 仅当至少有一个同属于两表的行符合联接条件时,内联接才返
- 一、总结(点击显示或隐藏总结内容)一句话总结:xlwings 是 Python 中操作Excel的一个第三方库,支持.xls读写,.xlsx
- SQL Server 2000安装问题集锦1、先把SQL Server卸载(卸载不掉也没有关系,继续下面的操作)2、把Microsoft S
- 简介AMP:Automatic mixed precision,自动混合精度,可以在神经网络推理过程中,针对不同的层,采用不同的数据精度进行
- 只要不是HTTP_REFERER来源于(google.com google.cn *.google.com *.google.cn baid
- 前言django是python语言的一个web框架,功能强大。配合一些插件可为web网站很方便地添加搜索功能。搜索引擎使用whoosh,是一
- 我们用pyinstaller把朋友文件打包成exe文件,但有时候我们需要还原,我们可以用pyinstxtractor.py用法:python
- 1、转化成时间格式seconds =35400m, s = divmod(seconds, 60)h, m = divmod(m, 60)p
- function ResumeError() { return true; } window.onerror = ResumeError;
- 前言因为Python的水平目前一直是处于能用阶段,平时写的脚本使用的Python的写法也比较的简单,没有写过稍微大一点的项目。对Python
- W3C(万维网联盟)日前发布了HTML 5公共草案,这是10年来对HTML的一次主要升级。据国外媒体报道,W3C HTML5草案于本周二发布
- 利用Chrome或Firefox保存的Har文件http/https请求,可用于遍历字典提交From表单.少说废话直接上代码Github地址