postgresql.txt(国外英文资料).doc

  1. 1、本文档共16页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档