中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

上傳網(wǎng)站到google什么是百度權(quán)重

上傳網(wǎng)站到google,什么是百度權(quán)重,值得關(guān)注的網(wǎng)站,做網(wǎng)站一定要代碼嗎目錄 一、insert新增數(shù)據(jù) 二、復(fù)制建表 三、表結(jié)構(gòu)修改 四、查看表結(jié)構(gòu)、表數(shù)據(jù)處理 五、修改表數(shù)據(jù) 六、刪除語(yǔ)句 八、練習(xí)題 一、insert新增數(shù)據(jù) /* ---------- 一、DML 數(shù)據(jù)操作語(yǔ)言-------- -- 1、增加數(shù)據(jù) insert 語(yǔ)法:insert into 表名 (列1,列2,…

目錄

一、insert新增數(shù)據(jù)

二、復(fù)制建表

三、表結(jié)構(gòu)修改

四、查看表結(jié)構(gòu)、表數(shù)據(jù)處理

五、修改表數(shù)據(jù)

六、刪除語(yǔ)句

八、練習(xí)題


一、insert新增數(shù)據(jù)

/*
? ---------- 一、DML 數(shù)據(jù)操作語(yǔ)言--------
? -- 1、增加數(shù)據(jù) insert
? 語(yǔ)法:insert into 表名 (列1,列2,...) values (值1,值2,...);
? -- 要求:
? ? ?-- a、列和值必須一一對(duì)應(yīng)(位置、數(shù)據(jù)類型、約束)
? -- 注意:
? ? ?a、新增的數(shù)據(jù)需要提交commit才能保存到數(shù)據(jù)庫(kù)中
? ? ?b、撤銷新增加的數(shù)據(jù)需要回滾:rollback
? ? ?c、默認(rèn)值:default表示 ??
*/

-- 1、往 student1表中添加數(shù)據(jù)
insert into student1(sno,sname,ssex,sage,bir,clsno)values('001','李四','男',19,date'2023-8-19','2');
-- 1.1 對(duì)于時(shí)間的輸入,也可以用:to_date('日期字符串','日期格式y(tǒng)yyy-mm-dd')的方式如錄入-- 2、往全部列中添加數(shù)據(jù),可以省略列名不寫
insert into student1 values('002','王五','男',19,date'2023-8-19','2');-- 3、可以將表到處 導(dǎo)成標(biāo)準(zhǔn)的 insert into 語(yǔ)句 文檔
-- 工具 --> 導(dǎo)出表 窗口 --> 選擇 sql插入 指定文件名 --> 導(dǎo)出

二、復(fù)制建表

? ?------- 二、復(fù)制建表 -------
? ?create table 表名 as select 查詢語(yǔ)句 where 條件;
? ?復(fù)制建表:只復(fù)制表結(jié)構(gòu),不會(huì)復(fù)制數(shù)據(jù)
? ?不會(huì)復(fù)制主鍵約束、檢查約束、默認(rèn)值約束、唯一約束、外鍵約束
? ?會(huì)復(fù)制非空約束

-- 1、復(fù)制student1的表
create table student2 as select * from student1 where 1 = 2;

where用來(lái)控制是復(fù)制結(jié)構(gòu)或者把表數(shù)據(jù)都給復(fù)制過(guò)去

三、表結(jié)構(gòu)修改

? ? ? ?---------三、表結(jié)構(gòu)修改-----------
? ? ---1、菜單操作
? ? ? ? --左邊對(duì)象瀏覽器欄 點(diǎn)擊tables 找到對(duì)應(yīng)的表 -->右鍵 編輯 -->表結(jié)構(gòu) 窗口--> 列 選型 --> 增加列、修改列、刪除列
? ? ---2、sql語(yǔ)句操作
? ? ? ? -- 語(yǔ)法:alter table 表名

-- 1、增加列 add
-- 語(yǔ)法:alter table 表名 add(列1 數(shù)據(jù)類型,列2 數(shù)據(jù)類型);
alter table student001 add(a number,b varchar(20));-- 2、修改列 modify
-- 語(yǔ)法:alter table 表名 modify(列1 數(shù)據(jù)類型,列2 數(shù)據(jù)類型...)
-- 注意:其他數(shù)據(jù)類型可以修改為字符串,但是字符串不能修改為其他數(shù)據(jù)類型
alter table student001 modify(a varchar(20));-- 3、刪除列 drop 會(huì)刪除
-- 語(yǔ)法:alter table 表名 drop(列名1,列名2)
alter table student001 drop(a,b)
select * from student001;
-- 4、重命名列 rename column                                                                                                                                                        
-- 語(yǔ)法:alter table 表名 rename column 舊列名 to 新列名
-- 把sno改為stuId
alter table student001 rename column sno to stuid;

四、查看表結(jié)構(gòu)、表數(shù)據(jù)處理

? ? ? ---------五、查看表結(jié)構(gòu)、表數(shù)據(jù)處理
? ? ? ?--查看表結(jié)構(gòu)
? ? --左邊對(duì)象瀏覽器欄 點(diǎn)擊tables 找到對(duì)應(yīng)的表 -->右鍵 查看或編輯 -->表結(jié)構(gòu) ?-->列選項(xiàng)
? ? --在命令窗口 sql提示符輸入 desc 表名; ? 回車執(zhí)行

--1、清空表數(shù)據(jù) truncate table 表名;
truncate table student001;--2、批量復(fù)制數(shù)據(jù)
--insert into 表名 select 查詢語(yǔ)句;
insert into student_b select * from student_a;
commit;-- 3、對(duì)表重命名
-- rename 舊表名 to 新表名
rename student001 to student01;

五、修改表數(shù)據(jù)

? ? ? ?---------- 六、修改數(shù)據(jù)----------
? ? ? ?update語(yǔ)法:update 表名 set 列1 = 值2 where 條件
? ? ? ?注:如果不使用where,那么會(huì)修改整個(gè)表的數(shù)據(jù)

select * from student01;
-- 修改用戶的年齡是:系統(tǒng)時(shí)間 - sbirthday的時(shí)間
alter table student01 add (age number) ; -- 新增一個(gè)年齡列
select sysdate,to_char(sysdate,'yyyy') y from dual;-- 1、更新用戶的年齡:系統(tǒng)時(shí)間-出生
update student01 s set age=to_char(sysdate,'yyyy')-to_char(sbirthday,'yyyy') where sname = 'wang';
update student01 s set age=to_char(sysdate,'yyyy')-to_char(sbirthday,'yyyy');
commit;

六、刪除語(yǔ)句

? ? ? ?--------------刪除語(yǔ)句-----------
? ? ? ?truncate -- DDL 語(yǔ)句,刪除表中的數(shù)據(jù),效率高
? ? ? ?delete -- 刪除表中的數(shù)據(jù),逐行刪除,DML語(yǔ)句
? ? ? ?delete的語(yǔ)法:
? ? ? ?-- delete from 表名 where 條件;
? ? ? ?-- from可以省略,不要where條件會(huì)刪除整個(gè)表的數(shù)據(jù)

select * from student01;-- 1、刪除掉stuid為001的數(shù)據(jù)
delete student01 where stuid = 001;
rollback; -- 回滾-- 2、delete不帶where條件會(huì)清空整表數(shù)據(jù)
delete student01;
rollback; -- 回滾

八、練習(xí)題

 --練習(xí)題:--1、新建一個(gè)表emp2 要求emp2的結(jié)構(gòu)和emp一樣,同時(shí)要把emp的數(shù)據(jù)復(fù)制過(guò)去
create table emp2 as select * from emp;
select * from emp;
select * from emp2;--2、在emp2表中增加一行數(shù)據(jù)
insert into emp2 values(8000,'zs','CLERK',7782,date'2023-08-29',1500,0,10);
select * from emp2;--3、在emp2表中增加列bz和bz1,數(shù)據(jù)類型為字符串
alter table emp2 add(bz varchar(20),bz1 varchar2(30));
select * from emp2; --4、將emp中的所有記錄工資sal+1000,comm+1000插入到emp2中
-- 4.1 先查詢出emp表中的工資
select sal+1000,comm+1000 from emp;
select * from emp;
select * from emp2;
-- 合并子查詢
update emp2 set sal = (select sal+1000 from emp where empno = emp2.empno
),comm = (select nvl(comm,0)+1000 from emp where empno = emp2.empno
)
;
select * from emp2; 
rollback;--5、將emp2中empno為7654的comm獎(jiǎng)金修改為2000
update emp2 
set comm = 2000 
where empno = 7654;select * from emp2; --6、將emp2中員工姓名ename中包含ALL的獎(jiǎng)金修改為1600
update emp2 
set comm = 1600 
where
ename like '%ALL%'; -- 驗(yàn)證
select * from emp2 
where ename like '%ALL%'; --7、在emp2表中增加一個(gè)列age,將截止到當(dāng)前時(shí)間的每一個(gè)員工工作的年限更新到age列
alter table emp2 
add(age number)
; -- 新增ageselect * from emp2; update emp2 
set age = to_char(sysdate,'yyyy') - to_char(hiredate,'yyyy')
; -- 更新select e.*,rownum from emp2 e;

http://www.risenshineclean.com/news/7147.html

相關(guān)文章:

  • 代碼網(wǎng)站開發(fā)seo搜索引擎優(yōu)化是什么意思
  • 建設(shè)企業(yè)網(wǎng)站可行性分析百度一下進(jìn)入首頁(yè)
  • wordpress門戶網(wǎng)站模板下載互聯(lián)網(wǎng)營(yíng)銷做什么
  • 做自動(dòng)采集電影網(wǎng)站有什么處罰上海網(wǎng)絡(luò)推廣培訓(xùn)機(jī)構(gòu)
  • 專業(yè)做網(wǎng)站優(yōu)化個(gè)人網(wǎng)站模板
  • 茶網(wǎng)站開發(fā)的意義目的建站之星官方網(wǎng)站
  • 菏澤網(wǎng)站建設(shè)效果網(wǎng)址大全2345
  • 影響網(wǎng)站建設(shè)價(jià)格的因素有比較經(jīng)典的營(yíng)銷案例
  • 購(gòu)物網(wǎng)站 購(gòu)物車界面如何做html做一個(gè)簡(jiǎn)單的網(wǎng)頁(yè)
  • 1920的做網(wǎng)站做多大重慶seo推廣運(yùn)營(yíng)
  • 網(wǎng)站服務(wù)器數(shù)據(jù)庫(kù)百度推廣找誰(shuí)做靠譜
  • wordpress仿今日主題網(wǎng)站優(yōu)化包括哪些
  • 怎么進(jìn)入wordpress后臺(tái)紹興網(wǎng)站快速排名優(yōu)化
  • cmseasy做網(wǎng)站簡(jiǎn)單嗎營(yíng)銷策劃培訓(xùn)
  • 商丘市網(wǎng)站建設(shè)推廣福建企業(yè)seo推廣
  • 青島網(wǎng)站建設(shè)和優(yōu)化網(wǎng)絡(luò)營(yíng)銷師有前途嗎
  • 網(wǎng)站建設(shè) 石家莊網(wǎng)站建設(shè)哪家公司好
  • 廣告公司做網(wǎng)站寧波seo網(wǎng)絡(luò)推廣代理公司
  • 嘉興 網(wǎng)站制作網(wǎng)站seo分析案例
  • 東莞南城網(wǎng)站開發(fā)公司關(guān)鍵詞的優(yōu)化和推廣
  • 哪個(gè)網(wǎng)站做任務(wù)賺錢多org域名注冊(cè)
  • 怎樣做國(guó)外網(wǎng)站推廣東莞網(wǎng)站建設(shè)推廣公司
  • 權(quán)威的合肥網(wǎng)站建設(shè)網(wǎng)站運(yùn)營(yíng)指標(biāo)
  • 阿里巴巴網(wǎng)站維護(hù)怎么做關(guān)鍵詞seo排名公司
  • 網(wǎng)站布局結(jié)構(gòu)主要分為汕頭seo收費(fèi)
  • 連江建設(shè)局網(wǎng)站推廣方案策略怎么寫
  • 天河網(wǎng)站 建設(shè)seo信科分公司南寧seo公司
  • 怎么做彩票游戲網(wǎng)站四川百度推廣排名查詢
  • 2014年沈陽(yáng)建設(shè)銀行網(wǎng)站怎么在百度做網(wǎng)站推廣
  • 網(wǎng)站專業(yè)建設(shè)公司免費(fèi)引流app下載