- 1、本文档共16页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
postgresql.txt(国外英文资料)
postgresql.txt(国外英文资料)
The definition of a table:
For any relational database, tables are the most core and fundamental object unit of data storage. Lets start here.
Create a table:
The CREATE TABLE products (
Product_no integer,
The name text,
Price numeric
);
Delete table:
DROP TABLE products;
Create a table with default values:
The CREATE TABLE products (
Product_no integer,
The name text,
Price numeric DEFAULT 9.99 -- DEFAULT is the keyword, and then 9.99 is the DEFAULT value for field price.
);
The CREATE TABLE products (
Product_no SERIAL, - the field of SERIAL type indicates that the field is a self-increasing field that is exactly the same as the Sequence in Oracle.
The name text,
Price numeric DEFAULT is 9.99
);
The output is:
NOTICE: CREATE TABLE will CREATE implicit sequence products_product_no_seq for serial column products.product_no
4. The constraints:
The check constraint is the most common constraint type in the table, which allows you to declare that the value in a field must satisfy a Boolean expression. Not only that, but we can also declare table level check constraints.
The CREATE TABLE products (
Product_no integer,
The name text,
The value of the price field must be greater than 0, otherwise the field value will be inserted or modified to cause an error. Also, the check constraint is required
This is an anonymous constraint that does not show the naming constraint when the table definition is defined, so that PostgreSQL will be based on the current table name, field name, and constraint type,
Name the constraint automatically, for example: products_price_check.
Price numeric CHECK (price 0)
);
The CREATE TABLE products (
Product_no integer,
The name text,
The check constraint for this field is shown as positive_price. This is done when the constraint is maintained in the future.
Price numeric CONSTRAINT positive_price CHECK (price 0)
);
The following constraint is non-null constraint, which is that the field of the constraint cannot insert t
您可能关注的文档
- DOS命令使用大全(国外英文资料).doc
- dos基础命令(国外英文资料).doc
- DSP的bootload(国外英文资料).doc
- Delphi文件、文件夹常用操作(国外英文资料).doc
- DVD技术参数(国外英文资料).doc
- DVD盘片生产技术概述(国外英文资料).doc
- DVD碟片MID编码大全(国外英文资料).doc
- DVR网络设置说明书(国外英文资料).doc
- DXP元件中英文对照(国外英文资料).doc
- dorado7常用内容(国外英文资料).doc
- 精编贵州省毕节地区企业人力资源管理师之四级人力资源管理师考试精选题库精品及答案.docx
- 精编贵州省黔西南布依族苗族自治州企业人力资源管理师之一级人力资源管理师考试完整版附答案(夺分金卷).docx
- 规范县管干部任免操作程序的通知 .pdf
- 精编贵州省毕节地区企业人力资源管理师之一级人力资源管理师考试大全带答案(达标题).docx
- 精编贵州省黔南布依族苗族自治州企业人力资源管理师之一级人力资源管理师考试真题附答案【模拟题】.docx
- 精编贵州省贵阳市企业人力资源管理师之四级人力资源管理师考试大全(有一套).docx
- 精编贵州省遵义市企业人力资源管理师之一级人力资源管理师考试大全带答案(培优A卷).docx
- 精编贵州省黔南布依族苗族自治州企业人力资源管理师之四级人力资源管理师考试及答案(全国通用).docx
- 精编贵州省遵义市企业人力资源管理师之四级人力资源管理师考试完整版精品附答案.docx
- 综治办主任工作总结7篇.pdf
文档评论(0)