Chapter 3. SQL Server数据库、表的基本操作(insert插入、update更新、delete、truncate删除语句) --1.创建一个数据库 create database MyDatabaseOne --2.删除数据库 drop database MyDatabaseOne --3.创建数据库的时候设置一些参数选项 create database My
SQL更新数据1、插入数据——insert操作 语法格式如下:insertinto表名 (列名1,列名2……,列名n)values(值1,值2……,值n); 在insert操作中,列名列表中的各列需要以逗号分隔;而值列表指定各列的值,列名与值需要一一对应。 如果insert语句所指定的列名列表包含了表中的所有列,那么可以将列名列表省略。createtables...
SQL> insert into a_1 values(1);1 row created.SQL> insert into b_1 values(1,1);1 row created.SQL> commit;Commit complete.SQL> truncate table b_1;Table truncated.SQL> truncate table a_1;truncate table a_1 *ERROR at line 1:ORA-02266: unique/primary keys in table referenced by enab...
Enter valueforfiles:old30:--1.Temp Restore and Recover tablespace&files---new30:--1.Temp Restore and Recover tablespace---Package created.Warning:Package Body createdwithcompilation errors.SQL>@/home/oracle/FY_Recover_Data.pck--删除“&”符号后导入成功 Package created.Package body created. STEP3:...
SQL>--创建随机数据插入存储过程,其中col1列单调递增SQL>create or replace procedure p_insert_test01 IS2v_col1 NUMBER;3BEGIN4FOR i IN 1..10000 LOOP5select seq01.nextval INTO v_col1 from dual;6insert into test01(col1,col2,col3,col4,col5)7v...
它们是Delete/Insert、Truncate/Insert和Drop/Insert。从性能的角度来看,其中的Delete/Create/Insert不是您...
SQL> truncate table test01; Table truncated 1. 2. STEP4:修改存储过程,酶促插入100条数据, SQL> --创建随机数据插入存储过程,其中col1列单调递增 SQL> create or replace procedure p_insert_test01 IS 2 v_col1 NUMBER; 3 BEGIN 4 FOR i IN 1..100 LOOP 5 select seq01.nextval INTO v_col1 ...
interval_salevalues(2,2,to_date('2003-01-01','yyyy-mm-dd'));1row created.SQL>insert into interval_salevalues(3,3,to_date('2004-01-01','yyyy-mm-dd'));1row created.SQL>insert into interval_salevalues(4,4,to_date('2005-01-01','yyyy-mm-dd'));1row created.SQL>commit;Commit ...
SQL>insertintointerval_salevalues(4,4, to_date('2005-01-01','yyyy-mm-dd'));1row created. SQL> commit;Commit complete. 创建全局索引, SQL>create index idx_01oninterval_sale(cust_id); Index created. SQL>selecttable_name, index_name, p...
最后恢复成功,这里由于L1、L2没有恢复,所以insert会有问题,但是可以通过CTAS重建表完全恢复。 SYS@TEST(test):1>select count(*) from test.truncate_table; COUNT(*) --- 113426 SYS@TEST(test):1>insert into test.truncate_table select * from dba_objects; insert into...