SQL学习
UPDATE语句
UPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause] --使用 WHERE 子句将数据表的全部数据进行更新,所以要慎重。
DELETE语句
DELETE FROM table_name [WHERE Clause] --如果没有指定 WHERE 子句,MySQL 表中的所有记录将被删除
LIKE语句
SELECT field1, field2,...fieldN FROM table_name WHERE field1 LIKE condition1 [AND [OR]] filed2 = 'somevalue' --LIKE 子句中使用百分号 %字符来表示任意字符 SELECT * from runoob_tbl WHERE runoob_author LIKE '%COM'; runoob_tbl 表中获取 runoob_author 字段中以 COM 为结尾的的所有记录
创建数据库用户
--01: 创建tester用户,并且初始密码为123456. create user tester identified by "123456"; --02: 赋予该用户登录数据库的权限. grant create session to tester; --03: 赋予该用户查看outpatient下的视图v_daily_charge的权限. grant select on outpatient.v_daily_charge to tester; --04赋予tester用户查看outpatient用户下的t_user和t_dept表的权限. grant select on outpatient.t_user to tester; grant select on outpatient.t_dept to tester;

浙公网安备 33010602011771号