CREATE TABLE PRodUCts ( PROD_ID NUMBER(4), PROD_NAME VAECHAR2(20), STOCK_QTY NUMBER(5,3) ); |
SQL>CREATE TABLE emp AS SELECT * FROM employee TABLE CREATED SQL> CREATE TABLE Y AS SELECT * FROM X WHERE no=2 |
ALTER TABLE [schema.] table_name ADD column_definition |
ALTER TABLE orders ADD order_date DATE; TABLE ALTER |
ALTER TABLE [schema.] table_name MODIFY column_name new_attributes; |
ALTER TABLE orders MODITY (quantity number(10,3),status varchar2(15)); |
ALTER TABLE [schema.] table_name DROP {COLUM column_names (column_names)}[CASCADE CONSTRAINS] |
ALTER TABLE [schema.] table_name SET UNUSED {COLUM column_names (column_names)}[CASCADE CONSTRAINS] |
ALTER TABLE [schema.] table_name DROP {UNUSED COLUM COLUMN CONTINUE} |
DROP TABLE [schema.] table_name [CASCADE CONSTRAINTS] |
RENAME old_name TO new_name; |
SQL> RENAME orders TO purchase_orders; TABLE RENAMED |
TRUNCATE {TABLECLUSTER} [schema.] name {DROPREUSE STORAGE} |
SQL> TRUNCATE TABLE t1; TABLE truncate. |
SQL> CREATE VIEW TOP_EMP AS SELECT empno EMPLOYEE_ID,ename EMPLOYEE_NAME,salary FROM emp WHERE salary >2000 |
SQL> CREATE VIEW TOP_EMP (EMPLOYEE_ID,EMPLOYEE_NAME,SALARY) AS SELECT empno ,ename ,salary FROM emp WHERE salary >2000 |
CREATE FORCE VIEW ORDER_STATUS AS SELECT * FROM PURCHASE_ORDERS WHERE STATUS='APPPOVE'; SQL>/ warning :View create with compilation errors |
DROP VIEW TOP_EMP; |
新闻热点
疑难解答