From 67e29156c5a39da850c85b97cc0266d8098dbe63 Mon Sep 17 00:00:00 2001 From: GuanM <30427262+sxhoio@users.noreply.github.com.> Date: Tue, 19 Nov 2024 15:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E7=9A=84=E5=88=9B=E5=BB=BA=E5=92=8C=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../视图的创建和使用/1. 数据库视图的创建和使用.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 数据库/头歌/视图的创建和使用/1. 数据库视图的创建和使用.sh diff --git a/数据库/头歌/视图的创建和使用/1. 数据库视图的创建和使用.sh b/数据库/头歌/视图的创建和使用/1. 数据库视图的创建和使用.sh new file mode 100644 index 0000000..aedf5dd --- /dev/null +++ b/数据库/头歌/视图的创建和使用/1. 数据库视图的创建和使用.sh @@ -0,0 +1,18 @@ +USE studentdb +go + +SET NOCOUNT ON +go + +--********** create score_view_cdept **********-- +--********** Begin **********-- +CREATE VIEW score_view_cdept AS +SELECT s.sno, s.name, c.cname, sc.grade +FROM Student s +JOIN Score sc ON s.sno = sc.sno +JOIN Course c ON sc.cno = c.cno; +--********** End **********-- +go + + +