-
外键的值要么为空,要么是来自主表的值查看全部
-
课程主要内容查看全部
-
删除约束查看全部
-
删除/启用约束查看全部
-
增加主键约束: alter table userinfo add constraint pk_id primary key(id); 更改主键的名字: alter table table_name rename constraint old_name to new_name;查看全部
-
使用constraint设置主键约束查看全部
-
表空间、数据文件 表操作 数据操作 约束 查询查看全部
-
select * from users; select username, decode(username,'aaa','computer','bbb','market','others') as department from users;查看全部
-
select * from users; select username, case username when 'aaa' then '计算机部门' when 'bbb' then '市场部门' else '其他部门' end as 部门 from users; select username, case when username='aaa' then '计算机部门' when username='bbb' then '市场部门' else '其他部门' end as 部门 from users; select username, case when salary<800 then 'low' when salary>5000 then 'high' else 'normal' end as salary level from users;查看全部
-
select * from users order by id desc/asc;查看全部
-
select * from users where salary between 800 and 2000; select * from users where username in('aaa','bbb');查看全部
-
select * from users; select * from users where username like 'a%'; select * from users where username like '_a%'; select * from users where username like '%a%';查看全部
-
select salary from users where username='aaa'; select username,salary from users where id=3; select * from users where username='aaa' or salary>2000; select * from users where username='aaa' or (salary>800 and salary<=2000); select * from users where username<>'aaa' or (salary>800 and salary<=2000); select * from users where not(username='aaa');查看全部
-
select id,username,salary+200 from users; select * from users; select username from users where salary>800; select username as 土豪 from users where salary>800; select username as 青年才俊 from users where salary>800 and salary<>1800.5;查看全部
-
select id 编号,username 用户名,salary 工资 from users; select distinct username as 用户名 from users;查看全部
举报
0/150
提交
取消