-
外鍵的值要么為空,要么是來自主表的值查看全部
-
課程主要內容查看全部
-
刪除約束查看全部
-
刪除/啟用約束查看全部
-
增加主鍵約束: 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
提交
取消