摘要: mysql> create table customer(mid char(5) primary key,th date,sex char(1) default '0'); Query OK, 0 rows affected (0.01 sec) mysql> desc customer; +-------+-------------+------+-----+---------+-------... 阅读全文
posted @ 2019-01-11 17:31 裸奔的小鸵鸟 阅读(145) 评论(0) 推荐(0) 编辑
摘要: mysql> grant select,insert on sakila.* to 'zl'@'localhost' identified by '123'; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> exit Bye [root@localhost ~]# mysql -uzl -p123 mysql: [Warning] ... 阅读全文
posted @ 2019-01-11 14:38 裸奔的小鸵鸟 阅读(172) 评论(0) 推荐(0) 编辑
摘要: #子查询-某些情况下,当进行查询的时候,需要的条件是另外一个select语句的结果,这个时候就要用到子查询。用于子查询的关键字主要包括: in、not in、=、!=、exists、not exists等等。 #从emp表中查询出所有部门在dept表中的所有记录 mysql> select * from dept; +--------+----------+ | deptno | deptna... 阅读全文
posted @ 2019-01-11 11:07 裸奔的小鸵鸟 阅读(250) 评论(0) 推荐(0) 编辑
摘要: #子查询-某些情况下,当进行查询的时候,需要的条件是另外一个select语句的结果,这个时候就要用到子查询。用于子查询的关键字主要包括: in、not in、=、!=、exists、not exists等等。 #从emp表中查询出所有部门在dept表中的所有记录 mysql> select * from dept; +--------+----------+ | deptno | deptna... 阅读全文
posted @ 2019-01-11 10:28 裸奔的小鸵鸟 阅读(329) 评论(0) 推荐(0) 编辑
摘要: #插入 mysql> insert into emp values('zzx1','2002-03-09','2009-04-03','2001',3,22); Query OK, 1 row affected (0.00 sec) mysql> insert into emp values('ttx2','20023-04-10','2010-03-04','2002',4... 阅读全文
posted @ 2019-01-11 09:55 裸奔的小鸵鸟 阅读(175) 评论(0) 推荐(0) 编辑