2018-11-01
閱讀量:
990
數(shù)據(jù)定義語(yǔ)言
常用的操作命令:insert\update\delete
1、insert
----語(yǔ)法:insert into 表名 values(各列的值,用逗號(hào)隔開)
注意:插入的值如果是字符類型,需要用單引號(hào)
插入的值要與定義的字段類型一致
1)不使用列表,直接插入,必須一一對(duì)應(yīng)
語(yǔ)法:insert into 表名 values(值用逗號(hào)隔開)
如果順序不一樣,必須指定字段名和值
insert into 表名(插入字段名)values(值與字段名對(duì)應(yīng))
插入部分字段
2、導(dǎo)入外部數(shù)據(jù)
導(dǎo)入外部文本文件
為數(shù)據(jù)表monthly-indicator導(dǎo)入txt文件
語(yǔ)法:
load data local infile '文件路徑/名稱.txt'
into table monthly_indicator
fields terminated by '/t'
ignore 1 lines;
注意路徑中斜杠的方向有所變化
3、delete
刪除行數(shù)據(jù)
delete from 表名 where 列名=值;(比如:where id='a01')
4、update
修改行數(shù)據(jù)
update 表名 set 新列=新列名 where 某列=某值






評(píng)論(0)


暫無(wú)數(shù)據(jù)
CDA考試動(dòng)態(tài)
CDA報(bào)考指南
推薦帖子
0條評(píng)論
0條評(píng)論
0條評(píng)論
1條評(píng)論