适合女生朗诵的诗歌-qq空间名
1.
2.
3.
4.
5.
6.
7.
一般面试时考
SQL
,
主要就是考你“统计分析”这一块,
下面我们来看面试官经常采用的手段。
由
4
张简单的不能再简单的表,演变出
50
道
SQL
哈哈哈哈,够这个面试官面个< br>15
,
20
个人,不带重复的了,而且每个
SQL
你真的不动 动脑子还写
不出呢,你别不服气,下面开始。
8.
9.
表结构:
10.
11.
12.
13.
表
Student
14.
15.
(S#,Sname,Sage,Ssex)
学生表
16.
17.
18.
S#
student_no
19.
20.
Sage
student_age
21.
22.
Ssex
student_sex
23.
24.
25.
26.
表
Course
27.
28.
(C#,Cname,T#)
课程表
29.
30.
31.
C#
course_no
32.
33.
Cname
course_name
34.
35.
T#
teacher_no
36.
37.
38.
39.
40.
41.
42.
表
SC
(学生与课程的分数
mapping
43.
表)
44.
(S#,C#,score)
成绩表
45.
46.
47.
S#
student_no
48.
C#
course_no
49.
score
分数啦
50.
51.
52.
53.
54.
55.
56.
表
Teacher
57.
58.
(T#,Tname)
教师表
59.
60.
61.
T#
teacher_no
62.
Tname
teacher_name
63.
64.
65.
66.
67.
68.
69.
50
道问题开始
70.
71.
72.
73.
74.
75.
76.
1
、查询“001”课程比“002”课程成绩高的所有学生的学号;
77.
78.
79.
select
#
from
(select
s#,score
from
SC
where
ore
C#='001')
a,(select
s#,sc
80.
81.
82.
83.
84.
85.
86.
from
SC
where
C#='002')
where
>
and
#=#;
87.
88.
89.
90.
91.
2
、查询平均成绩大于
60
分的同学的学号和平均成绩;
92.
93.
select
S#,avg(score)
94.
95.
from
sc
96.
97.
group
by
S#
having
avg(score)
>60;
98.
99.
100.
101.
102.
3
、查询所有同学的学号、姓名、选课数、总成绩;
103.
104.
select
#,,count#),sum(score)
105.
106.
from
Student
left
Outer
join
SC
on
#=#
107.
108.
group
by
#,Sname
109.
110.
111.
112.
113.
4
、查询姓“李”的老师的个数;
114.
115.
select
count(distinct(Tname))
116.
117.
from
Teacher
118.
119.
where
Tname
like
'
李
%';
120.
121.
122.
123.
124.
5
、查询没学过“叶平”老师课的同学的学号、姓名;
125.
126.
select
#,
127.
128.
from
Student
129.
130.
where
S#
not
in
(select
distinct(
#)
fromSC,Course,Teacher
where
#=#and
#=#
='
叶平
');
131.
132.
133.
134.
135.
6
、查询学过“001”并且也学过编号“002”课程的同学的学号、姓名;
136.
137.
select
#,
fromStudent,SC
where
#=#
#='001'and
exists(
SC
as
SC_2
where
#=#
and
#='002');
Select
*
from
138.
139.
140.
141.
142.
7
、查询学过“叶平”老师所教的所有课的同学的学号、姓名;
143.
144.
select
S#,Sname
145.
146.
from
Student
147.
148.
where
S#
in
(select
S#
from
SC,Course
,Teacher
'
叶平
where
#=#
#=#
and
=
'group
by
S#
having
count#)=(select
count(C#)
fromCourse,Teacher
#=#
and
Tname='
叶平
'));
149.
150.
151.
152.
153.
8
、查询课程编号“002”的成绩比课程编号“001”课程低 的所有同学的学号、姓名;
154.
155.
Select
S#,Sname
from
(select
#,,score
,(select
score
from
SC
SC_2
wh
ere
#=#and
#='002')
score2
156.
157.
from
Student,SC
where
#=#
andC#='001')
S_2
where
score2
158.
159.
160.
9
、查询所有课程成绩小于
60
分的同学的学号、姓名;
161.
162.
select
S#,Sname
163.
164.
from
Student
165.
166.
where
S#
not
in
(select
#
fromStudent,SC
where
#=#
andscore>60);
167.
168.
169.
170.
171.
10
、查询没有学全所有课的同学的学号、姓名;
172.
173.
select
#,
174.
175.
from
Student,SC
176.
#=#
group
by
#,
having
count(C#)
<(select
);
count(C#)
from
Course
177.
178.
179.
180.
181.
182.
183.
11
、查询至少有一门课与学号为“1001”的同学所学相同的同学的学号和姓名;
184.
185.
186.
select
S#,Sname
from
Student,SC
#=#
and
C#
in
select
C#
where
S#='1001';
from
SC
187.
188.
189.
190.
191.
12
、查询至少学过学号为“001”同学所有一门课的其他同学学号和姓名;
192.
193.
select
distinct
#,Sname
194.
195.
from
Student,SC
196.
197.
where
#=#
and
C#
in(select
C#
from
SC
where
S#='001');
198.
199.
200.
201.
202.
13
、把“SC”表中“叶平”老师教的课的成绩都更改为此课程的平均成绩;
203.
204.
update
SC
set
score=(select
avg
205.
206.
from
SC
SC_2
207.
208.
where
#=#
)
fromCourse,Teacher
where
#=#
#=#
and
='
叶平
');
209.
210.
211.
212.
213.
14
、查询和“1002”号的同学学习的课程完全相同的其他同学学号和姓名;
214.
215.
select
S#
from
SC
where
C#
in(select
C#
from
SC
where
S#='1002'
)
216.
217.
group
by
S#
having
count(*)=(select
count(*)
from
SC
where
S#='10
02');
218.
219.
220.
221.
222.
15
、删除学习“叶平”老师课的
SC
表记录;
223.
224.
DelectSC
225.
226.
from
course
,Teacher
227.
228.
where
#=#
and
#=#
and
Tname='
叶平
';
229.
230.
231.
232.
233.
16
、向
SC
表中插入 一些记录,这些记录要求符合以下条件:没有上过编号“003”课程的同学
学
234.
235.
号、
2
号课的平均成绩;
236.
237.
Insert
SC
select
S#,'002',(Select
avg(score)
238.
239.
from
SC
where
C#='002')
from
Student
where
from
SC
where
C#='002');
S#
notin
(Select
S#
240.
241.
242.
243.
244.
17
、按平均成绩从高到低显示所有学生的“数据库”、“企业管理”、“英语”三门的课程成绩,按
245.
246.
如下形式显示:
247.
学生
ID,,
数据库
,
企业管理
,
英语
,
有效课程数
,
有效平均分
248.
249.
250.
251.
252.
253.
254.
SELECT
S#
as
学生
ID
,(SELECT
score
FROM
SC
WHERE
#=#AND
C#='004')
AS
数据
库
,(SELECT
score
FROM
SC
WHERE
#=#AND
C#='001')
AS
企业管
理
,(SELECT
score
FROM
SC
WHERE
#=#AND
C#='006')
AS
英
语
255.
256.
,COUNT(*)
AS
有效课程数
,
AVG
AS
平均成绩
257.
258.
FROM
SC
AS
t
259.
260.
GROUP
BY
S#
261.
262.
ORDER
BY
avg
263.
264.
265.
266.
267.
18
、查询各科成绩最高和最低的分:以如下形式显示 :课程
ID
,最高分,最低分
268.
269.
SELECT
#
As
课程
ID,
AS
最高分
,
AS
最低分
270.
271.
FROM
SC
L
,SC
AS
R
272.
273.
WHERE
#
=
#
and
274.
275.
=
(SELECT
MAX
276.
277.
FROM
SC
ASIL,Student
AS
IM
278.
279.
WHERE
#
=#
and
#=#
280.
281.
GROUP
#)
282.
283.
AND
284.
285.
=
(SELECT
MIN
286.
287.
FROM
SC
ASIR
288.
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
适合女生朗诵的诗歌-qq空间名
本文更新与2021-01-21 03:41,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/542100.html
-
上一篇:销售面试经典问题
下一篇:经典SQL面试题总结