MySQL 基礎題練習題 查詢篇 1

2021-10-07 08:41:54 字數 688 閱讀 7138

最近在b站自學mysql,所以堅持更博,18年的sas筆記可能不會更了。

記錄一下每一節的練習題,筆記看情況以後也會放。

提取碼:8e4s

1.1.查詢沒有獎金,且工資小於18000的salary, last_name

select

last_name,

salary

from

employees

where

commission_pct is null

and salary < 18000;

1.2.查詢employees表中,job_id不為』it』或者工資為12000的員工資訊
select

* from

employees

where

job_id <> 'it'

or salary = 12000;

1.3.檢視departments表的結構
desc departments
1.4.查詢部門departments表中涉及到了哪些位置編號
#結合上一題,有個字段是location_id,查它。

select distinct

location_id

from

departments;

MySQL 基礎題練習題 查詢篇 2

資料在本專欄的第一篇部落格裡 本篇考察模糊查詢和排序查詢 2.1.查詢員工的姓名和部門號的年薪,按年薪降序,按姓名公升序select last name,department id,salary 12 1 ifnull commission pct,0 年薪 from employees order...

MySQL 基礎題練習題 查詢篇 7

資料在本專欄的第一篇部落格裡 sql99標準的連線查詢,左連線就很方便 8.1.查詢編號 3的女神的男朋友資訊,如果有則列出詳細的資訊,如果沒有,則用null填充select be.id,be.name,bo.from beauty be left join boys bo on be.boyfri...

基礎題練習題1

1.her face when she cannot answer the easy question.a.flourishes b.flutters c.flashes d.flushes 正確答案 d 解析flourish v.繁榮,昌盛 flutter v.擺動 煩擾 flash v.閃過,略...