<commit_before>---
title: SQL Inner Join Keyword
---

## SQL Inner Join Keyword

### Example of use
For this guide we'll discuss the SQL (INNER) Joins 

### Join (same as Inner Join)
The student table will be in the FROM clause so it will be a starting or LEFT table.

We'll JOIN this to the student contact table or RIGHT table.
You'll see that all of the students appear that ALSO are in the contact table.  As shown in the tables below, studentID 9 is in the student table but NOT in the contact table so won't appear in a join.

SQL Statement
```sql
SELECT a.studentID, a.FullName, a.programOfStudy,
b.`student-phone-cell`, b.`student-US-zipcode`
FROM student AS a
INNER JOIN `student-contact-info` AS b ON a.studentID = b.studentID;
```

"Joined" data
``` text
+-----------+------------------------+------------------+--------------------+--------------------+
| studentID | FullName               | programOfStudy   | student-phone-cell | student-US-zipcode |
+-----------+------------------------+------------------+--------------------+--------------------+
|         1 | <NAME>          | Literature       | 555-555-5551       |              97111 |
|         2 | <NAME>         | Programming      | 555-555-5552       |              97112 |
|         3 | <NAME>        | Programming      | 555-555-5553       |              97113 |
|         4 | <NAME>           | Programming      | 555-555-5554       |              97114 |
|         5 | <NAME>           | Programming      | 555-555-5555       |              97115 |
|         6 | <NAME>         | Programming      | 555-555-5556       |              97116 |
|         7 | <NAME> "Ted" Codd | Computer Science | 555-555-5557       |              97117 |
|         8 | <NAME>   | Computer Science | 555-555-5558       |              97118 |
+-----------+------------------------+------------------+--------------------+--------------------+
```
### Complete table listings for reference

Student table SQL

```sql
SELECT a.studentID, a.FullName, sat_score, a.programOfStudy, schoolEmailAdr 
FROM student AS a;
```

student or LEFT table
```text
+-----------+------------------------+-----------+------------------+------------------------+
| studentID | FullName               | sat_score | programOfStudy   | schoolEmailAdr         |
+-----------+------------------------+-----------+------------------+------------------------+
|         1 | <NAME>          |       400 | Literature       | <EMAIL> |
|         2 | <NAME>         |       800 | Programming      | <EMAIL>    |
|         3 | <NAME>        |      1000 | Programming      | <EMAIL> |
|         4 | <NAME>           |      1200 | Programming      | <EMAIL>   |
|         5 | <NAME>           |      1200 | Programming      | <EMAIL>   |
|         6 | <NAME>         |      1200 | Programming      | <EMAIL>  |
|         7 | <NAME> "Ted" Codd |      2400 | Computer Science | <EMAIL>   |
|         8 | <NAME>   |      2400 | Computer Science | <EMAIL>  |
|         9 | <NAME>       |      2400 | Computer Science | <EMAIL> |
+-----------+------------------------+-----------+------------------+------------------------+
9 rows in set (0.00 sec)


```sql
SELECT * FROM `student-contact-info` AS b;
```

student contact table or RIGHT table
``` text<commit_msg>Updated English SQL INNER JOIN Guide (#20479)<commit_after>---
title: SQL Inner Join Keyword
---

## SQL Inner Join Keyword

### Example of use
For this guide we'll discuss the SQL (INNER) Joins 

### Join (same as Inner Join)
The student table will be in the FROM clause so it will be a starting or LEFT table.

We'll JOIN this to the student contact table or RIGHT table.
You'll see that all of the students appear that ALSO are in the contact table.  As shown in the tables below, studentID 9 is in the student table but NOT in the contact table so won't appear in a join.

SQL Statement
```sql
SELECT a.studentID, a.FullName, a.programOfStudy,
b.`student-phone-cell`, b.`student-US-zipcode`
FROM student AS a
INNER JOIN `student-contact-info` AS b ON a.studentID = b.studentID;
```

"Joined" data
``` text
+-----------+------------------------+------------------+--------------------+--------------------+
| studentID | FullName               | programOfStudy   | student-phone-cell | student-US-zipcode |
+-----------+------------------------+------------------+--------------------+--------------------+
|         1 | <NAME>          | Literature       | 555-555-5551       |              97111 |
|         2 | <NAME>         | Programming      | 555-555-5552       |              97112 |
|         3 | <NAME>        | Programming      | 555-555-5553       |              97113 |
|         4 | <NAME>           | Programming      | 555-555-5554       |              97114 |
|         5 | <NAME>           | Programming      | 555-555-5555       |              97115 |
|         6 | <NAME>         | Programming      | 555-555-5556       |              97116 |
|         7 | <NAME> "Ted" Codd | Computer Science | 555-555-5557       |              97117 |
|         8 | <NAME>   | Computer Science | 555-555-5558       |              97118 |
+-----------+------------------------+------------------+--------------------+--------------------+
```
### Complete table listings for reference

Student table SQL

```sql
SELECT a.studentID, a.FullName, sat_score, a.programOfStudy, schoolEmailAdr 
FROM student AS a;
```

student or LEFT table
```text
+-----------+------------------------+-----------+------------------+------------------------+
| studentID | FullName               | sat_score | programOfStudy   | schoolEmailAdr         |
+-----------+------------------------+-----------+------------------+------------------------+
|         1 | <NAME>          |       400 | Literature       | <EMAIL> |
|         2 | <NAME>         |       800 | Programming      | <EMAIL>    |
|         3 | <NAME>        |      1000 | Programming      | <EMAIL> |
|         4 | <NAME>           |      1200 | Programming      | <EMAIL>   |
|         5 | <NAME>           |      1200 | Programming      | <EMAIL>   |
|         6 | <NAME>         |      1200 | Programming      | <EMAIL>  |
|         7 | <NAME> "Ted" Codd |      2400 | Computer Science | <EMAIL>   |
|         8 | <NAME>   |      2400 | Computer Science | <EMAIL>  |
|         9 | <NAME>       |      2400 | Computer Science | <EMAIL> |
+-----------+------------------------+-----------+------------------+------------------------+
9 rows in set (0.00 sec)
```

```sql
SELECT * FROM `student-contact-info` AS b;
```

student contact table or RIGHT table
``` text
{'fraction_non_alphanumeric': 0.2665455096168408, 'fraction_numerical': 0.05406633348477965, 'mean_word_length': 1.1011772192173084, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4816908', 'n_tokens_mistral': 1976, 'n_tokens_neox': 1653, 'n_words': 539}