MySQL實驗作業 MySQL作業

2021-10-17 21:31:41 字數 1532 閱讀 7243

題目一:使用連線查詢的方式,查詢出各員工所在部門的人數與工程數,工程數命名為count_project。(連線3個表,並使用count內建函式)

create table employee(

id int(3)primary key,

name varchar(20),

age int(1)

create table department(

rearch int(3),

constraint foreign key(rearch) references employee(id),

sale int(3),

constraint foreign key(sale) references employee(id)

create table project(

pid int(3),

constraint foreign key(pid) references employee(id),

number int(1)default 0

empoyee

id(primary key)

name

agetom

jack

lucy

marry

james

department

rearch(foreign key)

sale(foreign key)

project

pid(foreign key)

number(default 0)

insert into project(pid,number)values(001,2),(002,3),(003,1),(111,0),(110,5);

只能分倆步完成

第一步:select id,name,age,count(rearch),numberfrom employee,department,project where id in(select rearch from departmentwhere rearch=employee.id ) and id in(pid) group by id;

第二步:select id,name,age,count(sale),numberfrom employee,department,project where id in(select sale from department wheresale=employee.id ) and id in(pid) group by id

題目二:

在挑戰實驗1中構建的成績管理系統中,物理老師想要找出分數最高的同學進行表揚,請你找出這個同學並把他的資訊(id、姓名、性別)輸出到路徑 e盤 下的physics.txt檔案中。同時 tom 的化學成績有異議,需要在原來的基礎上加3分,請更新 tom 的化學成績。

匯入匯出操作在視覺化軟體進行

mysql 實驗手冊 mysql實驗手冊

mysql 必知必會 實驗指導書 廣州番禺職業技術學院 資訊工程學院 2012.2 實驗一 一 實驗目的 mysql 工具的使用和資料庫的簡單查詢 1 熟悉 mysql 命令列實用程式.copy of rste2011 dm04 factorytalk historian se 歷史資料庫動手實驗手...

mysql 檢視作業 mysql作業

dropdatabaseifexistsshopping createdatabaseshopping useshopping createtablesales idmediumintunsignednotnullprimarykeyauto increment,pronamevarchar 30 ...

mysql作業部落格網 MySQL 作業2

1.建立表 id name class yuwen shuxue yingyu kexue wuli 1 xing 0411 80 75 60 91 85 2 xiao 0411 75 45 56 80 90 3 yue 0411 87 66 70 86 73 4 ming 0411 55 83 6...