Oracle-sql System Learning

Source: Internet
Author: User

Create schema

This statement does not actually create a schema that automatically creates a schema when the user is created, which allows you to populate your schema with tables and views and authorization for those objects, without multiple transactions, and only one transaction, and any statement with an error will roll back all statements.

Create multiple tables and views and objects at once. There is only one transaction, not many times, which is the focus

CREATE SCHEMA AUTHORIZATIONOECREATE TABLEnew_product (ColorVARCHAR2(Ten)PRIMARY KEY, quantity Number)CREATE VIEWNew_product_view as SELECTColor, quantity fromNew_productWHEREColor= 'RED'GRANT Select  onNew_product_view tohr

CREATE table

CREATE TABLE AA

--relational tables, or relationship properties

(Name VARCHAR2 (5), age number (3))

--relational tables, or as subquery

As select * FROM A1;

--object_type,

Of ...

--xml_type

Of ...

Specify global temporary to indicate that the table is a temporary table, its definition is visible to all sessions, the data can only be inserted into the table which session is visible, the other session is not visible

Create TableA4 as Select *  fromAA;Create TableA5 (col1varchar2(3)default 2  not NULL,  --col2 as (sysdate),Col3 Number(2)Unique);descA5;Drop TableA5 purge;show recyclebin;purge recyclebin;Select *  fromuser_constraints;

Oracle-sql System Learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.