准备数据:
CREATE TABLE Student( Sno INT(11) auto_increment PRIMARY KEY, Sname VARCHAR(20), Ssex VARCHAR(20), Sage INT(3), Sdept VARCHAR(20)); CREATE TABLE Course( Cno INT(11) auto_increment PRIMARY KEY, Cname VARCHAR(20), Cpno INT(11) REFERENCES Course(Cno), Ccredit INT(2)); CREATE TABLE SC( Sno INT(11) REFERENCES Student(Sno), Cno INT(11) REFERENCES Course(Cno), Grade FLOAT(3), PRIMARY KEY(Sno,Cno)); INSERT INTO Student VALUES(95001,"李勇","男",20,"CS"); INSERT INTO Student VALUES(95003,"王名","男",20,"MA"); INSERT INTO Student VALUES(95002,"刘晨","男",19,"IS"); INSERT INTO Student VALUES(95004,"张立","男",18,"IS"); INSERT INTO Student VALUES(95006,"牛德华","女",20,"IS"); INSERT INTO Student VALUES(95005,"聂小轩","男",28,"CS"); INSERT INTO Student VALUES(95007,"张三三","男",18,"CS"); INSERT INTO Student VALUES(95008,"李思思","女",16,"MA"); INSERT INTO Student VALUES(95009,"张呜呜","男",19,"MA"); INSERT INTO Course VALUES(1,"数据库",5,4); INSERT INTO Course VALUES(2,"数学",null,2); INSERT INTO Course VALUES(3,"信息系统",1,4); INSERT INTO Course VALUES(4,"操作系统",6,3); INSERT INTO Course VALUES(5,"数据结构",7,4); INSERT INTO Course VALUES(6,"数据处理",null,2); INSERT INTO Course VALUES(7,"PASCAL语言",6,4); INSERT INTO Course VALUES(8,"C_C++语言",null,4); INSERT INTO SC VALUES(95001,1,60); INSERT INTO SC VALUES(95002,1,90); INSERT INTO SC VALUES(95001,2,80); INSERT INTO SC VALUES(95002,2,99); INSERT INTO SC VALUES(95002,3,45); INSERT INTO SC VALUES(95001,4,40); INSERT INTO SC VALUES(95002,4,88); INSERT INTO SC VALUES(95004,4,null); INSERT INTO SC VALUES(95005,4,45); INSERT INTO SC VALUES(95002,5,88); INSERT INTO SC VALUES(95003,5,89); INSERT INTO SC VALUES(95005,5,54); INSERT INTO SC VALUES(95001,6,82); INSERT INTO SC VALUES(95004,6,null); INSERT INTO SC VALUES(95005,6,99.5); INSERT INTO SC VALUES(95003,7,99); INSERT INTO SC VALUES(95004,7,45); INSERT INTO SC VALUES(95005,7,75); INSERT INTO SC VALUES(95006,1,60); INSERT INTO SC VALUES(95006,4,90);
练习题
# 查询与“刘晨”同一个系学习的学生 SELECT sno,sname FROM student WHERE sdept = (SELECT sdept FROM student WHERE sname = "刘晨"); SELECT s1.sno,s1.sname FROM student s1 JOIN student s2 ON s1.Sdept = s2.Sdept WHERE s2.sname="刘晨"; SELECT s1.sno,s1.sname FROM student s1 ,student s2 WHERE s1.Sdept = s2.Sdept AND s2.sname="刘晨"; # 查询选修了课程名为‘信息系统’的学生学号和姓名 SELECT student.sno,sname FROM student, sc, course WHERE student.sno = sc.sno AND course.cno = sc.cno AND course.cname = '信息系统'; SELECT sno,sname FROM student WHERE sno IN (SELECT sno FROM sc WHERE cno IN (SELECT cno FROM course WHERE cname='信息系统')); # 查询其他系中比IS系任一学生年龄小的学生名单。 SELECT sname,sage FROM student WHERE Sdept <> 'IS' AND Sage < ANY(SELECT sage FROM student WHERE Sdept = 'IS'); SELECT sname,sage FROM student WHERE Sdept <> 'IS' AND Sage < (SELECT MAX(sage) FROM student WHERE Sdept = 'IS'); # 查询其他系中比IS系所有学生年龄都小的学生名单。 SELECT sname,sage FROM student WHERE Sdept <> 'IS' AND Sage < ALL(SELECT sage FROM student WHERE Sdept = 'IS'); # 组函数比ANY ALL要高效。 SELECT sname,sage FROM student WHERE Sdept <> 'IS' AND Sage < (Select MIN(Sage) FROM student WHERE Sdept = 'IS');
相关推荐
这是marked的流行库的分支(从chjj / release-0.3.7,2017年12月1日合并合并请求#961)。 郎 目录 安装 npm install @ts-stack/markdown --save 用法 最少使用量: import { Marked } from '@ts-stack/markdown' ...
标题中的"marked-0.3.2-1.zip"表明这是一个软件库的压缩包,标记为"marked"的版本0.3.2的第一个修正版。Marked通常是一个文本解析库,用于将Markdown语法转换为HTML,它在开发文档、博客和网站中非常常见。Markdown...
npm i -g marked-toc --save 在任何降价文件中,添加<!-- toc -->要添加 TOC 的位置。 然后在命令行中,运行: toc [filename] 如果您将 toc 添加到README.md ,则无需添加[filename] ,只需运行toc 。 ...
const linkify = require ( "marked-linkify-it" ) ; // or ES Module script // import marked from "https://cdn.jsdelivr.net/gh/markedjs/marked/lib/marked.esm.js"; // import linkify from ...
Chapter 1, PL/SQL Packages describes how and when you should create packages and explains why PL/SQL developers should learn to center their entire development process around packages Chapter 2, Best...
标记形式 ... 从诸如[text ?input?](name)类的markdown链接生成标签和输入控件。 安装 npm install marked-forms 重大变化 从v3.0.0版本开始,该库使用插件api。...var markedForms = require ( 'marked-forms' )
var mdRenderer = require ( 'marked-to-md' ) ; var source = '# Markdown to md renderer\nHello world!' ; var tokens = marked . lexer ( source ) ; var mdToMd = parser . parse ( tokens ) ; console . log ...
totalshare2java.zip,一种提供基于常用的OAuth2的第三个网站登录功能的工具。一种提供基于常用的OAuth2的第三个网站登录功能的工具。
marked-engine是兼容的模板引擎,用于呈现Markdown。 安装 $ npm install marked-engine 用法 将marked-engine注册marked-engine扩展名为“ .md”的文件的模板引擎。 app . engine ( 'md' , require ( 'marked-...
1. 安装插件:通过npm(Node.js包管理器)在Hexo项目中安装插件,命令通常是`npm install hexo-renderer-marked-plus --save`。 2. 配置插件:在Hexo的配置文件 `_config.yml` 中,将渲染器设置为`hexo-renderer-...
本项目是一款基于marked和highlight.js开发的Markdown编辑器,专为Vue项目设计。接下来,我们将深入探讨这款编辑器的关键技术和实现细节。 **一、Markdown语法** Markdown是一种轻量级的标记语言,它的设计理念是...
npm install marked marked-terminal 例子 var marked = require ( 'marked' ) ; var TerminalRenderer = require ( 'marked-terminal' ) ; marked . setOptions ( { // Define custom renderer renderer : new ...
安装npm install marked-images用法注意:重大更改: 从 ,该库使用插件api。 var marked = require ( 'marked' ) ;var markedImages = require ( 'marked-images' ) ;// opts are optionalvar opts = { xhtml : ...
$ npm install --save marked-sanitizer-github 用法 它输出一类SanitizeState因为该清理是有状态的。 您可以通过调用getSanitizer()方法来为标记的解析器获取一个消毒剂。 它返回一个要清除的函数对象。 con
描述中提到"标记元素仅与聚合物0.5及更低版本兼容,将不推荐使用",这表明marked-element最初是为 Polymer 0.5 设计的,随着Polymer框架的发展,尤其是从0.5版本升级到0.8及更高版本时,这个元素可能不再是最优选择...
涉及的步骤如下:$ git clone https://github.com/code-plus-coffee/marked-preview.git$ cd marked-preview# NPM$ npm install or npm i# OR# Yarn$ yarn# After npm install is done$ npm start 现在可以在访问...
演示版<h2>Basic marked-calendar Demo</h2><h3>Demo</h3><marked-calendar year="2020" title="Imputacion de horas" savedata weekends legend='[ {"code": "#0F0", "label": "V", "title": "Vacaciones"}, {...