Skip to content

Commit

Permalink
コードブロックの言語設定txtをhtmlに置き換え
Browse files Browse the repository at this point in the history
  • Loading branch information
alter334 committed Jun 12, 2024
1 parent 5607766 commit dfe5862
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
38 changes: 19 additions & 19 deletions docs/chapter1/section4/1_sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mysql> SHOW DATABASES;

以下のように出力されるはずです。

```txt
```html
+--------------------+
| Database |
+--------------------+
Expand Down Expand Up @@ -44,7 +44,7 @@ mysql> USE world;
mysql> SHOW TABLES;
```

```txt
```html
+-----------------+
| Tables_in_world |
+-----------------+
Expand All @@ -69,7 +69,7 @@ mysql> DESCRIBE city;
mysql> SHOW COLUMNS FROM city;
```

```txt
```html
+-------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+----------------+
Expand All @@ -96,7 +96,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/getting-information.html
mysql> SELECT Name, Population FROM city;
```

```txt
```html
+-----------------------------------+------------+
| Name | Population |
+-----------------------------------+------------+
Expand All @@ -123,7 +123,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/select.html
mysql> SELECT * FROM city;
```

```txt
```html
+------+-----------------------------------+-------------+----------------------+------------+
| ID | Name | CountryCode | District | Population |
+------+-----------------------------------+-------------+----------------------+------------+
Expand All @@ -148,7 +148,7 @@ mysql> SELECT * FROM city;
mysql> SELECT * FROM city LIMIT 5;
```

```txt
```html
+----+----------------+-------------+---------------+------------+
| ID | Name | CountryCode | District | Population |
+----+----------------+-------------+---------------+------------+
Expand All @@ -169,7 +169,7 @@ mysql> SELECT * FROM city LIMIT 5;
mysql> SELECT * FROM city LIMIT 5 OFFSET 10;
```

```txt
```html
+----+-----------+-------------+---------------+------------+
| ID | Name | CountryCode | District | Population |
+----+-----------+-------------+---------------+------------+
Expand All @@ -190,7 +190,7 @@ mysql> SELECT * FROM city LIMIT 5 OFFSET 10;
mysql> SELECT * FROM city WHERE Population >= 8000000;
```

```txt
```html
+------+-------------------+-------------+------------------+------------+
| ID | Name | CountryCode | District | Population |
+------+-------------------+-------------+------------------+------------+
Expand All @@ -212,7 +212,7 @@ mysql> SELECT * FROM city WHERE Population >= 8000000;
mysql> SELECT * FROM city WHERE CountryCode = "JPN" AND Population > 5000000;
```

```txt
```html
+------+-------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+------+-------+-------------+----------+------------+
Expand All @@ -229,7 +229,7 @@ mysql> SELECT * FROM city WHERE CountryCode = "JPN" AND Population > 5000000;
SELECT * FROM city WHERE Population >= 8000000 ORDER BY Population DESC;
```

```txt
```html
+------+-------------------+-------------+------------------+------------+
| ID | Name | CountryCode | District | Population |
+------+-------------------+-------------+------------------+------------+
Expand Down Expand Up @@ -258,7 +258,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/sorting-rows.html
mysql> SELECT * FROM city WHERE District IN ("Kagawa", "Tokushima", "Ehime", "Kochi");
```

```txt
```html
+------+-----------+-------------+-----------+------------+
| ID | Name | CountryCode | District | Population |
+------+-----------+-------------+-----------+------------+
Expand Down Expand Up @@ -286,7 +286,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/comparison-operators.html#operator_in
mysql> DESCRIBE countrylanguage;
```

```txt
```html
+-------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
Expand All @@ -304,7 +304,7 @@ mysql> DESCRIBE countrylanguage;
mysql> SELECT country.Name, countrylanguage.Language FROM country JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.Language = "Chinese";
```

```txt
```html
+--------------------------+----------+
| Name | Language |
+--------------------------+----------+
Expand Down Expand Up @@ -348,7 +348,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/join.html
mysql> SELECT Name, District AS Prefecture FROM city WHERE CountryCode = "JPN";
```

```txt
```html
+---------------------+------------+
| Name | Prefecture |
+---------------------+------------+
Expand Down Expand Up @@ -388,7 +388,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/problems-with-alias.html
mysql> SELECT COUNT(*) FROM city WHERE CountryCode = "JPN";
```

```txt
```html
+----------+
| count(*) |
+----------+
Expand All @@ -408,7 +408,7 @@ https://dev.mysql.com/doc/refman/8.0/ja/aggregate-functions.html#function_count
SELECT CountryCode, COUNT(*) FROM city GROUP BY CountryCode;
```

```txt
```html
+-------------+----------+
| CountryCode | COUNT(*) |
+-------------+----------+
Expand Down Expand Up @@ -444,7 +444,7 @@ mysql> INSERT INTO city (Name, CountryCode, District, Population) VALUES ("oooka
mysql> SELECT * FROM city ORDER BY ID DESC LIMIT 1;
```

```txt
```html
+------+-----------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+------+-----------+-------------+----------+------------+
Expand All @@ -465,7 +465,7 @@ mysql> UPDATE city SET Population = 9999 WHERE ID = 4080;
mysql> SELECT * FROM city WHERE ID = 4080;
```

```txt
```html
+------+-----------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+------+-----------+-------------+----------+------------+
Expand All @@ -491,7 +491,7 @@ mysql> DELETE FROM city WHERE ID = 4080;
mysql> SELECT * FROM city WHERE ID = 4080;
```

```txt
```html
Empty set (0.00 sec)
```

Expand Down
30 changes: 15 additions & 15 deletions docs/chapter1/section4/2_sql_exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SELECT * FROM country WHERE Name = "Japan";

**出力**

```txt
```html
+------+-------+-----------+--------------+-------------+-----------+------------+----------------+------------+------------+--------------+-------------------------+-------------+---------+-------+
| Code | Name | Continent | Region | SurfaceArea | IndepYear | Population | LifeExpectancy | GNP | GNPOld | LocalName | GovernmentForm | HeadOfState | Capital | Code2 |
+------+-------+-----------+--------------+-------------+-----------+------------+----------------+------------+------------+--------------+-------------------------+-------------+---------+-------+
Expand All @@ -40,7 +40,7 @@ SELECT * FROM country WHERE IndepYear <= 0;

**出力**

```txt
```html
+------+----------+-----------+----------------+-------------+-----------+------------+----------------+------------+------------+--------------+-------------------------+----------------+---------+-------+
| Code | Name | Continent | Region | SurfaceArea | IndepYear | Population | LifeExpectancy | GNP | GNPOld | LocalName | GovernmentForm | HeadOfState | Capital | Code2 |
+------+----------+-----------+----------------+-------------+-----------+------------+----------------+------------+------------+--------------+-------------------------+----------------+---------+-------+
Expand All @@ -65,7 +65,7 @@ SELECT Name, Population FROM country WHERE Continent = "Asia" ORDER BY Populatio

**出力**

```txt
```html
+------------+------------+
| Name | Population |
+------------+------------+
Expand All @@ -92,7 +92,7 @@ SELECT * FROM country ORDER BY Population DESC LIMIT 5 OFFSET 10;

**出力**

```txt
```html
+------+-------------+---------------+-----------------+-------------+-----------+------------+----------------+------------+------------+-------------+----------------------+-------------------------+---------+-------+
| Code | Name | Continent | Region | SurfaceArea | IndepYear | Population | LifeExpectancy | GNP | GNPOld | LocalName | GovernmentForm | HeadOfState | Capital | Code2 |
+------+-------------+---------------+-----------------+-------------+-----------+------------+----------------+------------+------------+-------------+----------------------+-------------------------+---------+-------+
Expand All @@ -119,7 +119,7 @@ SELECT COUNT(*) AS Japanese FROM countrylanguage WHERE Language = "Japanese";

**出力**

```txt
```html
+----------+
| Japanese |
+----------+
Expand All @@ -142,7 +142,7 @@ SELECT Continent, COUNT(*) FROM country GROUP BY Continent;

**出力**

```txt
```html
+---------------+----------+
| Continent | COUNT(*) |
+---------------+----------+
Expand Down Expand Up @@ -173,7 +173,7 @@ SELECT country.Name AS Country, city.Name AS Capital FROM country JOIN city ON c

**出力**

```txt
```html
+---------------------------------------+------------------------------------+
| Country | Capital |
+---------------------------------------+------------------------------------+
Expand Down Expand Up @@ -212,7 +212,7 @@ SELECT * FROM country WHERE Continent IN ("North America", "South America");

**出力**

```txt
```html
+------+----------------------------------+---------------+-----------------+-------------+-----------+------------+----------------+------------+------------+-------------------------------------+----------------------------------------------+--------------------------------------+---------+-------+
| Code | Name | Continent | Region | SurfaceArea | IndepYear | Population | LifeExpectancy | GNP | GNPOld | LocalName | GovernmentForm | HeadOfState | Capital | Code2 |
+------+----------------------------------+---------------+-----------------+-------------+-----------+------------+----------------+------------+------------+-------------------------------------+----------------------------------------------+--------------------------------------+---------+-------+
Expand Down Expand Up @@ -254,7 +254,7 @@ SELECT * FROM country WHERE Name = "traP";

**出力**

```txt
```html
+------+------+-----------+--------------+-------------+-----------+------------+----------------+------+--------+-----------+-------------------------+-------------+---------+-------+
| Code | Name | Continent | Region | SurfaceArea | IndepYear | Population | LifeExpectancy | GNP | GNPOld | LocalName | GovernmentForm | HeadOfState | Capital | Code2 |
+------+------+-----------+--------------+-------------+-----------+------------+----------------+------+--------+-----------+-------------------------+-------------+---------+-------+
Expand Down Expand Up @@ -285,7 +285,7 @@ SELECT * FROM country WHERE Code = "TRP";

**出力**

```txt
```html
+------+------+-----------+--------------+-------------+-----------+------------+----------------+------+--------+-----------+-------------------------+-------------+---------+-------+
| Code | Name | Continent | Region | SurfaceArea | IndepYear | Population | LifeExpectancy | GNP | GNPOld | LocalName | GovernmentForm | HeadOfState | Capital | Code2 |
+------+------+-----------+--------------+-------------+-----------+------------+----------------+------+--------+-----------+-------------------------+-------------+---------+-------+
Expand Down Expand Up @@ -314,7 +314,7 @@ SELECT * FROM country WHERE Code = "TRP";

**出力**

```txt
```html
Empty set (0.00 sec)
```

Expand All @@ -336,7 +336,7 @@ SELECT country.Name, city.Name FROM country LEFT JOIN city ON country.Code = cit

**出力**

```txt
```html
+----------------------------------------------+-----------------------------------+
| Name | Name |
+----------------------------------------------+-----------------------------------+
Expand Down Expand Up @@ -376,7 +376,7 @@ SELECT RANK() OVER (ORDER BY Population DESC) AS Ranking, Name, Population FROM

**出力**

```txt
```html
+---------+--------------------+------------+
| Ranking | Name | Population |
+---------+--------------------+------------+
Expand Down Expand Up @@ -412,7 +412,7 @@ SELECT Name, Continent, Region, Population FROM country WHERE Code = (SELECT Cou

**出力**

```txt
```html
+---------+-----------+----------------+------------+
| Name | Continent | Region | Population |
+---------+-----------+----------------+------------+
Expand Down Expand Up @@ -442,7 +442,7 @@ ORDER BY Speakers DESC LIMIT 10;

**出力**

```txt
```html
+---------+------------+------------------+
| Ranking | Language | Speakers |
+---------+------------+------------------+
Expand Down
6 changes: 3 additions & 3 deletions docs/chapter1/section4/3_go_and_db.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export DB_DATABASE="world"

今回は手元で動いているデータベースを使うのでパスワードなどが知られても問題ありませんが、実際には環境変数など外部の人に知られたくない、GitHub などに上げたくないファイルもあります。そのような場合は、`.gitignore`というファイルを使うことで特定のファイルやフォルダを Git 管理の対象外にできます。`.gitignore`ファイルの最後に`.env`を追記しましょう。

```txt
```html
...
# Go workspace file
go.work
Expand Down Expand Up @@ -76,7 +76,7 @@ $ go run main.go

出力はこのようになります。

```txt
```html
connected
Tokyoの人口は7980230人です
```
Expand Down Expand Up @@ -124,7 +124,7 @@ $ go run main.go {都市の名前}
<<< @/chapter1/section4/src/select.go#main{27 go:line-numbers}
以下のように日本の都市一覧を取得できます。

```txt
```html
connected
日本の都市一覧
都市名: Tokyo, 人口: 7980230
Expand Down

0 comments on commit dfe5862

Please sign in to comment.