Oracle基礎

来源:https://www.cnblogs.com/TD1900/archive/2019/10/28/11755152.html
-Advertisement-
Play Games

Oracle am.2019/10/22 C:\app\Administrator\product C:\app\Administrator\oradata C:\app\Administrator\oradata\orcl XX.CTL 控制文件 XX.DBF 數據文件 XX.LOG 日誌文件 j ...


Oracle

am.2019/10/22
C:\app\Administrator\product
C:\app\Administrator\oradata
C:\app\Administrator\oradata\orcl
XX.CTL 控制文件
XX.DBF 數據文件
XX.LOG 日誌文件

jdk路徑
C:\app\Administrator\product\11.1.0\db_1\jdk\bin

資料庫文件預設存放路徑
C:\app\Administrator\product\11.1.0\db_1\database

(mysql -u root -p)
cmd dos命令行執行
sqlplus 用戶名/密碼
sqlplus system/123

連接Oracle伺服器
conn 用戶名/密碼 as 連接身份@伺服器連接字元串

-- 創建表空間
create tablespace 表空間名 datafile '數據文件名' size 大小;

create tablespace T128 datafile 'T128.dbf' size 10M
AUTOEXTEND ON;

create tablespace T128 datafile 'C:\T128\T128.dbf' size 10M

/
autoextend on 自動擴展表空間
/

--刪除非空表空間
drop tablespace 表空間名 including contents;

-- 查看表空間名字情況
select tablespace_name from dba_tablespaces;

-- 查看表結構
desc[ribe] 表名;

desc dba_tablespaces;

--創建用戶使用表空間
create user 用戶名 identified by 密碼 default tablespace 表空間;

create user T128 identified by 123 default tablespace T128;

-- 授權
grant 許可權 to 用戶名;

grant dba to t128; --管理員許可權
grant connect to t128; --連接權
session 會話權

use 資料庫名(mysql)
-- 指定用戶登錄
connect 用戶名/密碼;

--創建表
varchar2
int
char
date

--創建表auto_test設置id的值為自增長
create table auto_test(
id int not null auto_increment primary key,
name varchar2(10)
);

--序列sequence
drop sequence seq_abc;

create sequence seq_abc
start with 1 maxvalue 99999;

select seq_abc.nextval
select seq_abc.currval from dual;

select to_char(sysdate,'yyyymmdd')||empno||seq_abc.nextval,empno,ename from emp;

--課後練習

--創建一個員工管理系統(表空間)
create tablespace emp datafile 'emp.dbf' size 10M autoextend on;

--創建一個用戶使用該表空間
create user yc identified by 123 default tablespace emp;

--用system用戶授權DBA給以上用戶
grant dba to yc;

--連接該用戶
conn yc/123;

--為員工管理系統建如下表:員工信息表、部門表、員工考勤表
create table emp_info (
no int primary key,
name varchar2(10) not null,
sex char(2),
bir date,
tel number(11,0),
indate date
)

create table dept(
no int primary key,
name varchar2(20)
)

create table kq(
no int,
name varchar2(10),
dept varchar2(20),
clockin date,
clockout date,
constraint fk_kq_emp_no foreign key(no) references emp_info(no)
)

--自習設計以上表(提供資料庫設計文檔)

自行設計
ER圖

-- 修改表結構之添加約束
alter table emp_info add constraint pk_emp primary key(no);

數據類型

--date 日期和時間類型
select sysdate from dual:
15-4月-2000

to_char(參數) --將參數轉換成為字元串
to_date(參數) --將字元串轉換成為日期型格式

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from emp_info;

--拷貝表
create table 表名 as select 欄位 from 表名2;

--拷貝表結構
create table 表名 as select 欄位 from 表名2 where 不成立條件;

--事務create/drop/truncate
insert/update/delete
提交/回退

-- || 連接符
select 'abc'||name from emp_info;
select '員工編號:'||no||'員工姓名:'||name from emp_info;

--連接 concat()
select concat('hello','world') from dual;

--檢查約束
create table t1(id int check(id>=1 and id<=100),name char(10));

check

日期向前推2月
select add_months(sysdate,-2) from dual;

日期向後推2天
select sysdate+2 from dual;

向後推2個小時
select sysdate+2/24 from dual;

select last_day(sysdate) from dual;

--四捨五入
select round(sysdate,'mm') from dual;

--離當前最近的下一個禮拜二
select next_day(sysdate,'星期二') from dual;

查詢跟張三來自同一個地方的學生姓名

select a.name, a.address from stu a,stu b
where a.address= b.address
and b.name='張三';

字元串截斷:substr()
字元串長度:length()
內容替換:replace()

select substr('hello',1,3),length('hello'),replace('hello','l','x') from dual;

日期-數字=日期
日期+數字=日期
日期-日期=數字(天數)

--當前日期
select sysdate from fual;

--求出星期數:當前日期數-生日日期=天數 /7=星期數
select no,name,round((sysdate-bir)/7) from emp;

作業:

--創建一個部門表
create table dept(
deptid int primary key,
deptname varchar2(20)
);

--創建一個員工信息表
create table emp(
empid int primary key check(empid>0),
deptid int not null,
name varchar2(10),
sex varchar(4) check(sex in ('男','女','未知')),
bir date,
height numeric(3,2) check( height>0 and height<3 ),
tel numeric(11) check(tel like '1%' and length(tel)=11 ) ,
gz numeric(7,2) check(gz between 5000 and 50000),
constraint fk_emp_dept_deptid foreign key(deptid) references dept(deptid)
);

--創建一個考勤表
create table kq(
empid int,
ontime date,
offtime date,
constraint fk_kq_emp_empid foreign key(empid) references emp(empid)
);

insert into dept(deptid) values(1);
insert into dept(deptid) values(2);
insert into dept(deptid) values(3);
update dept set deptname='開發部' where deptid=1;
update dept set deptname='測試部' where deptid=2;
update dept set deptname='運營部' where deptid=3;

commit

select * from dept;

insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(1,1,'西沉','男','15-4月-1998',1.80,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(2,1,'路飛','男','05-5月-2000',1.76,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(3,1,'索隆','男','11-11月-1998',1.83,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(4,2,'娜美','女','03-7月-1999',1.78,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(5,2,'喬巴','男','24-12月-2005',1.58,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(6,2,'山治','男','01-6月-1998',1.82,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(7,3,'烏索普','男','1-4月-2000',1.75,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(8,3,'弗蘭奇','男','07-8月-1979',1.90,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(9,3,'布魯克','男','12-12月-1937',1.92,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(10,1,'羅賓','女','04-5月-1989',1.81,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(11,2,'小櫻','女','03-3月-2000',1.76,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(12,3,'鳴人','男','05-9月-2000',1.56,'18692391446',50000);

commit

select * from emp;

insert into kq(empid,ontime,offtime) values(1,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(2,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(3,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(4,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(5,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(6,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(7,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(8,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(9,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));

commit

select * from kq;

--取年份
select to_char(sysdate,'yyyy') from dual;

--查詢1999年後出生且性別為女的員工信息並按出生年份降序排序
select * from emp
where to_char(bir,'yyyy')>1999
and sex='女'
order by to_char(bir,'yyyy') desc;

select * from emp
where extract(year from bir)>1999
and sex='女'
order by extract(year from bir) desc;

-- 取出給定範圍的月數
select months_between(sysdate, date'2019-11-24') from emp;

--計算年齡
select floor(months_between(sysdate,bir)/12) from emp;

select floor((sysdate-bir)/365) from emp;

select to_char(sysdate,'yyyy')-to_char(bir,'yyyy') from emp;

select extract(year from sysdate)-extract(year from bir) from emp;

--查詢年齡21歲以上員工信息並按員工編號和年齡降序排序
select * from emp
where floor(MONTHS_BETWEEN(sysdate,bir)/12)>21
order by empid,floor(MONTHS_BETWEEN(sysdate,bir)/12) desc;

select * from emp
where to_char(sysdate,'yyyy')-to_char(bir,'yyyy')>21
order by empid,to_char(sysdate,'yyyy')-to_char(bir,'yyyy') desc;

select * from emp
where floor((sysdate-bir)/365) >21
order by empid,floor((sysdate-bir)/365) desc;

-- ||字元串連接符
select '員工編號是:'||empid||',姓名是:'||name from emp;

--查詢每個年齡員工的數量並按數量排序:年齡、數量
select floor((sysdate-bir)/366) as 年齡,count(*) as 數量 from emp
group by floor((sysdate-bir)/366)
order by 年齡,數量;

--查詢工資最高的員工的員工編號、姓名、性別、年齡、工資
select empid,name,sex,floor((sysdate-bir)/365) from emp
where gz=(select max(gz) from emp);

--查詢10月份各部門的遲到人數在2人以上的信息,並按人數降序排序:部門名稱、遲到人數
select c.deptname as 部門名稱,count(distinct a.empid) as 遲到人數 from kq a,emp b,dept c
where a.empid=b.empid and b.deptid=c.deptid
and to_char(a.ontime,'hh24:mi')>'08:20' and to_char(a.ontime,'mm')=10
group by c.deptname
having count(distinct a.empid)>=2
order by 遲到人數 desc;

--行號
select name,bir,rownum from emp where rownum<=5;

--排名
select row_number() over(order by sex desc),name,bir from emp;

-- 按身高排名
select empid,name,height,row_number() over(order by height) 名次 from emp;

--身高一樣,名次相同
select empid,name,height,rank() over(order by height) 名次 from emp;

--身高一樣,名次相同,不跳號
select empid,name,height,dense_rank() over(order by height) 名次 from emp;

--merge into

--樹形結構查詢
start with..connect by

select * from scott.emp start with empno=7369 connect by prior mgr=empno;

.人員表中增加上級編號欄位,記錄該員工的上級員工編號

.對人員表造樹形結構數據,將數據更新為只有一個人的上級ID為空,
所有人的上級ID均為其他人,呈現出父子孫的多層關係數據
.將以上數據按照父、子、孫的先後關係查詢呈現出來

.將人員表第一層員工的基本工資漲為20000,第二層漲1000,
第3層如果原來大於6000則增加500,否則增加400,其它層次一律漲200

select ename,sal,
decode(level,
1,20000,
2,sal+1000,
3,decode(sign(sal-6000),1,sal+500,sal+400),sal+200) x
from emp start with empno=7839 connect by prior empno=mgr;

select empno,empname,sal,level,
(case
when level=1 then 20000
when level=2 then sal+1000
when level=3 and sal>=6000 then sal+500
when level=3 and sal<6000 then sal+400
else sal+200
end)x
from emp start with empno=7839 connect by prior empno=mgr;

--多表關聯更新
update emp a set sal=
(
select(case
when level=1 then 20000
when level=2 then b.sal+1000
when level=3 and b.sal>=6000 then b.sal+500
when level=3 and b.sal<6000 then b.sal+400
else b.sal+200
end)x from emp b where a.empno=b.empno
start with b.empno=7839 connect by prior b.empno=b.mgr
);

--創建一個部門表
create table dept(
deptid int primary key,
deptname varchar2(20)
);

--創建一個員工信息表
create table emp(
empid int primary key check(empid>0),
deptid int not null,
name varchar2(10),
sex varchar(4) check(sex in ('男','女','未知')),
bir date,
height numeric(3,2) check( height>0 and height<3 ),
tel numeric(11) check(tel like '1%' and length(tel)=11 ) ,
gz numeric(7,2) check(gz between 5000 and 50000),
constraint fk_emp_dept_deptid foreign key(deptid) references dept(deptid)
);

--創建一個考勤表
create table kq(
empid int,
ontime date,
offtime date,
constraint fk_kq_emp_empid foreign key(empid) references emp(empid)
);

insert into dept(deptid) values(1);
insert into dept(deptid) values(2);
insert into dept(deptid) values(3);
update dept set deptname='開發部' where deptid=1;
update dept set deptname='測試部' where deptid=2;
update dept set deptname='運營部' where deptid=3;

commit

select * from dept;

insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(1,1,'西沉','男','15-4月-1998',1.58,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(2,1,'路飛','男','05-5月-2000',1.76,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(3,1,'索隆','男','11-11月-1998',1.83,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(4,2,'娜美','女','03-7月-1999',1.78,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(5,2,'喬巴','男','24-12月-2005',1.58,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(6,2,'山治','男','01-6月-1998',1.82,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(7,3,'烏索普','男','1-4月-2000',1.75,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(8,3,'弗蘭奇','男','07-8月-1979',1.90,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(9,3,'布魯克','男','12-12月-1937',1.92,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(10,1,'羅賓','女','04-5月-1989',1.81,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(11,2,'小櫻','女','03-3月-2000',1.76,'18692391446',50000);
insert into emp(empid,deptid,name,sex,bir,height,tel,gz) values(12,3,'鳴人','男','05-9月-2000',1.56,'18692391446',50000);

commit

select * from emp;

insert into kq(empid,ontime,offtime) values(1,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(2,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(3,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(4,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(5,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(6,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(7,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(8,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));
insert into kq(empid,ontime,offtime) values(9,to_date('2019-10-24 8:30:00','yyyy-mm-dd hh24:mi:ss'),to_date('2019-10-24 21:00:00','yyyy-mm-dd hh24:mi:ss'));

commit

select * from kq;

--取年份
select to_char(sysdate,'yyyy') from dual;

--查詢1999年後出生且性別為女的員工信息並按出生年份降序排序
select * from emp
where to_char(bir,'yyyy')>1999
and sex='女'
order by to_char(bir,'yyyy') desc;

select * from emp
where extract(year from bir)>1999
and sex='女'
order by extract(year from bir) desc;

-- 取出給定範圍的月數
select months_between(sysdate, date'2019-11-24') from emp;

--計算年齡
select floor(months_between(sysdate,bir)/12) from emp;

select floor((sysdate-bir)/365) from emp;

select to_char(sysdate,'yyyy')-to_char(bir,'yyyy') from emp

select extract(year from sysdate)-extract(year from bir) from emp

--查詢年齡21歲以上員工信息並按員工編號和年齡降序排序
select * from emp
where floor(MONTHS_BETWEEN(sysdate,bir)/12)>21
order by empid,floor(MONTHS_BETWEEN(sysdate,bir)/12) desc;

select * from emp
where to_char(sysdate,'yyyy')-to_char(bir,'yyyy')>21
order by empid,to_char(sysdate,'yyyy')-to_char(bir,'yyyy') desc;

select * from emp
where floor((sysdate-bir)/365) >21
order by empid,floor((sysdate-bir)/365) desc;

-- ||字元串連接符
select '員工編號是:'||empid||',姓名是:'||name from emp;

--查詢每個年齡員工的數量並按數量排序:年齡、數量
select floor((sysdate-bir)/366) as 年齡,count(*) as 數量 from emp
group by floor((sysdate-bir)/366)
order by 年齡,數量;

--查詢工資最高的員工的員工編號、姓名、性別、年齡、工資
select empid,name,sex,floor((sysdate-bir)/365) from emp
where gz=(select max(gz) from emp);

--查詢10月份各部門的遲到人數在2人以上的信息,並按人數降序排序:部門名稱、遲到人數
select c.deptname as 部門名稱,count(distinct a.empid) as 遲到人數 from kq a,emp b,dept c
where a.empid=b.empid and b.deptid=c.deptid
and to_char(a.ontime,'hh24:mi')>'08:20' and to_char(a.ontime,'mm')=10
group by c.deptname
having count(distinct a.empid)>=2
order by 遲到人數 desc;

select name 姓名 from emp;

--行號
select name,bir,rownum from emp where rownum<=5;

--排名
select row_number() over(order by sex desc),name,bir from emp;

-- 按身高排名
select empid,name,height,row_number() over(order by height) 名次 from emp;

--身高一樣,名次相同
select empid,name,height,rank() over(order by height) 名次 from emp;

--身高一樣,名次相同,不跳號
select empid,name,height,dense_rank() over(order by height) 名次 from emp;


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 伺服器類型:linux =》centos 7.X以上版本 常用命令使用紫色加粗標明 1.安裝yum-util(為配置docker安裝時使用阿裡鏡像做準備):yum install -y yum-utils device-mapper-persistent-data lvm2 2.配置docker安裝 ...
  • 在httprunner運行報錯問題 代碼書寫: 當此段yml文件運行時會出現一下錯誤 在出現此錯誤時,為base_url的格式出現錯誤,只需修改base_url的位置 修改位置後運行yml文件 運行成功 ...
  • vmware workstation 虛擬機官方下載路徑:https://www.vmware.com/cn/products/workstation pro/workstation pro evaluation.html CentOS 官方下載路徑:https://www.centos.org/d ...
  • 回到目錄 在共集組態中,“輸入埠”和“輸出埠”共用BJT的集電極端子(故稱為“共集”),形成一個雙埠網路,如下圖所示: 圖3-7.01 由於共集組態的電路接法和共射組態的電路接法類似,只是輸出端從發射極取出而已,所以共射組態電路的各種輸入輸出特性和分析結果可以直接用到共集組態上,這裡就不再贅述 ...
  • [oot@cent65 bin]# service mysqld startStarting MySQL.2019-10-28T15:56:47.786960Z mysqld_safe error: log-error set to '/data/log/mysqld.log', however f ...
  • [TOC] 資料庫是什麼 資料庫:存儲數據的倉庫 為什麼使用資料庫 之前用excel來進行管理數據,有諸多問題: 電子錶格只能處理有限的數據列和數據行,對於數百萬玩、數千萬等巨大的數據列很難有效地處理 電子錶格無法提供安全、方便地許可權管理和控制手段 電子錶格很難實現多個數據之間地關聯 電子錶格很難實 ...
  • 為了方便以後查看,總結了一些常用的java操作hbase的代碼: ...
  • Redis是一個基於記憶體的鍵值資料庫,其記憶體管理是非常重要的。本文記憶體管理的內容包括:過期鍵的懶性刪除和過期刪除以及記憶體溢出控制策略。 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...