做響應(yīng)式網(wǎng)站需要學(xué)哪些知識廊坊seo外包公司費用
數(shù)據(jù)庫軟件:
關(guān)系型數(shù)據(jù)庫:Mysql? ? ? ? ? ?Oracle? ? ? ? SqlServer? ? ? ? ?Sqlite
非關(guān)系型數(shù)據(jù)庫:Redis? ? ? ?NoSQL
1.數(shù)組,鏈表,文件,數(shù)據(jù)庫
數(shù)組,鏈表:內(nèi)存存放數(shù)據(jù)的方式(代碼運行結(jié)束,關(guān)機數(shù)據(jù)丟失)
文件,數(shù)據(jù)庫:外存存放數(shù)據(jù)的方式(代碼運行結(jié)束,關(guān)機數(shù)據(jù)不會丟失)
文件:數(shù)據(jù)量很小,處理效率很低}
數(shù)據(jù)庫:數(shù)據(jù)量很大 , 處理數(shù)據(jù)(增刪改查)效率高
2.安裝sqlite數(shù)據(jù)庫:
? ? 1.讓虛擬機能夠上網(wǎng)
? ? 2.apt-get工具集配置好
? ? 3.sudo apt-get install sqlite3?
? ? 4.啟動sqlite3?
? ? ? ? sqlite3?
? ? 5.輸入.quit退出
3.SQL命令:
? ? 1. .headers on/off 打開/關(guān)閉 數(shù)據(jù)庫中列名稱
? ? 2. .mode csv/column/html/insert/line/list/tabs/tcl?
? ? 3. .schema 表名稱 ? 查看表名稱對應(yīng)的表的格式(有哪幾列?每一列類型?)
? ? 4. .width 寬度 ? ? ?設(shè)置顯示時的數(shù)據(jù)寬度?
? ? 5..tables ? ? ? ? ?查看數(shù)據(jù)庫文件中的所有表
?
4.SQL語言(所有的數(shù)據(jù)庫都支持這種語言)
據(jù)的:增、刪、改、查
? ? 1.使用sqlite3打開數(shù)據(jù)庫文件?
? ? ? sqlite3 數(shù)據(jù)庫文件名
? ? ? sqlite3 ./student.db?
? ? 2.創(chuàng)建表?
? ? ? create table?
? ? ??
? ? ? 示例:
? ? ? ? sqlite> create table student (id integer, name varchar(255), sex varchar(32), age integer, score integer);
? ? 3.插入數(shù)據(jù)
? ? ? insert into?
? ? ? 示例:
? ? ? ? sqlite> insert into student values (1001, "張三", "男", 19, 80);
? ? ? ? sqlite> insert into student (id, name, score) values (1002, "李四", 100);
? ? ? ? sqlite> insert into student values (1002, "王二", "女", 18, NULL);
4.查找數(shù)據(jù)
? ? ? select?
? ? ? select * from 加 名字? ?---? 查看名字列表所有內(nèi)容
? ? ??select * from 列表名?where 指定列表?= "指定內(nèi)容? and? 指定列表 = “指定內(nèi)容"? ? ---? ?篩選內(nèi)容打印
? ? ? select *from 列表名?where 指定列?like “%大致內(nèi)容%”? ---? 查看包含指定內(nèi)容的列
? ? ? 示例:
? ? ? ? sqlite> select * from student;
? ? ? ? sqlite> select name, score from student;
? ? 5.內(nèi)容匹配
? ? ? where?
? ? ? 示例:
? ? ? ? sqlite> select * from student where name like "%張%";
.mode column? ? ---? ?讓內(nèi)容對齊
.headers on? ? ---? 顯示表頭
.width? ?---? 設(shè)置每個內(nèi)容的寬度
6.主鍵:
? ? ? ? key:鍵值?
? ? ? ? 內(nèi)鍵:在表中唯一標(biāo)識一條數(shù)據(jù)稱為內(nèi)鍵
? ? ? ? 外鍵:與外部表進(jìn)行標(biāo)識的數(shù)據(jù)稱為外鍵?
示例:creat tables 列表名 (id integer primary key asc) ---? 以不能重復(fù)命名的方式進(jìn)行自增
?7.刪除
? ? ? ? delete from?
? ? ? ? 示例:
? ? ? ? ? ? delete from student where name="李四";
8.修改
? ? ? ? update?
? ? ? ? 示例:
? ? ? ? ? ? update student set sex="男",age=19 where name="王二";
9.排序
? ? ? ? order by?
? ? ? ? 示例:
? ? ? ? ? ? select * from order_manager order by ordertime desc;
多表聯(lián)合查詢:
? ? 1.交叉連接
? ? ? ? cross join?
? ? ? ? 示例:
? ? ? ? sqlite> select student.name as 學(xué)生姓名, lesson.name as 課程名
? ? ? ? ...> from student cross join lesson;
? ? 2.內(nèi)連接
? ? ? ? inner join?
? ? ? ? 示例:
? ? ? ? sqlite> select score.id as 成績編號, student.name as 學(xué)生姓名, score.score as 成績
? ? ? ? ...> from score inner join student on score.stuid=student.id;
? ? 3.外連接
? ? ? ? outer join?
? ? ? ? 示例:
? ? ? ? sqlite> select score.id as 成績編號, student.name as 學(xué)生姓名, score.score as 成績
? ? ? ? ...> from student left outer join score on score.stuid=student.id;
? ? 示例:
? ? ? ? sqlite> select score.id as 成績編號, student.name as 學(xué)生姓名, score.score as 成績
? ? ? ? ...> from student left outer join score on score.stuid=student.id
? ? ? ? ...> where name="張三"
? ? ? ? ...> order by 成績 desc;
?