SQL

出自TWEmu.no-ip.org

跳轉到: 導航, 搜尋

一種資料庫語言

  • MySQL
  • SQLite

目錄

安裝

  • Debian
    • mysql-server
    • sqlite/sqlite3

使用

指令功能範例
create table table_name(field1, field2, field3, ...);建立資料表
insert into table_name values(data1, data2, data3, ...);加入一筆資料
select columns from table_name where expression;查詢資料
update table_name set field1 = 'field1' where field1='field0';修改或刪除資料
drop table table_name;刪除資料表

修飾字

修飾字功能範例
select ... distinct column from ...顯示該欄位不同的值
select ... from ...where expression ...顯示符合該判別式的欄位
select ... from ... where expression and/or expression ...顯示符合該判別式邏輯的欄位
select ... from ... where column in (data1, data2, ...) ...顯示符合該欄位被要求的資料
select ... from ... where column between data1 and data2 ...顯示符合該欄位介於 data1 到 data2 的資料
select ... from ... where ... like expression ...顯示符合該萬用字元格式的資料
select ... from ... where ... order by column sort_type ...照 小至大 asc/ 大至小 desc 排序資料

萬用字元

字元功能範例
%0 至多個字元
_一個字元

圖形介面工具

  • PHPMyAdmin

連結