摘要: 1.语法 ALTER TABLE tb1 ADD FOREIGN KEY (col1) REFERENCES tb2(col2) [ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT}] [ON UPDATE {RES 阅读全文
posted @ 2020-08-19 17:33 糖醋排骨加辣椒 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1.delete语法 DELETE FROM table_name WHERE some_column=some_value; 2.例子 delete from urls where url="www.baidu.com"; 阅读全文
posted @ 2020-08-19 17:09 糖醋排骨加辣椒 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 1.insert into语法 第一种形式无需指定要插入数据的列名,只需提供被插入的值即可: INSERT INTO table_name VALUES (value1,value2,value3,...); 第二种形式需要指定列名及被插入的值: INSERT INTO table_name (co 阅读全文
posted @ 2020-08-19 17:03 糖醋排骨加辣椒 阅读(1393) 评论(0) 推荐(0) 编辑
摘要: 1.describe语法 describe 表名; 阅读全文
posted @ 2020-08-19 16:58 糖醋排骨加辣椒 阅读(944) 评论(0) 推荐(0) 编辑
摘要: 1.describe语法 describe 表名; 阅读全文
posted @ 2020-08-19 16:55 糖醋排骨加辣椒 阅读(1803) 评论(0) 推荐(0) 编辑
摘要: 1.use语法 use my_db; 阅读全文
posted @ 2020-08-19 16:53 糖醋排骨加辣椒 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 1.create语法 CREATE DATABASE my_db; 2.例子 CREATE TABLE urls( id INT NOT NULL AUTO_INCREMENT, url VARCHAR(1000) NOT NULL, content VARCHAR(1000) NOT NULL, 阅读全文
posted @ 2020-08-19 16:51 糖醋排骨加辣椒 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 字符串函数: char_length(s)返回字符串s的字符数, concat(s1,s2,..)合并字符串 数字函数: avg(expression)返回表达式的平均值 max(exp),min(exp),sum(expression):求和 日期函数-高级函数: cast(x as type)转 阅读全文
posted @ 2020-08-19 16:48 糖醋排骨加辣椒 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1.select语法 select <列的集合> from <表名> where <条件> group by <列名> having <条件> order by <排序字段和方式> limit startRow,number; group by:根据给定列的值进行分组统计,可指定多列,列之间以逗号分 阅读全文
posted @ 2020-08-19 16:46 糖醋排骨加辣椒 阅读(1453) 评论(0) 推荐(0) 编辑