第34天~还原资料库完.然後~

这篇的上一篇:https://ithelp.ithome.com.tw/articles/10283895

还原资料库完.
https://docs.microsoft.com/zh-tw/sql/samples/adventureworks-install-configure?view=sql-server-ver15&tabs=ssms
然後~

https://ithelp.ithome.com.tw/upload/images/20220207/20119035BzuYQsHNiP.png

随便打开一个资料表
https://ithelp.ithome.com.tw/upload/images/20220207/20119035YuAy1aVgl1.png

里面长这样
https://ithelp.ithome.com.tw/upload/images/20220207/2011903566P9QjMekl.png

看检视表-右键-新增检视

https://ithelp.ithome.com.tw/upload/images/20220207/20119035varBNCUwDc.png

可以看到的样子

https://ithelp.ithome.com.tw/upload/images/20220207/20119035jA7XATzKYv.png


要查询有多少资料表时.按右键-新增查询

https://ithelp.ithome.com.tw/upload/images/20220207/20119035TDSQNHyLao.png

要切到master查询-也可以下语法: USE master-也可以用拉的0.0

https://ithelp.ithome.com.tw/upload/images/20220207/20119035HF7iis8nJU.png

开始打入查询语法:SELECT * FROM SYS.DATABASES

https://ithelp.ithome.com.tw/upload/images/20220207/20119035VhU3grhwWA.png

按执行-可以看到所有的查询栏位

https://ithelp.ithome.com.tw/upload/images/20220207/201190356LqEIzjuNb.png

想要设定看到行号-工具-选项-

https://ithelp.ithome.com.tw/upload/images/20220207/20119035sB5gvMrkHv.png

然後找到-文字编辑器-所有语言

https://ithelp.ithome.com.tw/upload/images/20220207/20119035wuYomOsfIk.png

想要设定字大小-工具-选项-环境-字行和色彩

https://ithelp.ithome.com.tw/upload/images/20220207/201190356QsJPQpatQ.png
/images/emoticon/emoticon07.gif

资料表-关联式资料库

实体关系模型或实体联络模式图(ERD)(英语:Entity-relationship model)由美籍华人电脑科学家陈品山发明,是概念资料模型的高层描述所使用的资料模型或模式图。

要用微软官方范例
https://docs.microsoft.com/zh-tw/sql/samples/adventureworks-install-configure?view=sql-server-ver15&tabs=ssms

的话.要先设定-负责人.不然不能动

从资料表上按右键-属性

https://ithelp.ithome.com.tw/upload/images/20220207/20119035Lv80lQN4i0.png

然後填入-拥有者-这里填入sa(都可以)-确定
https://ithelp.ithome.com.tw/upload/images/20220207/20119035eaJ4YEZCaf.png

https://ithelp.ithome.com.tw/upload/images/20220207/20119035A6g796AJVL.png

然後再到资料库图表-右键-新增图表
https://ithelp.ithome.com.tw/upload/images/20220207/20119035zw5CwCKR7B.png

看到的画面-按是

https://ithelp.ithome.com.tw/upload/images/20220207/20119035hHMiTaQWZG.png

然後把所有资料表-选取(shift+滑鼠)-按"加入"
https://ithelp.ithome.com.tw/upload/images/20220207/20119035qdV6qav89s.png

然後就会看到後面开始~出现很多图表~超神奇!!!

/images/emoticon/emoticon24.gif

https://ithelp.ithome.com.tw/upload/images/20220207/20119035ILVW2Z6I1z.png

按CTRL+滑鼠中间=可以放大缩小-看到全貌

https://ithelp.ithome.com.tw/upload/images/20220207/20119035oKHATm5PgV.png

每个资料表-ERD

然後有的有关联~有的没有~

这篇写的超好~
https://rileylin91.github.io/2020/05/29/MSSQL-9-Primary-Foreign-Key/
Primary Key=PK=主索引键=主键-->钥匙

Foreign Key =FK=外部索引键=外(来)键
https://ithelp.ithome.com.tw/upload/images/20220207/20119035YKc4x2UTnU.png

这篇的下一篇:https://ithelp.ithome.com.tw/articles/10283913


<<:  gMSA 设定无密码的工作排程 (上 )

>>:  第35天~PK 及 FK~

Day.5 「我的样式失灵啦!你有头绪吗?」 —— CSS 选择器 与 权重

了解盒模型後,就要为标签套上各种花样了,上一篇介绍了简单的套用方法,但这个套用方法其实不太好用! ...

【领域展开 07 式】 Bluehost 与 WordPress 之间的操作秘笈

设定,绑定,就很 Pro 暨昨天在主机选择已经选择 Bluehost并购买好jadechang.bl...

解决xampp中mysql的admin介面打不开

下载後照着课程里的步骤开启了XAMPP 哀呀 结果开不起来@@ 错误讯息也一堆英文 GOOGLE到最...

Day 25 - Code Injection 与 SQL Injection

这篇写的东西年轻不懂事时其实有些曾踩到过,列在这提醒未来的自己不要再犯了 出於书本 Chapter...

【文字分析】3-4 TF-IDF文字概念

【文字分析】3-4 TF-IDF文字概念 说明 一种分析某单词在文章中重要程度公式 TF-IDF值与...