一个标准的项目SQL应用范例

MySQL与标准SQL的区别 我们试图使MySQL Server遵循ANSI SQL标准和ODBC SQL标准,但MySQL Server在某些情况下执行不同的操作:MySQL和标准SQL特权系统之间有一些区别。例如,在MySQL中,删除表时不会自动撤销表的特权。您必须显式发出REVOKE来撤销表的特权。CASTCAST()函数不支持强制转换为REAL或BIGINT。 阅读详情

--1.学生表
Student(S#,Sname,Sage,Ssex) --S# 学生编号,Sname 学生姓名,Sage 出生年月,Ssex 学生性别
--2.课程表
Course(C#,Cname,T#) --C# --课程编号,Cname 课程名称,T# 教师编号
--3.教师表
Teacher(T#,Tname) --T# 教师编号,Tname 教师姓名
--4.成绩表
SC(S#,C#,score) --S# 学生编号,C# 课程编号,score 分数

--创建测试数据
create table Student(S# varchar(10),Sname nvarchar(10),Sage datetime,Ssex nvarchar(10))
insert into Student values('01' , N'赵雷' , '1990-01-01' , N'男')
insert into Student values('02' , N'钱电' , '1990-12-21' , N'男')
insert into Student values('03' , N'孙风' , '1990-05-20' , N'男')
insert into Student values('04' , N'李云' , '1990-08-06' , N'男')
insert into Student values('05' , N'周梅' , '1991-12-01' , N'女')
create table Course(C# varchar(10),Cname nvarchar(10),T# varchar(10))
insert into Course values('01' , N'语文' , '02')
insert into Course values('02' , N'数学' , '01')
insert into Course values('03' , N'英语' , '03')
create table Teacher(T# varchar(10),Tname nvarchar(10))
insert into Teacher values('01' , N'张三')
insert into Teacher values('02' , N'李四')
insert into Teacher values('03' , N'王五')
create table SC(S# varchar(10),C# varchar(10),score decimal(18,1))
insert into SC values('01' , '01' , 80)
insert into SC values('01' , '02' , 90)
insert into SC values('01' , '03' , 99)
insert into SC values('02' , '01' , 70)
insert into SC values('02' , '02' , 60)
insert into SC values('02' , '03' , 80)
insert into SC values('03' , '01' , 80)
insert into SC values('03' , '02' , 80)
insert into SC values('03' , '03' , 80)
insert into SC values('04' , '01' , 50)
insert into SC values('04' , '02' , 30)
insert into SC values('04' , '03' , 20)
insert into SC values('05' , '01' , 76)
insert into SC values('05' , '02' , 87)
insert into SC values('06' , '01' , 31)
insert into SC values('06' , '03' , 34)
insert into SC values('07' , '02' , 89)
insert into SC values('07' , '03' , 98)
go

--1、查询"01"课程比"02"课程成绩高的学生的信息及课程分数
--
1.1、查询同时存在"01"课程和"02"课程的情况
select a.* , b.score [课程'01'的分数],c.score [课程'02'的分数] from Student a , SC b , SC c
where a.S# = b.S# and a.S# = c.S# and b.C# = '01' and c.C# = '02' and b.score > c.score
--1.2、查询同时存在"01"课程和"02"课程的情况和存在"01"课程但可能不存在"02"课程的情况(不存在时显示为null)(以下存在相同内容时不再解释)
select a.* , b.score [课程"01"的分数],c.score [课程"02"的分数] from Student a
left join SC b on a.S# = b.S# and b.C# = '01'
left join SC c on a.S# = c.S# and c.C# = '02'
where b.score > isnull(c.score,0)

--2、查询"01"课程比"02"课程成绩低的学生的信息及课程分数
--
2.1、查询同时存在"01"课程和"02"课程的情况
select a.* , b.score [课程'01'的分数],c.score [课程'02'的分数] from Student a , SC b , SC c
where a.S# = b.S# and a.S# = c.S# and b.C# = '01' and c.C# = '02' and b.score < c.score
--2.2、查询同时存在"01"课程和"02"课程的情况和不存在"01"课程但存在"02"课程的情况
select a.* , b.score [课程"01"的分数],c.score [课程"02"的分数] from Student a
left join SC b on a.S# = b.S# and b.C# = '01'
left join SC c on a.S# = c.S# and c.C# = '02'
where isnull(b.score,0) < c.score

--3、查询平均成绩大于等于60分的同学的学生编号和学生姓名和平均成绩
select a.S# , a.Sname , cast(avg(b.score) as decimal(18,2)) avg_score
from Student a , sc b
where a.S# = b.S#
group by a.S# , a.Sname
having cast(avg(b.score) as decimal(18,2)) >= 60
order by a.S#

--4、查询平均成绩小于60分的同学的学生编号和学生姓名和平均成绩
--
4.1、查询在sc表存在成绩的学生信息的SQL语句。
select a.S# , a.Sname , cast(avg(b.score) as decimal(18,2)) avg_score
from Student a , sc b
where a.S# = b.S#
group by a.S# , a.Sname
having cast(avg(b.score) as decimal(18,2)) < 60
order by a.S#
--4.2、查询在sc表中不存在成绩的学生信息的SQL语句。
select a.S# , a.Sname , isnull(cast(avg(b.score) as decimal(18,2)),0) avg_score
from Student a left join sc b
on a.S# = b.S#
group by a.S# , a.Sname
having isnull(cast(avg(b.score) as decimal(18,2)),0) < 60
order by a.S#

--5、查询所有同学的学生编号、学生姓名、选课总数、所有课程的总成绩
--
5.1、查询所有有成绩的SQL。
select a.S# [学生编号], a.Sname [学生姓名], count(b.C#) 选课总数, sum(score) [所有课程的总成绩]
from Student a , SC b
where a.S# = b.S#
group by a.S#,a.Sname
order by a.S#
--5.2、查询所有(包括有成绩和无成绩)的SQL。
select a.S# [学生编号], a.Sname [学生姓名], count(b.C#) 选课总数, sum(score) [所有课程的总成绩]
from Student a left join SC b
on a.S# = b.S#
group by a.S#,a.Sname
order by a.S#

--6、查询"李"姓老师的数量
--
方法1
select count(Tname) ["李"姓老师的数量] from Teacher where Tname like N'李%'
--方法2
select count(Tname) ["李"姓老师的数量] from Teacher where left(Tname,1) = N'李'
/*
"李"姓老师的数量  
-----------
1
*/

--7、查询学过"张三"老师授课的同学的信息
select distinct Student.* from Student , SC , Course , Teacher
where Student.S# = SC.S# and SC.C# = Course.C# and Course.T# = Teacher.T# and Teacher.Tname = N'张三'
order by Student.S#

--8、查询没学过"张三"老师授课的同学的信息
select m.* from Student m where S# not in (select distinct SC.S# from SC , Course , Teacher where SC.C# = Course.C# and Course.T# = Teacher.T# and Teacher.Tname = N'张三') order by m.S#

--9、查询学过编号为"01"并且也学过编号为"02"的课程的同学的信息
--
方法1
select Student.* from Student , SC where Student.S# = SC.S# and SC.C# = '01' and exists (Select 1 from SC SC_2 where SC_2.S# = SC.S# and SC_2.C# = '02') order by Student.S#
--方法2
select Student.* from Student , SC where Student.S# = SC.S# and SC.C# = '02' and exists (Select 1 from SC SC_2 where SC_2.S# = SC.S# and SC_2.C# = '01') order by Student.S#
--方法3
select m.* from Student m where S# in
(
 
select S# from
  (
   
select distinct S# from SC where C# = '01'
   
union all
   
select distinct S# from SC where C# = '02'
  ) t
group by S# having count(1) = 2
)
order by m.S#

--10、查询学过编号为"01"但是没有学过编号为"02"的课程的同学的信息
--
方法1
select Student.* from Student , SC where Student.S# = SC.S# and SC.C# = '01' and not exists (Select 1 from SC SC_2 where SC_2.S# = SC.S# and SC_2.C# = '02') order by Student.S#
--方法2
select Student.* from Student , SC where Student.S# = SC.S# and SC.C# = '01' and Student.S# not in (Select SC_2.S# from SC SC_2 where SC_2.S# = SC.S# and SC_2.C# = '02') order by Student.S#

--11、查询没有学全所有课程的同学的信息
--
11.1、
select Student.*
from Student , SC
where Student.S# = SC.S#
group by Student.S# , Student.Sname , Student.Sage , Student.Ssex having count(C#) < (select count(C#) from Course)
--11.2
select Student.*
from Student left join SC
on Student.S# = SC.S#
group by Student.S# , Student.Sname , Student.Sage , Student.Ssex having count(C#) < (select count(C#) from Course)

--12、查询至少有一门课与学号为"01"的同学所学相同的同学的信息
select distinct Student.* from Student , SC where Student.S# = SC.S# and SC.C# in (select C# from SC where S# = '01') and Student.S# <> '01'

--13、查询和"01"号的同学学习的课程完全相同的其他同学的信息
select Student.* from Student where S# in
(
select distinct SC.S# from SC where S# <> '01' and SC.C# in (select distinct C# from SC where S# = '01')
group by SC.S# having count(1) = (select count(1) from SC where S#='01'))

--14、查询没学过"张三"老师讲授的任一门课程的学生姓名
select student.* from student where student.S# not in
(
select distinct sc.S# from sc , course , teacher where sc.C# = course.C# and course.T# = teacher.T# and teacher.tname = N'张三')
order by student.S#

--15、查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩
select student.S# , student.sname , cast(avg(score) as decimal(18,2)) avg_score from student , sc
where student.S# = SC.S# and student.S# in (select S# from SC where score < 60 group by S# having count(1) >= 2)
group by student.S# , student.sname

--16、检索"01"课程分数小于60,按分数降序排列的学生信息
select student.* , sc.C# , sc.score from student , sc
where student.S# = SC.S# and sc.score < 60 and sc.C# = '01'
order by sc.score desc 

--17、按平均成绩从高到低显示所有学生的所有课程的成绩以及平均成绩
--
17.1 SQL 2000 静态
select a.S# 学生编号 , a.Sname 学生姓名 ,
      
max(case c.Cname when N'语文' then b.score else null end) [语文],
      
max(case c.Cname when N'数学' then b.score else null end) [数学],
      
max(case c.Cname when N'英语' then b.score else null end) [英语],
      
cast(avg(b.score) as decimal(18,2)) 平均分
from Student a
left join SC b on a.S# = b.S#
left join Course c on b.C# = c.C#
group by a.S# , a.Sname
order by 平均分 desc
--17.2 SQL 2000 动态
declare @sql nvarchar(4000)
set @sql = 'select a.S# ' + N'学生编号' + ' , a.Sname ' + N'学生姓名'
select @sql = @sql + ',max(case c.Cname when N'''+Cname+''' then b.score else null end) ['+Cname+']'
from (select distinct Cname from Course) as t
set @sql = @sql + ' , cast(avg(b.score) as decimal(18,2)) ' + N'平均分' + ' from Student a left join SC b on a.S# = b.S# left join Course c on b.C# = c.C#
group by a.S# , a.Sname order by
' + N'平均分' + ' desc'
exec(@sql)
--17.3 有关sql 2005的动静态写法参见我的文章《普通行列转换(version 2.0)》或《普通行列转换(version 3.0)》。

 

--18、查询各科成绩最高分、最低分和平均分:以如下形式显示:课程ID,课程name,最高分,最低分,平均分,及格率,中等率,优良率,优秀率
--
及格为>=60,中等为:70-80,优良为:80-90,优秀为:>=90
--
方法1
select m.C# [课程编号], m.Cname [课程名称],
 
max(n.score) [最高分],
 
min(n.score) [最低分],
 
cast(avg(n.score) as decimal(18,2)) [平均分],
 
cast((select count(1) from SC where C# = m.C# and score >= 60)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [及格率(%)],
 
cast((select count(1) from SC where C# = m.C# and score >= 70 and score < 80 )*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [中等率(%)],
 
cast((select count(1) from SC where C# = m.C# and score >= 80 and score < 90 )*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [优良率(%)],
 
cast((select count(1) from SC where C# = m.C# and score >= 90)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [优秀率(%)]
from Course m , SC n
where m.C# = n.C#
group by m.C# , m.Cname
order by m.C#
--方法2
select m.C# [课程编号], m.Cname [课程名称],
  (
select max(score) from SC where C# = m.C#) [最高分],
  (
select min(score) from SC where C# = m.C#) [最低分],
  (
select cast(avg(score) as decimal(18,2)) from SC where C# = m.C#) [平均分],
 
cast((select count(1) from SC where C# = m.C# and score >= 60)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [及格率(%)],
 
cast((select count(1) from SC where C# = m.C# and score >= 70 and score < 80 )*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [中等率(%)],
 
cast((select count(1) from SC where C# = m.C# and score >= 80 and score < 90 )*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [优良率(%)],
 
cast((select count(1) from SC where C# = m.C# and score >= 90)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [优秀率(%)]
from Course m
order by m.C#

--19、按各科成绩进行排序,并显示排名
--
19.1 sql 2000用子查询完成
--
Score重复时保留名次空缺
select t.* , px = (select count(1) from SC where C# = t.C# and score > t.score) + 1 from sc t order by t.c# , px
--Score重复时合并名次
select t.* , px = (select count(distinct score) from SC where C# = t.C# and score >= t.score) from sc t order by t.c# , px
--19.2 sql 2005用rank,DENSE_RANK完成
--
Score重复时保留名次空缺(rank完成)
select t.* , px = rank() over(partition by c# order by score desc) from sc t order by t.C# , px
--Score重复时合并名次(DENSE_RANK完成)
select t.* , px = DENSE_RANK() over(partition by c# order by score desc) from sc t order by t.C# , px

--20、查询学生的总成绩并进行排名
--
20.1 查询学生的总成绩
select m.S# [学生编号] ,
       m.Sname
[学生姓名] ,
      
isnull(sum(score),0) [总成绩]
from Student m left join SC n on m.S# = n.S#
group by m.S# , m.Sname
order by [总成绩] desc
--20.2 查询学生的总成绩并进行排名,sql 2000用子查询完成,分总分重复时保留名次空缺和不保留名次空缺两种。
select t1.* , px = (select count(1) from
(
 
select m.S# [学生编号] ,
         m.Sname
[学生姓名] ,
        
isnull(sum(score),0) [总成绩]
 
from Student m left join SC n on m.S# = n.S#
 
group by m.S# , m.Sname
) t2
where 总成绩 > t1.总成绩) + 1 from
(
 
select m.S# [学生编号] ,
         m.Sname
[学生姓名] ,
        
isnull(sum(score),0) [总成绩]
 
from Student m left join SC n on m.S# = n.S#
 
group by m.S# , m.Sname
) t1
order by px

select t1.* , px = (select count(distinct 总成绩) from
(
 
select m.S# [学生编号] ,
         m.Sname
[学生姓名] ,
        
isnull(sum(score),0) [总成绩]
 
from Student m left join SC n on m.S# = n.S#
 
group by m.S# , m.Sname
) t2
where 总成绩 >= t1.总成绩) from
(
 
select m.S# [学生编号] ,
         m.Sname
[学生姓名] ,
        
isnull(sum(score),0) [总成绩]
 
from Student m left join SC n on m.S# = n.S#
 
group by m.S# , m.Sname
) t1
order by px
--20.3 查询学生的总成绩并进行排名,sql 2005用rank,DENSE_RANK完成,分总分重复时保留名次空缺和不保留名次空缺两种。
select t.* , px = rank() over(order by [总成绩] desc) from
(
 
select m.S# [学生编号] ,
         m.Sname
[学生姓名] ,
        
isnull(sum(score),0) [总成绩]
 
from Student m left join SC n on m.S# = n.S#
 
group by m.S# , m.Sname
) t
order by px

select t.* , px = DENSE_RANK() over(order by [总成绩] desc) from
(
 
select m.S# [学生编号] ,
         m.Sname
[学生姓名] ,
        
isnull(sum(score),0) [总成绩]
 
from Student m left join SC n on m.S# = n.S#
 
group by m.S# , m.Sname
) t
order by px

--21、查询不同老师所教不同课程平均分从高到低显示
select m.T# , m.Tname , cast(avg(o.score) as decimal(18,2)) avg_score
from Teacher m , Course n , SC o
where m.T# = n.T# and n.C# = o.C#
group by m.T# , m.Tname
order by avg_score desc

--22、查询所有课程的成绩第2名到第3名的学生信息及该课程成绩
--
22.1 sql 2000用子查询完成
--
Score重复时保留名次空缺
select * from (select t.* , px = (select count(1) from SC where C# = t.C# and score > t.score) + 1 from sc t) m where px between 2 and 3 order by m.c# , m.px
--Score重复时合并名次
select * from (select t.* , px = (select count(distinct score) from SC where C# = t.C# and score >= t.score) from sc t) m where px between 2 and 3 order by m.c# , m.px
--22.2 sql 2005用rank,DENSE_RANK完成
--
Score重复时保留名次空缺(rank完成)
select * from (select t.* , px = rank() over(partition by c# order by score desc) from sc t) m where px between 2 and 3 order by m.C# , m.px
--Score重复时合并名次(DENSE_RANK完成)
select * from (select t.* , px = DENSE_RANK() over(partition by c# order by score desc) from sc t) m where px between 2 and 3 order by m.C# , m.px

--23、统计各科成绩各分数段人数:课程编号,课程名称,[100-85],[85-70],[70-60],[0-60]及所占百分比
--
23.1 统计各科成绩各分数段人数:课程编号,课程名称,[100-85],[85-70],[70-60],[0-60]
--
横向显示
select Course.C# [课程编号] , Cname as [课程名称] ,
 
sum(case when score >= 85 then 1 else 0 end) [85-100],
 
sum(case when score >= 70 and score < 85 then 1 else 0 end) [70-85],
 
sum(case when score >= 60 and score < 70 then 1 else 0 end) [60-70],
 
sum(case when score < 60 then 1 else 0 end) [0-60]
from sc , Course
where SC.C# = Course.C#
group by Course.C# , Course.Cname
order by Course.C#
--纵向显示1(显示存在的分数段)
select m.C# [课程编号] , m.Cname [课程名称] , 分数段 = (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end) ,
 
count(1) 数量
from Course m , sc n
where m.C# = n.C#
group by m.C# , m.Cname , (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end)
order by m.C# , m.Cname , 分数段
--纵向显示2(显示存在的分数段,不存在的分数段用0显示)
select m.C# [课程编号] , m.Cname [课程名称] , 分数段 = (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end) ,
 
count(1) 数量
from Course m , sc n
where m.C# = n.C#
group by all m.C# , m.Cname , (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end)
order by m.C# , m.Cname , 分数段

--23.2 统计各科成绩各分数段人数:课程编号,课程名称,[100-85],[85-70],[70-60],[<60]及所占百分比
--
横向显示
select m.C# 课程编号, m.Cname 课程名称,
  (
select count(1) from SC where C# = m.C# and score < 60) [0-60],
 
cast((select count(1) from SC where C# = m.C# and score < 60)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [百分比(%)],
  (
select count(1) from SC where C# = m.C# and score >= 60 and score < 70) [60-70],
 
cast((select count(1) from SC where C# = m.C# and score >= 60 and score < 70)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [百分比(%)],
  (
select count(1) from SC where C# = m.C# and score >= 70 and score < 85) [70-85],
 
cast((select count(1) from SC where C# = m.C# and score >= 70 and score < 85)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [百分比(%)],
  (
select count(1) from SC where C# = m.C# and score >= 85) [85-100],
 
cast((select count(1) from SC where C# = m.C# and score >= 85)*100.0 / (select count(1) from SC where C# = m.C#) as decimal(18,2)) [百分比(%)]
from Course m
order by m.C#
--纵向显示1(显示存在的分数段)
select m.C# [课程编号] , m.Cname [课程名称] , 分数段 = (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end) ,
 
count(1) 数量 , 
 
cast(count(1) * 100.0 / (select count(1) from sc where C# = m.C#) as decimal(18,2)) [百分比(%)]
from Course m , sc n
where m.C# = n.C#
group by m.C# , m.Cname , (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end)
order by m.C# , m.Cname , 分数段
--纵向显示2(显示存在的分数段,不存在的分数段用0显示)
select m.C# [课程编号] , m.Cname [课程名称] , 分数段 = (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end) ,
 
count(1) 数量 , 
 
cast(count(1) * 100.0 / (select count(1) from sc where C# = m.C#) as decimal(18,2)) [百分比(%)]
from Course m , sc n
where m.C# = n.C#
group by all m.C# , m.Cname , (
 
case when n.score >= 85 then '85-100'
      
when n.score >= 70 and n.score < 85 then '70-85'
      
when n.score >= 60 and n.score < 70 then '60-70'
      
else '0-60'
 
end)
order by m.C# , m.Cname , 分数段

 

SQL SERVER项目案例(sql代码) SQL SERVER项目案例SQL SERVER项目案例SQL SERVER项目案例 立即下载

相关推荐

[程序源代码]SQL Server 2008数据库项目案例教程

[程序源代码]SQL Server 2008数据库项目案例教程,代码

SQL实例整理

本文适合将w3school的SQL教程(http://www.w3school.com.cn/sql/sql_create_table.asp)都基本看过一遍的猿友阅读。 说说博主的情况吧。毕业找工作之前确实有大概看过w3school的SQL教程,然后参加校园招聘,每次遇到一些SQL笔试题,立马懵逼了(大写的)。其实我那时候大概知道怎么写的,只是总是写不正确,或者是对一些特定...

weixin_30781775的博客 744

10个项目实战项目源码、数据库

前两天在第三极买了一本书,关于项目实战的。内容包括10个网站实例代码,项目名称如下: 1. 供求信息网;2.电子商务平台;3.小区物业内部管理网;4.图书馆管理系统;5.企业办公自动化系统;6.互动媒体学习社区;7.在线考试网;8.网上在线论坛;9物流信息管理平台;10.博客管理系统

SQL语句的经典语句50例

转载: http://blog.youkuaiyun.com/chuyuqing/article/details/8953260 一个项目涉及到的50个Sql语句(整理版) --1.学生表 Student(S,Sname,Sage,Ssex) --S 学生编号,Sname 学生姓名,Sage 出生年月,Ssex 学生性别 --2.课程表  Course(C,Cname,T) --C --

franktan2010的专栏 761

10个常见的数据库工程项目分析案例

在工程项目中各个案例非常丰富,种类繁多,但只要在分析案例时注重调研分析,以用户需求为中心,利用数据库设计的理论指导,定能较好的建立符合你项目的数据模型。为了使数据库研发人员更好的学习数据库,现提供了10个常见的数据库工程项目分析案例。

数据库 商城项目 真实案例

数据库 商城项目 真实案例 数据库 商城项目 真实案例 数据库 商城项目 真实案例

SQL经典实例

文档通过大量实例展示了SQL在数据操作中的核心技术,从基础查询到高级聚合、字符串处理、元数据查询等,覆盖多数据库差异,强调实际应用中的最佳实践(如处理Null值、避免笛卡儿积、合理使用索引等)。每个实例结合问题、解决方案和讨论,帮助读者理解不同场景下的SQL策略,是SQL开发和优化的重要参考。

weixin_39789796的博客 2260

FPGA控制DDR读写(AXI4总线接口)

FPGA控制DDR读写

qq_42712308的博客 1万+

SQL的一些常见案例

本书第﹖版以最新的Ubuntu 12.04为版本,循序渐进地向读者介绍了Linux 的基础应用、系统管理、网络应用、娱乐和办公、程序开发、服务器配置、系统安全等。在如 MySQL 不支持开窗函数时,可以用第二种方法——自连接,用表a控制求和的位置,用表b的x求和(只用一个表就统一都是截至某行的sum值了,必须要自连接)需要《Linux入门到精通》、《linux系统移植》、《Linux驱动开发入门实战》、《Linux开源网络全栈》电子书籍及教程的工程师朋友们劳烦您转发+评论。这里的假设需要ID是连续的。

2401_86402111的博客 1227

正交试验-方差分析-数据展现形式

方差分析(ANOVA, Analysis of Variance)用于比较多个组之间的均值差异,确定因素对响应变量的显著性影响。示例分析。

m0_58326994的博客 1971

【智慧城市】GIS数据获取-获取道路/水路数据

【GIS数据获取】获取道路/水路数据

qq_16599281的博客 4751

SQL实例项目

USE master--指向当前所操作的数据库 GO --检测master系统数据库的视中sysdatabases中是否存在MyLibrary的记录 IF EXISTS(SELECT * FROM sysdatabases WHERE name='MyLibrary') DROP DATABASE MyLibrary --如果存在将其删除 GO CREATE DATABASE MyLibrary--创建MyLibrary数据库 ON PRIMARY ( NAME='MyLibrary_data',...

qq_28776313的博客 1065

避坑指南:STM32移植CanFestival时那些没人告诉你的细节(含TJA1050硬件适配)

本文深入解析STM32移植CanFestival协议栈时的关键细节与TJA1050硬件适配技巧,涵盖AVR残留代码清理、定时器中断优化及CAN通信稳定性提升方案。特别针对TJA1050在特定波特率下的信号畸变问题提供实战解决方案,帮助开发者规避移植过程中的隐形陷阱,实现工业级稳定通信。

work3的博客 762

标准SQL

SQL是Structured Query Language的缩写,它的前身是著名的关系数据库原型系统System R所采用的SEQUEL语言。作为一种访问关系型数据库的标准语言,SQL自问世以来得到了广泛的应用,不仅是著名的大型商用数据库产品Oracle、DB2、Sybase、SQL Server支持它,很多开源的数据库产品如PostgreSQL、MySQL也支持它,甚至一些小型的产...

心有猛虎细嗅蔷薇 5101

ICS v9.5 OverbyteIcsWSocket.pas 整体架构分析

核心架构:OverbyteIcsWSocket.pas 是 Internet Component Suite (ICS) 的基础网络组件单元,提供跨平台 Winsock API 封装,支持TCP/UDP 客户端/服务器,DNS 解析和Raw Socket。在 v9.5 中,SSL/TLS 代码已分离至 OverbyteIcsSslBase.pas 等单元,使核心单元更精简,专注于非加密 socket 操作。

sonadorje的专栏 994

28-3 文件上传漏洞 -白盒审计绕过

这行代码是用来获取文件名中最后一个点(.)后的部分,也就是文件的后缀名。这个函数会返回以最后一个点(.)开始到字符串末尾的部分,包括点(.)本身。然而,这段代码存在一个潜在的安全风险。攻击者可以利用多个点(.)来构造恶意文件名,以绕过后缀名检查。切换到bp将抓到的上传请求发送到重发器然后改包。先上传一个普通的php文件然后使用bp抓包。

weixin_43263566的博客 392

SQL 92 标准

        项目终于结束了,总结的时候到了... hehe :)        在项目中我们遇到了很多的问题,标准SQL使用就是其中一个。 因为我们在做BI package的时候,一开始都是基于MS SQL 来做的,所以Universe的设计上也没有太多的考虑。 当后来老大告诉我偶们要同时release 一个基于 Oracle 的版本时,我们才发现问题来了。 因为在Universe里面我们

YoYo-Eva的专栏 1万+

知识图谱中的 Ontology(本体论)

1980年,本体论(Ontology)哲学概念“本体”被引入到人工智能领域用来刻画知识。本体概念模型、明确、形式化、共享。本体是实体存在形式的描述,往往表示为一组概念定义和概念之间的层级关系,本体框架形式树状结构,通常被用来为知识图谱定义schema。如人、公司、车等都可以在具体场景下称为本体。Ontology是(特定领域)信息组织的一种形式,是领域知识规范的抽象和描述,是表达、共享、重用知识的方法。Ontology。

全网粉丝30W+,优快云、稀土掘金人工智能领域签约作者,人工智能、大模型、Python 爬虫,商务合作,请私信沟通。 2036

SQL标准有哪些?由那个国际组织管理?国产数据库在SQL标准上的贡献有哪些?

SQL标准由ANSI和ISO联合制定,经历了SQL-86、SQL-89、SQL-92、SQL:1999、SQL:2003、SQL:2006、SQL:2008、SQL:2011、SQL:2016、SQL:2019和SQL:2023等版本演进,从基础查询发展为支持复杂分析、事务管理、高级数据类型的完整体系。不同数据库对标准的支持存在差异,但标准为跨数据库互操作提供了基础。常见的SQL操作包括SELECT查询、INSERT插入、UPDATE更新、DELETE删除等,可用于处理订单表、订单明细表等业务数据。理解SQ

软件行业技术文化交流。 2293

DeepSeek 赋能招投标全流程智能化:多模态解析、知识图谱与投标文件自动生成实战指南(附完整代码与行业案例)

摘要:本文深入探讨DeepSeek技术在招投标领域的全流程智能化应用,通过整合自然语言处理(NLP)、多模态解析、知识图谱等核心技术,实现招标文件智能解析与投标文件自动生成。文中详细解析DeepSeek-R1模型的多模态处理机制、动态知识图谱构建方法及智能模板填充算法,通过完整代码实现展示技术细节。结合广某资源交易平台、山西XX"XX云"等典型案例,验证技术方案在提升招投标效率、降低人为错误方面的显著效果。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 1464

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

【SQL国际标准】ISO/IEC 9075:2023 系列SQL的国际标准详情

《SQL国际标准》系列(ISO/IEC 9075:2023)详细介绍了SQL标准的最新发展。这一系列标准旨在为数据库语言SQL的设计和使用提供指导。其中包括各种部分,涵盖了SQL的不同方面,从框架、基础到支持外部数据管理的扩展,再到与多维数组和Java编程语言的结合。这些标准为企业和开发者提供了统一的规范,确保了SQL应用的互操作性和可移植性,促进了数据库技术的发展。

朝花夕拾 2946

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

一文介绍SQL标准1986~2023的演变

SQL标准1986年制定第一版,到最新的2023版,已经有38年的历史,现在依然是计算机非常活跃的语言,50%的程序员都能掌握SQL,数据分析师也是SQL的主要使用人员之一。从早期的基本语法,到融合了XML、JSON等复杂数据类型,存储过程标准,元数据标准等等等,SQL语言规范发生巨大的变化,。

云原生智能数据管理平台 2560

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Sql标准梳理

SQL(Structured Query Language)是一种用于管理关系型数据库管理系统(RDBMS)的标准化语言。SQL标准由国际标准化组织(ISO)和美国国家标准化组织(ANSI)制定和维护,旨在提供一种统一的方式来管理和操作数据库。SQL标准通常分为不同的级别,包括:SQL核心标准:包含最基本和最常用的SQL功能,如数据查询、插入、更新和删除等操作。这些功能是所有SQL数据库管理系统共同支持的基本功能。SQL扩展标准:在核心标准的基础上增加了一些额外的功能和特性,如存储过程、触发器、视图、事务控

XiaoCai 2410

SQL标准的历史

SQL标准已经存在30多年了,它改变了吗?绝对的!了解从SQL-86到现代SQL(当今的标准数据语言)的过程。SQL是IBM在20世纪70年代由IBM公司创建的。1974年,Donald Chamberlin和Raymond Boyce发表了SEQUEL:《A Structured English Query Language》,将SQL引入了世界。这篇文章包含了该语言的BNF语法(对该语言语法的详细技术描述),IBM后来认为这是一个错误。该语法的发布允许不同的供应商在他们自己的数据库引擎中实现SQL。

机修邦项目组 2317

【SQL 语言】标准总览

1974 年,IBM 的科研人员和在论文《SEQUEL: A Structured English Query Language》中首次介绍了SQL语言(当时的名称叫做 SEQUEL),他们的这项成功是建立在“黄金十二定律”的基础上,但相比十二定律中的数学化定义,SEQUEL 更易于使用,它采用了简单的关键字语法,使普通用户无需具备深厚的数学背景也可操作关系数据库;从左到右依次为 Edgar F. Codd、Don Chamberlin 和 Raymond Boyce。

Hominid_Pro的博客 1275

新人学习笔记-SQL的ANSI标准

SQL(STructured Query Language)是一种资料库查询和程式设计语言,用於存取资料以及查询、更新和管理关联式资料库系统。美国国家标準局(ANSI)与国际标準化组织(ISO)已经制定了 SQL 标準。ANSI 是一个美国工业和商业集团组织,发展美国的商务和通讯标準。ANSI 同时也是 ISO 和 International Electrotechnical Commission

News_chapter的博客 7359
上一篇: 麻木的IT公民:293个公司人压力和心理调查
下一篇: 我能抽象出整个世界
后海
博客等级 码龄18年 176粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值