在CSDN中使用“Markdown编辑器”编辑“关系代数”

  1. 打开Markdown编辑器
  2. 复制第二行字符串,粘贴到markdown编辑器左边的“编辑区”;
  3. 编辑器右边的“预览区”可以看到第一行内容

两种表达方法:1 使用LaTeX;2 用Unicode。


选择:

σ s n o = 1 ( S t u d e n t ) \sigma_{sno = 1}(Student) σsno=1(Student)

$\sigma_{sno = 1}(Student)$

σsno=1(Student)

σ~sno=1~(Student)

σ s n o = 1 ∧ s a g e > 18 ∨ s s e x = " F " ( S t u d e n t ) \sigma_{sno = 1 \wedge sage >18 \vee ssex="F"}(Student) σsno=1sage>18ssex="F"(Student)

$\sigma_{sno = 1 \wedge sage >18 \vee ssex="F"}(Student)$

σsno=1∧sage>18∨ssex=“F” (Student)

σ~sno=1∧sage>18∨ssex="F"~ (Student)

投影:

Π s n o , c n o ( S t u d e n t ) \Pi_{sno,cno}(Student) Πsno,cno(Student)

$\Pi_{sno,cno}(Student)$

πsno,cno (Student)

π~sno,cno~ (Student)

连接:

S t u d e n t ⋈ S C Student \Join SC StudentSC

$Student \Join SC$

S t u d e n t ⋈ S C Student \bowtie SC StudentSC

$Student \bowtie SC$

Student ⋈ SC

Student⋈SC

S t u d e n t ⋈ S t u d e n t . S n o = S C . S n o S C Student \underset{Student.Sno=SC.Sno}\Join SC StudentStudent.Sno=SC.SnoSC

$Student \underset{Student.Sno=SC.Sno}\Join  SC$

外连接:

Student ⟗ SC

Student ⟗ SC

Student ⟕ SC

Student ⟕ SC

Student ⟖ SC

Student ⟖ SC

笛卡尔积:

S t u d e n t × S C Student \times SC Student×SC

$Student \times SC$

Student × SC

Student × SC

除:

S C ÷ K SC \div K SC÷K

$SC \div K$

SC ÷ K

SC ÷ K

并:

R ∪ S R \cup S RS

$R \cup S$

R∪S

R∪S

交:

R ∩ S R \cap S RS

$R \cap S$

R∩S

R∩S

差:

R − S R - S RS

$R - S$

R−S

R−S

综合例子:

Π S n a m e ( Π s n o ( σ C p n o = ′ 5 ′ ( C o u r s e ) ⋈ S C ) ⋈ Π S n o , S n a m e ( S t u d e n t ) ) \Pi_{Sname}(\Pi_{sno}(\sigma_{Cpno='5'}(Course)\Join SC)\Join \Pi_{Sno,Sname}(Student)) ΠSname(Πsno(σCpno=5(Course)SC)ΠSno,Sname(Student))

$\Pi_{Sname}(\Pi_{sno}(\sigma_{Cpno='5'}(Course)\Join SC)\Join \Pi_{Sno,Sname}(Student))$

πSnamesnoCpno=′5′(Course) ⋈ SC) ⋈ π Sno,Sname (Student))

π~Sname~ (π~sno~ (σ~Cpno=′5′~(Course) ⋈ SC) ⋈ π ~Sno,Sname~ (Student))

Ref:
https://www.caam.rice.edu/~heinken/latex/symbols.pdf
http://xahlee.info/comp/unicode_math_operators.html
https://tex.stackexchange.com/questions/20740/symbols-for-outer-joins/20746

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值