當前位置:首頁 » 編程語言 » sql資料庫試題

sql資料庫試題

發布時間: 2022-05-21 09:28:44

sql資料庫選擇題,9~14題。

答案是accdac

9. A order by 是按列分組
10. C is null 表示為「空」,is not null 表示為「非「」
11. C cno在sc表中有,故不需用到course表
12. D 顯然,三個表都要用到
13. A 其實可以根據英文單詞來記憶,insert就是插入的意思,update就是更新的意思,如果你玩游戲的話,當游戲要更新補丁的時候就會有「update」字樣
14. C A是創建資料庫,B是創建視圖,C是創建表,D是修改表,alter是修改的意思

註:個人建議這種一眼看過去就知道答案的題目一定要完全掌握,其實不難的,不需要你會英語,把單詞記住就好了。

Ⅱ SQL資料庫填空題 求大神

1、資料庫管理技術經歷了____人工管理___ ____文件管理______ __資料庫系統___ 三個階段
2 .關系模型有 ___實體完整性____,___參照完整性____ ,____用戶定義的完整性___ 三類完整性。
4、SQL SERVER 中的編程語言就是________________PL/SQL_____________語言。
5、PL/SQL 有兩種類型的游標:___顯式游標____ 和____顯式游標___ 。
6、DBMS通常提供授權功能來控制不同的用戶訪問資料庫中數據的許可權,其目的是為了資料庫的_____安全性____

Ⅲ SQL資料庫試題~~~~~~~~~~

updateStudentsetsex='女'wherename='張三'returningageinto:var

Ⅳ SQL資料庫題

第一個
select*fromswheresnoin(
selectsnofromscwherecnoin(
selectcnofromcwherecteacher='李明'
)
)

第二個
selects.sname,sc,sum(sgrade)fromsleftjoinscons.sno=sc.sno
wheresc.sgrade>=60
groupbys.sname
第三個
createindexc_cno_indexONc(cno)

Ⅳ sql資料庫一道試題幫忙做做

---1)
創建一張學生表,包含以下信息,學號,姓名,年齡,性別,家庭住址,聯系電話
CREATE
TABLE
student
(

[id]
[int]
IDENTITY(1,1)
NOT
NULL,

[student_id]
[nvarchar](50)
NULL,

[studen_name]
[nvarchar](50)
NULL,

[age]
[int]
NULL
,

[sex]
[nvarchar](5)
NULL,

[address]
[nvarchar](200)
NULL,

[tel]
[nvarchar](20)
NULL
)
--2)
修改學生表的結構,添加一列信息,學歷
ecation
alter
table
student
add
ecation
nvarchar(10)
NULL
--3)
修改學生表的結構,刪除一列信息,家庭住址
alter
table
student
drop
column
address
--5)
修改學生表的數據,將電話號碼以11開頭的學員的學歷改為「大專」
update
student
set
ecation='大專'
where
tel
like
'11%'
--6)
刪除學生表的數據,姓名以C開頭,性別為『男』的記錄刪除
delete
student
where
studen_name
like
'C%'
and
sex='男'
--7)
查詢學生表的數據,將所有年齡小於22歲的,學歷為「大專」的,學生的姓名和學號示出來
select
studen_name,student_id
from
student
where
age<12
and
ecation='大專'
--8)
查詢學生表的數據,查詢所有信息,列出前25%的記錄
select
TOP
25
PERCENT
*
from
student
--9)
查詢出所有學生的姓名,性別,年齡降序排列
select
studen_name,sex,age
from
studen
order
by
age
desc
--10)
按照性別分組查詢所有的平均年齡
select
avg(age)
as
age
from
studen
group
by
sex

Ⅵ SQL資料庫試題求解

------------------------------------------------------
create table students(st_id varchar(20),st_name varchar(50),sex varchar(10))

insert into students(st_id,st_name,sex)
select 'st001','張傑', '男' union all
select 'st002', '公孫燕飛' ,'男' union all
select 'st003', '王楠', '女' union all
select 'st004', '王偉', '男' union all
select 'st005','李燕紋', '女' union all
select 'st006', '孫武' ,'男'
select *
from students

create table teachers(t_id varchar(20),t_name varchar(50),t_lesson varchar(50))

insert into teachers

select 't001', '張老師' ,'數學' union all
select 't002', '李老師', '英語'

delete from results
create table results(r_id varchar(20),r_fenshu int,r_stid varchar(50),r_tid varchar(50))

insert into results
select 'r001','90', 'st001', 't002' union all
select 'r002', '68', 'st005', 't001' union all
select 'r003', '92', 'st003' ,'t001' union all
select 'r004', '82', 'st006', 't002' union all
select 'r005', '70', 'st002', 't002' union all
select 'r006', '86', 'st002', 't001' union all
select 'r007', '57', 'st003', 't002' union all
select 'r008', '76', 'st006', 't001' union all
select 'r009', '55', 'st001', 't001' union all
select 'r010', '77', 'st004', 't002' union all
select 'r011', '58', 'st005', 't002'
----------------------------------------------------------
1.
select st_id
from students
where st_name = '王偉'

2.select st_id,st_name
from students
where st_name like '__燕%'

3 select st_name,len(st_name) as 名字長度
from students
where sex ='男'

4 select min(r_fenshu) as 最低分數
from teachers t inner join results r on t.t_id =r.r_tid
where t_lesson ='數學' --這個是不考慮成績中有null值的
5 select s.st_id as 學生編號,r_fenshu as分數,r_tid as 課目號
from students s inner join results r on s.st_id =r.r_stid
where s.sex='女'
--如果還要課目的名稱的話請用下面的
select s.st_id as 學生編號,r.r_fenshu as 分數,r.r_tid as 課目號,t.t_lesson as 課目名稱
from students s inner join results r on s.st_id =r.r_stid
inner join teachers t on r.r_tid = t.t_id
where s.sex='女'

6 select avg(r.r_fenshu)
from results r inner join teachers t on r.r_tid = t.t_id
where t.t_lesson='英語'

7.select *
from students s inner join results r on s.st_id =r.r_stid
inner join teachers t on r.r_tid = t.t_id
where s.st_id in (select top 2 st_id from students order by st_id desc)
order by s.st_id desc

8 select sum(r.r_fenshu) as 總分
from results r inner join students s on r.r_stid =s.st_id
where s.st_name = '王楠'
9.select distinct s.st_id,s.st_name
from students s inner join results r on s.st_id = r.r_stid
where st_id not in (select r_stid from results where r_fenshu<60) and st_id not in (select r_stid from results where r_fenshu >=90)

10 update results
set r_fenshu = r_fenshu + 10
--如果分數不可能大於100請用這句 set r_fenshu = case when r_fenshu + 10 <=100 then r_fenshu + 10 else 100 end
where r_stid in (select st_id from students where sex='女')

1 進階題
select t.t_name,count(*)
from students s,teachers t,results r
where r.r_tid = t.t_id
and s.st_id =r.r_stid
and r.r_fenshu >= 60
and t.t_id in (select t_id from teachers where t_lesson='數學' )
--and t_lesson='數學'
group by t.t_name

2

select top 1 sum(r_fenshu) as 總分,t.t_lesson,t_id,t_name
from results r,teachers t
where r.r_tid = t.t_id
group by t.t_lesson,t_id,t_name
order by 總分 desc

3. delete from results where r_stid in (select r_stid from results group by r_stid having count(r_tid) = 1)

1 選做題
select d.name from sysobjects d where d.xtype='U'
2.select top 5 * from students order by newid()

Ⅶ sql 資料庫習題謝謝

1. select '類別為:'+tushuleibie 圖書分類 from T_Book
2. select shuming 書名,zuozhe 作者,jiage*0.7 價格 from T_Book where chubanshe ='機械工業出版社'
3. select shuming 書名,zuozhe 作者,jiage 價格, chubanshe 出版社 from T_Book where jiage between 30 and 60
4. select top 3 shuming 書名,zuozhe 作者,chubanshe 出版社, jiage 價格 from T_Book order by jiage desc

6.select chubanshe 出版社,AVG(jaige) 平均價,MAX(jiage) 最高價 ,MIN(jaige) 最低價 from T_Book group by chubanshe order by SUM(jiage) desc

10.select top 1 chubanshe 出版社, count(*) 出版圖書個數 from T_Book group by chubanshe order by COUNT(*) desc
book表的做好了 reader的自己做吧 欄位名我用拼音做代替的 你自己替換成你表中的欄位

Ⅷ 求sql資料庫考試題答案

1.create database Readbook
on
(name=Readbook_data,filename='D:\server\Readbook_data.mdf',size=2mb,maxsize=10mb,filegrowth=1mb)
log on
(
name=Readbook_log,
filename='D:\server\Readbook_log.ldf',size=1mb,maxsize=5mb,filegrowth=1mb
)
go
2.use mybase
go
alter database mybase
add log file
(
name=Readbook2_log,
filename='D:\server\mybase2_log.ldf',size=2mb,maxsize=10mb,filegrowth=1mb
)
go
3.alter database mybase
remove file Readbook2_log

Ⅸ 急求SQL資料庫練習題

樓上的--理論很多不太使用:ㄨinsert -增加語句用法 insert into(Name,Sec)values("張三","李四") --這個語句1.習題:插入學員信息 Name,Sex,Age,Address (地址可為null) 要有自動標識列。 2.實現一次插入多行。3.把原有表中的某個欄位 移到新表中 提示:select <欄位> into newtable from <原表> ㄨdelecte --刪除語句delecte from <表> [where<條件>]例題:上表中 --刪除 年齡是66和地址為null 信息 (年齡與地址自己添加) ㄨupdate--更新語句update set <條件> where[限制條件]例題:把年齡大於50歲的 更新為49歲 其餘條件自己加 ㄨselect --查詢語句select <欄位1>,<欄位2> from <表> where [條件]例題:從表1、表2中查找相同欄位並且 把相同欄位存放到新的表中這里子查詢就不多說了。這些題很基礎你試一試。

熱點內容
javaice 發布:2024-03-29 21:56:37 瀏覽:355
編譯圖書 發布:2024-03-29 21:56:36 瀏覽:332
linux全選vi 發布:2024-03-29 21:55:11 瀏覽:773
艾譜保險箱初始密碼一般是什麼 發布:2024-03-29 21:48:11 瀏覽:824
商家粉腳本 發布:2024-03-29 21:34:57 瀏覽:150
我的世界ec伺服器怎麼獲得 發布:2024-03-29 21:21:44 瀏覽:708
小米4設置限制的訪問 發布:2024-03-29 21:21:10 瀏覽:405
linux向伺服器上傳文件 發布:2024-03-29 21:17:20 瀏覽:928
腳本健康cpu佔用率報警 發布:2024-03-29 21:16:42 瀏覽:254
vivox9什麼配置參數 發布:2024-03-29 21:08:09 瀏覽:936