- 打开Markdown编辑器;
- 复制第二行字符串,粘贴到markdown编辑器左边的“编辑区”;
- 编辑器右边的“预览区”可以看到第一行内容。
两种表达方法: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=1∧sage>18∨ssex="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 Student⋈SC
$Student \Join SC$
S t u d e n t ⋈ S C Student \bowtie SC Student⋈SC
$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.Sno⋈SC
$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 R∪S
$R \cup S$
R∪S
R∪S
交:
R ∩ S R \cap S R∩S
$R \cap S$
R∩S
R∩S
差:
R − S R - S R−S
$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))$
πSname (πsno (σCpno=′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