当前位置:首页 > 热点热搜 > 正文

sql是什么_sql是什么语言

本篇文章给大家谈谈sql是什么,以及sql是什么语言对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

sql是什么

SQL是英文Structured Query Language的缩写形式,它的意思是表示结构化查询语言。SQL语言的主要功能就是同各种数据库建立联系。此外,SQL是被当成为关系型数据库管理系统的标准语言。其是由Microsoft开发和推广的关系数据库管理系统。

扩展资料:

SQL Server的特点如下:

1、具有真正的客户机和服务器体系结构。

2、图形化用户界面,使系统管理和数据库管理更加直观。

3、丰富的编程接口工具,为用户进行程序设计提供了更大的选择余地。

4、其完全集成,利用了NT的许多功能,如发送和接受消息等。

参考资料:SqlServer-百度百科

sql是什么意思

SQL(Structured Query Language)是具有数据操纵和数据定义等多种功能的数据库语言。

SQL语言具有交互性特点,能为用户提供极大的便利,数据库管理系统应充分利用SQL语言提高计算机应用系统的工作质量与效率。SQL语言不仅能独立应用于终端,还可以作为子语言为其他程序设计提供有效助力,该程序应用中,SQL可与其他程序语言一起优化程序功能,进而为用户提供更多更全面的信息。

SQL作为一种操作命令集, 以其丰富的功能受到业内人士的广泛欢迎, 成为提升数据库操作效率的保障。SQL Server数据库的应用,能够有效提升数据请求与返回的速度,有效应对复杂任务的处理,是提升工作效率的关键。

SQL语言操作

1、数据定义:定义数据库的逻辑结构,包括定义数据库、基本表、视图和索引4部分。

2、数据操纵:包括插入、删除和更新三种操作。

3、数据查询:包括数据查询操作。

4、数据控制:对用户访问数据的控制有基本表和视图的授权及回收。

5、事务控制:包括事务的提交与回滚。

6、嵌入式SQL语言的使用规定:规定SQL语句在宿主语言的程序中使用的规则。

什么是sql

分类: 电脑/网络 程序设计 其他编程语言

问题描述:

sql在access的用法

解析:

SQL是一种结构化查询语言即Structure Query Language

一般格式:

SELECT[DISTINCT]目标列表达式…

FROM表名,查询名……

[WHERE 条件表达式]

[GROUP BY列名1[HAVING条件表达式]

[ORDER BY列名2[ASC│DESC];

SELECT SNAME,SDEPT FROM STUDENT

SELECT SNO,CNO FROM 查询1

SELECT * FROM STUDENT

SELECT DISTINCT SNO FROM SC

SELECT SNAME,SAGE FROM STUDENT WHERE SDEPT='CS'

WHERE SAGE NOT BETWEEN 10 AND 18

'',"";

BETWEEN #1978-01-01# AND #1980-12-31#

*,?,#

'' ""

IN NOT IN

WHERE SDEPT IN('CS','IS'); SDEPT='CS' OR SEPT='IS'

LIKE *,?,#

SELECT * FROM STUDENT WHERE SNAME LIKE '刘?'

SAGE LIKE '1#'

1按学生成绩降序排序,成绩相同按课程号排序

select * from sc order by grade desc,o

2安课程号排序,课程号相同按成绩将需排列

IS NULL,IS NOT NULL

SELECT SNO,CNO FROM SC WHERE GRADE IS NULL

count(*),count(CNO),sum(),avg(),min(),max()

select count(*) from sc

select o,count(*) from sc group by o

and or not

select sname ,2003-sage as 出生年份 from student

SELECT SC.SNO,SNAME,CNO FROM STUDENT,SC WHERE STUDENT.SNO=SC.SNO

SELECT C1.CNO,C2.CPNO FROM COURSE C1,COURSE C2 WHERE C1.CPNO=C2.CNO

LEFT JOIN RIGHT JOIN

SELECT course.*, sc.*

FROM course LEFT JOIN sc ON courseo = sco;

SELECT SNAME+SDEPT AS SNSD FROM STUDENT

1查询信息系年龄在18到20之间的学生信息

SELECT *

FROM STUDENT

WHERE SDEPT='IS'AND SAGE BETWEEN 18 AND 20;

2查询每门课程相应的选课人数

SELECT CNO,COUNT(SNO)

FROM SC

GROUP BY CNO;

SELECT COUNT(*) FROM SC

3查询每个学生不及格课程门数

SELECT CNO,COUNT(CNO)

FROM SC

WHERE GRADE60

GROUP BY SNO

4查询成绩在90到100份之间的每门课程的选修人数

SELECT CNO, COUNT( SNO)

FROM SC

WHERE GRADE BETWEEN 90 AND 100

GROUP BY CNO ;

5查询姓名第二个字是“力”的学生姓名和所在系

SELECT SNAME,SDEPT

FROM STUDENT

WHERE SNAME LIKE "?力*";

6查询没有成绩的学生学号和对应的课程号

SELECT SNO,CNO

FROM SC

WHERE GRADE IS NULL;

7查询数学系和信息系所有男学生的情况

SELECT *

FROM STUDENT

WHERE SDEPT ="IS" OR SDEPT= "MA" AND SSEX="男";

8查询总成绩大于200分的学生学号

SELECT SNO

FROM SC

GROUP BY SNO HAVING SUM(GRADE)200;

SELECT * FROM SC ORDER BY SNO ,GRADE DESC

1.SELECT ENO,ENAME FROM EMP,WORKS WHERE

CMP.ENO=WORKS.ENO,SEX='男',AGE50

2.SELECT ENO,ENAME FROM EMP ,WORKS WHERE SALARY1000 AND EMP.ENO=WORKS.ENO

3.SELECT ENO,ENAME FROM EMP,COMP,WORKS WHERE CNAME="LHGS" AND WORKS.CNO=COMP.CNO AND EMP.ENO=WORKS.ENO

4.SELECT ENO,ENAME FROM EMP,COMP,WORKS WHERE WORKS.CNO=COMP.CNO AND EMP.ENO=WORKS.ENO AND SEX='M'AND CNAME='LHGS' AND SALARY1000

left join right jion

select * from student left join sc on studnt.sno=sc.sno

#1987-10-01#

1、select distinct sno from sc where grade60

2 select * from student where sdept in('cs','is')

select * from student where sdept='cs' or sdept='is'

3 select sno,sname,sage from student where sage beeen 10 and 19

=10 and =19

like '1#'

4 select sname ,sdept from student where sname like '?力*'

5 select sno from sc where grade is not null

子查询

概念:

分类:

引导谓词:select from where sage(select sage from student where sdept='cs')

,=,

查询和刘晨同在一个系学习的学生

SELECT S1.* FROM STUDENT S1,STUDENT S2 WHERE S2.SNAME='刘晨' AND S1.SDEPT=S2.SDEPT

SELECT *

FROM STUDENT

WHERE SDEPT=

(SELECT SDEPT

FROM STUDENT

WHERE SNAME='刘晨')

select sname from student where sdept=(select sdept from student where sname='刘晨')

in

查询选修了数据库课程的学生的姓名和所在系

SELECT SNAME,SDEPT

FROM STUDENT

WHERE SNO IN

( SELECT SNO

FROM SC

WHERE CNO IN

(SELECT CNO

FROM COURSE

WHERE CNAME='数据库'))

select sname ,sdept

from student

where sno in

(select sno

from sc

where o=

(select o

from course

where ame='数据库'))

select sname ,sdept

from student,sc,course

where student.sno=sc.sno and sco=courseo and ame='数据库'

查询其他系比信息系任一学生年龄小的学生情况

any,all

any大于子查询结果中的某个值(min()大于最小值)

all大于子查询结果中的所有值(max()大于最大值)

any小于子查询结果中的某个值(max()小于最大值)

all小于子查询结果中的所有值(min()小于最小值)

SELECT *

FROM STUDENT

WHERE SAGE(SELECT max(SAGE)

FROM STUDENT WHERE SDEPT='IS')

AND SDEPT'IS'

select sname

from student

where sage any(select sage from student where sdept='is') and sdept 'is'

*** 查询

并(UNION)、交、差

查询既选修了1号课程又选修了2号课程的学生学号。

SELECT SNO FROM SC WHERE CNO=1 AND SNO IN(SELECT SNO FROM SC WHERE CNO=2)

exists

网络班

查询选修了全部课程的学生姓名

select sname

from student

where sno in

(select sno

from sc

group by sno having count(*)=

(select count(*)

from course) )

使用EXISTS

SELECT SNAME

FROM STUDENT

WHERE NOT EXISTS

(SELECT *

FROM COURSE

WHERE NOT EXISTS

(SELECT *

FROM SC

WHERE SNO=STUDENT.SNO

AND CNO=COURSE.CNO))

查询至少选修了01001选修的全部课程的学生号码

select sno from sc where o in(select o from sc where sno=01001) group by sno having count(*)=(select count(*) from sc where sno=01001)

SELECT SNAME FROM STUDENT

WHERE SNO IN(SELECT SNO FROM SC WHERE CNO IN(SELECT CNO FROM COURSE WHERE CNAME='数据库'))

更新查询

插入(INSERT INTO)

INSERT INTO STUDENT VALUES(95033,'','IS','男',19)

INSERT INTO C1(CPNO,CNAME)

SELECT CPNO,CNAME FROM COURSE WHERE CNO IN(1,2)

INSERT INTO SC1(SNO,CNO)

SELECT SNO,CNO FROM STUDENT,COURSE

修改(UPDATE)

UPDATE SC SET GRADE=0 WHERE 'IS'=(SELECT SDEPT FROM STUDENT WHERE SNO=SC.SNO )

删除(DELETE)

DELETE FROM C1

DELETE FROM SC WHERE 'IS' =(SELECT SDEPT FROM STUDENT WHERE SNO=SC.SNO)

UPDATE STUDENT SET SNO=95030 WHERE SNO=95004

关于sql是什么和sql是什么语言的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

发表评论