資料庫問題

2021-03-17 15:28:32 字數 1247 閱讀 9100

1樓:匿名使用者

(1) select sno '**商號' from spj where jno = 'j1'

(2) select j.jname from

spj inner join p on spj.sno = p.pno inner join j on spj.jno = j.jno

where j.city = '上海' and p.color = '紅色'

(3) select p.pname,count(spj.qty) from

spj inner join p on spj.sno = p.pno inner join j on spj.jno = j.jno

where j.jno = 'j2'

group by p.pname

(4) select j.jno from

spj inner join p on spj.sno = p.pno and p.

color = '紅色' inner join j on spj.jno = j.jno inner join s on spj.

sno = s.sno

where s.city <> '天津'

(5) select p.pno,count(spj.qty) 'count' from

spj inner join p on spj.sno = p.pno inner join j on spj.jno = j.jno

group by p.pno

order by count desc

(6) update p set p.color ='藍色' where color = '紅色'

(7)create view view_s

asselect * from

spj inner join p on spj.sno = p.pno inner join j on spj.

jno = j.jno inner join s on spj.sno = s.

snowhere s.sno = 's1'

(8) delete from spj where jno ='j1'

不知對不對,僅供參考~

2樓:匿名使用者

靠,這麼簡單的東西還要粘上來問,你長點心吧你~

3樓:匿名使用者

作業題啊?

詳見資料庫系統概論 作者王珊 薩師煊 高等教育出版是出版

資料庫的入門教程

資料庫問題,達人請進,高分跪求,資料庫問題,達人請進,高分跪求!!!!!

select 疾病健康妊娠 from 表名 where 疾病健康妊娠 like 高血壓 不行hi我 我倒覺得不是表面這麼簡單,疾病健康妊娠 並不是一個欄位吧?是不是高血壓一個欄位,冠心病一個欄位?等等。如果是bit型別select case when 高血壓 1 then 高血壓 else end ...

sql資料庫問題

select from dbo.sys object where id in select id from sys column where column name c checkturn 似乎是這麼查,具體的欄位可能有出入!表名從 sys object表來,欄位從 sys column表來。通過查...

資料庫多表合併的問題,資料庫 多個使用者的資料合併到同一個表好還是分散到多個表上好?

簡單點說,每個中國人都有一個身份證號碼,而且這個身份證號碼一定能找到你 那麼現在我們建立表1 身份證號碼,姓名,性別,年齡,戶籍地,名族,家庭關係 現在你上班了,需要到單位報到,單位的hr肯定會要你的身份證號碼,那是為什麼呢?因為單位要建立自己的資料庫 現在我們建立表2 身份證號碼,工作經歷,學習經...