mirror of
https://github.com/andatoshiki/toshiki-notebook.git
synced 2026-06-06 04:34:16 +00:00
doc(cis105): add course lecture note for chapter 17 on more sql statement and clauses specifically with join & on query selector for table linking & add corresponded affiliated sidebar hyperlink component entry for quick access
This commit is contained in:
parent
37c8f26eb8
commit
150f2510de
@ -237,6 +237,10 @@ export const sidebar: DefaultTheme.Config['sidebar'] = {
|
|||||||
{
|
{
|
||||||
text: 'Lect 16: Information Technology Careers',
|
text: 'Lect 16: Information Technology Careers',
|
||||||
link: '/academic/cis105/cis105-l16-lecture-note'
|
link: '/academic/cis105/cis105-l16-lecture-note'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Lect 17: SQL Clauses: JOIN Query',
|
||||||
|
link: '/academic/cis105/cis105-l17-lecture-note'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
30
docs/academic/cis105/cis105-l17-lecture-note.md
Normal file
30
docs/academic/cis105/cis105-l17-lecture-note.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# CIS105: Computer Applications & Information Systems Lect. 17
|
||||||
|
|
||||||
|
## Chapter 17: SQL Clauses: `JOIN` Query
|
||||||
|
|
||||||
|
### 17.1: `JOIN` & `ON` Clauses
|
||||||
|
|
||||||
|
- `JOIN`: Join tables together to connect multiple fields into 1 query.
|
||||||
|
- `ON`: Linking the primary and foreign key
|
||||||
|
- Linking formula: `FROM table1 + JOIN table2 ON table1.primarykey = table2.foreignkey`
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT first_name, last_name, link_to_major, major_id, major_name
|
||||||
|
FROM member
|
||||||
|
JOIN major
|
||||||
|
ON member. link_to_major = major.major_id
|
||||||
|
```
|
||||||
|
|
||||||
|
### 17.2: SQL Statements: Primary vs. Foreign Keys
|
||||||
|
|
||||||
|
- Primary key: A field on a database table that uniquely identifies each row of the table.
|
||||||
|
- Foreign key: is used to combine the rows from one table wit the rows of another table.
|
||||||
|
|
||||||
|
### 17.3: SQL Statement: Date & Time Formatting
|
||||||
|
|
||||||
|
- The common conventional format of SQL date & time searching is as followed, in form of `YEAR-MONTH-DATT12:00:00`
|
||||||
|
|
||||||
|
- ```sql
|
||||||
|
'2022-04-17T12:00:00'
|
||||||
|
```
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user