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

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

網(wǎng)頁設(shè)計報告前言seo研究學(xué)院

網(wǎng)頁設(shè)計報告前言,seo研究學(xué)院,移動網(wǎng)站如何做權(quán)重,做公司網(wǎng)站需基本概念 數(shù)據(jù)庫DB database簡稱DB: 存儲數(shù)據(jù)的倉庫,是以某種結(jié)構(gòu)存儲數(shù)據(jù)的文件。指長期保存在計算機的存儲設(shè)備上,按照一定規(guī)則阻止起來,可以被用戶或應(yīng)用共享的數(shù)據(jù)集合。 數(shù)據(jù)庫管理系統(tǒng)DBMS 用于創(chuàng)建,維護(hù),使…

基本概念

數(shù)據(jù)庫DB

database簡稱DB: 存儲數(shù)據(jù)的倉庫,是以某種結(jié)構(gòu)存儲數(shù)據(jù)的文件。指長期保存在計算機的存儲設(shè)備上,按照一定規(guī)則阻止起來,可以被用戶或應(yīng)用共享的數(shù)據(jù)集合。

數(shù)據(jù)庫管理系統(tǒng)DBMS

用于創(chuàng)建,維護(hù),使用數(shù)據(jù)庫的一種大型軟件系統(tǒng)。比如MySQL, Oracle, SQL server等等。

使用

MySQL服務(wù)的開啟

方式1:右鍵任務(wù)欄->任務(wù)管理器->服務(wù)->MySQL80->右鍵即可啟動服務(wù)
方式2:CMD命令行操作:小黑窗里面輸入:net start/stop MySQL80來啟動或關(guān)閉服務(wù)。

MySQL的訪問方式

方式1:外部訪問命令 mysql -h主機名 -P端口號 -u用戶名 -p密碼
如果是訪問本機的數(shù)據(jù)庫,可以省略為mysql -u用戶名 -p密碼

方式2:MySQL安裝自帶的命令行
直接輸入賬號的密碼即可登錄,默認(rèn)是主機是本機,默認(rèn)端口號是3306,默認(rèn)賬號是root.

方式3:圖形化窗口,Navicat, SQLyog, MySQLWorkBench等工具。

數(shù)據(jù)類型

數(shù)值類型:
int : tinyint、smallint、mediumint、int
decimal(5, 2): 表示范圍為-999.99~999.99
字符串類型:
char: 定長字符串類型,默認(rèn)長度為1
varchar(50):變長字符串類型
text: 不支持默認(rèn)值
日期類型:
datatime: 存儲的時間不會隨著時區(qū)變化。
timestamp:日期時間戳,到2038年就不能用了。
json類型

update products
set properties = '{"dimension" : [1,2,3],"weight" : 10,"manufacturer" : {"name" : "sony"}
}'
WHERE product_id = 1;
select product_id, json_extract(properties, '$.weight') as weight
from products
where product_id = 1;

SQL語言

分類

  • DDL數(shù)據(jù)定義語言
  • DML數(shù)據(jù)操作語言
  • DQL數(shù)據(jù)查詢語言
  • DCL數(shù)據(jù)控制語言

定義庫

-- 查詢所有的庫
show databases;
-- 創(chuàng)建庫
create database db1;
-- 查詢數(shù)據(jù)庫的字符集
show create database;
-- 指定字符集和校對規(guī)則
create database mydb2 character set gbk;
-- 修改字符集
alter database mydb2 character set utf8;
-- 刪除數(shù)據(jù)
drop database mydb2;
--切換庫
use db1;

定義表

-- 創(chuàng)建表
create table student (id int, name varchar(50), age int, gender char);
-- 查看所有表
show tables;
show create table student; -- 查看完成的創(chuàng)建語句
-- 查看表結(jié)構(gòu)
desc student;
-- 修改表名
alter table student rename to stu;
-- 修改字段名
alter table stu change id sid int;
-- 修改數(shù)據(jù)類型
alter table stu modify gender char(2);
-- 新增字段
alter table stu add score double(5, 2);
-- 修改字段的順序
alter table stu modify gender char(2) after name;
-- 刪除表
drop table stu;

DML數(shù)據(jù)操作

  • insert添加數(shù)據(jù)
-- 全字段插入
insert into emp 
value(101,'tom','男'12000, '1999-02-23', 'boss');
-- 指定字段插入
insert into emp(id, name)
value(102, 'jack');
-- 批量插入
insert into emp(id, name) 
values(103, 'rose'),(104, 'pert');
  • update更新數(shù)據(jù)
-- 將所有行的該字段數(shù)據(jù)修改為一個值
update emp set salary = salary + 15000;--指定某一條數(shù)據(jù)
update emp set salary = 19000 
where name = 'jack';update emp salary = 1000, gender='女'
where name = 'rose';update emp set birthday = '2000-01-01'
where id = 104;
  • delete刪除數(shù)據(jù)
delete from emp where name = 'jack';-- 刪除全部數(shù)據(jù),逐條刪除,刪除后可以恢復(fù),主鍵還是繼續(xù)累加的
delete from emp;-- 刪除表后,全新創(chuàng)建一個空的新表,刪除后無法恢復(fù)
truncate emp;

delete和truncate的區(qū)別:

  • 刪除全部數(shù)據(jù),逐條刪除,刪除后可以恢復(fù),主鍵還是繼續(xù)累加
  • 刪除表后,全新創(chuàng)建一個空的新表,刪除后無法恢復(fù)

DQL數(shù)據(jù)查詢語句

select 關(guān)鍵字的作用:用于運算,執(zhí)行函數(shù),查詢數(shù)據(jù)。

  • 基本查詢

    • select * from emp;: 查詢emp的所有數(shù)據(jù)
    • select name, salary from emp; 查詢指定字段的數(shù)據(jù)
    • select distinct salary from emp; 去除重復(fù)數(shù)據(jù)
    • select name, salary + 1000 as new_salary from emp;起別名
  • 多個條件復(fù)合查詢

    • select * from emp where id = 1 or id = 2;
    • select * from emp where eid in (1, 3, 5);集合條件查詢
  • 區(qū)間條件查詢

    • select * from emp where salary >= 8000 and salary <= 15000;
    • select * from emp where salary between 9000 and 15000;
  • 帶有NULL的查詢

    • select * from emp where salary is null;
    • select * from emp where salary is not null;
    • select name, IFNULL(salary, 0) + 1000 from emp; 把null值作為0處理。
  • 模糊查詢:使用like關(guān)鍵字,不要用等號

    • 下劃線 _ 表示任意一個字符
    • 百分號 % 表示任意 多個字符
  • 排序:關(guān)鍵字order by 字段名,默認(rèn)是ASC升序排序,DESC是降序。

    • select * from emp order by salary desc; 按照降序排列
    • select * from emp order by id asc; asc可以省略
    • select * from emp order by salary asc, id desc;多個條件排序
  • 聚合函數(shù)

    • select count(*) from t_employee where commission_pct is not null;統(tǒng)計函數(shù)
    • select * from t_employee where salary * (1 + IFNULL(commission_pct, 0)) > 15000; 如果值可能為空的話,要使用IFNULL()方法設(shè)置默認(rèn)值,否則NULL和其他數(shù)字計算還是NULL.
    • select SUM(salary), SUM(commission_pct * salary) from t_employee;計算工資總和
    • select SUM(salary * (IFNULL(commission_pct, 0) + 1)) from t_employee;計算帶傭金的工資總和
    • select max(birthday), min(birthday) from t_employee;查詢年紀(jì)最小和最大的員工
  • 分組查詢

    • select did, count(*) from t_employee group by did;查詢部門變化和每個部門的人數(shù)
    • select did, sum(salary) from t_employee group by did having SUM(salary) > 40000;查詢工資總和大于40000的部門編號及工資和。
    • select did, SUM(salary) sm from t_employee where gender = '女' group by did having sm > 20000;查詢部門女員工工資總和大于20000的部門編號和工資總和。
  • Limit m, n 關(guān)鍵字

    • m 表示查詢的起始索引,n表示需要查詢的記錄數(shù)
    • select * from emp limit 0, 5;查詢前5條記錄
    • select * from emp limit (x-1) * n , n; 查詢第x頁的記錄,每頁有n條記錄。
http://www.risenshineclean.com/news/5206.html

相關(guān)文章:

  • 網(wǎng)絡(luò)編程技術(shù)實驗報告seo怎么弄
  • 廣州公司注冊貼吧關(guān)鍵詞排名優(yōu)化報價
  • 怎么查詢一個網(wǎng)站有沒有做競價百度自動優(yōu)化
  • 廣州設(shè)計網(wǎng)站廣告軟文小故事800字
  • 什么網(wǎng)站可以接裝修活今日特大新聞
  • 外貿(mào)公司企業(yè)網(wǎng)站公司網(wǎng)絡(luò)推廣網(wǎng)站
  • 深圳網(wǎng)站建設(shè)好站長工具是干嘛的
  • h5制作平臺排行榜浙江seo公司
  • 網(wǎng)站導(dǎo)航結(jié)構(gòu)的優(yōu)化站長工具無憂
  • 建設(shè)云南省癌癥中心網(wǎng)站太原seo霸屏
  • 讓人做網(wǎng)站需要注意什今日新聞聯(lián)播
  • 貼心網(wǎng)絡(luò)推廣方法免費的seo教程
  • php做網(wǎng)站怎么樣網(wǎng)站收錄查詢系統(tǒng)
  • 伙購網(wǎng)官方網(wǎng)站seo刷排名公司
  • 關(guān)于網(wǎng)站開發(fā)的學(xué)校武漢全網(wǎng)推廣
  • 網(wǎng)絡(luò)平臺怎么弄湖南seo推廣
  • wordpress qtan專業(yè)搜索引擎優(yōu)化電話
  • 投票網(wǎng)站制作廣州市疫情最新
  • 哪些網(wǎng)站做外鏈好瀏陽廖主任打人案
  • 網(wǎng)站設(shè)計導(dǎo)航欄高度中國萬網(wǎng)域名注冊
  • 網(wǎng)站建設(shè)_超速云建站重慶seo標(biāo)準(zhǔn)
  • 微號網(wǎng)站開發(fā)長沙網(wǎng)站seo哪家公司好
  • 網(wǎng)站上的搜索功能是怎么做的seo技術(shù)快速網(wǎng)站排名
  • 云南網(wǎng)站建設(shè)優(yōu)選平臺專業(yè)seo整站優(yōu)化
  • 速賣通開店流程及費用星巴克seo網(wǎng)絡(luò)推廣
  • 視頻網(wǎng)站會員系統(tǒng)怎么做seo交互論壇
  • 網(wǎng)站防護(hù)找誰做seo實戰(zhàn)密碼在線閱讀
  • 商城網(wǎng)站建設(shè)哪家好站長平臺官網(wǎng)
  • 網(wǎng)站如何做rss訂閱長沙做網(wǎng)站的公司有哪些
  • 怎么做網(wǎng)頁鏈接教程網(wǎng)站首頁關(guān)鍵詞如何優(yōu)化