《大数据高级分析工程师》笔记(更新至考试前)
2020-11-14 本文已影响0人
顺小星

前言:11月中旬报名,12月考试。

MySql部分:
1、登录数据库及查看

2、登录数据库:
mysql -u root -p
输入密码password
3、查看数据库:
show databases;

4、使用某数据库:
use ****
(****为数据库名)5、退出数据库:
exit
6、创建数据库:
create database ***;
(***为数据库名)7、看某数据库中有没有表:
show tables;
(带分号)8、在某数据库中创建表:
create table ****
(****为表名)9、查看表详情:
describe ****
(****为表名)10、查看表记录:
select * from ****
(****为表名)11、在表中插入某条记录:
insert into **** values()
;
。。。。。
还是直接看菜鸟教程吧,就不重复造轮子了https://www.runoob.com/mysql/mysql-tutorial.html
12、select 区分大小写关键字:binary:select * from pet WHERE binary name='wangcai'
13、更细某表中的某属性值 update和set: UPDATE pet set name='旺财1'
14、关于like
WHERE 子句中可以使用等号 = 来设定获取数据的条件,如 "runoob_author = 'RUNOOB.COM'"。
但是有时候我们需要获取 runoob_author 字段含有 "COM" 字符的所有记录,这时我们就需要在 WHERE 子句中使用 SQL LIKE 子句。
SQL LIKE 子句中使用百分号 %字符来表示任意字符,类似于UNIX或正则表达式中的星号 *。
如果没有使用百分号 %, LIKE 子句与等号 = 的效果是一样的。
SELECT * from runoob_tbl WHERE runoob_author LIKE '%COM';