user4183: On analyzing my games, I found that I usually miss tactics in the opening than during middlegame and endgame. To supplement my study by solving tactical problems based on motifs, it would be helpful if I understand the key motifs I must stress on. Hence the question below.
Based on different tactical motifs like fork, pin, deflection, double-attack, etc. what is the most common tactical motif during the opening phase statistically?

user15049: The Lichess categorization of tactical motifs is not bad, but these are not common tactical motifs of the opening phase, in my opinion. They describe motifs which happen in the final phase of the game.
I created a GitHub repository where I have put some CQL scripts which I used to search for the motifs I consider typical in the opening phase. The first twenty moves were considered. I searched in a GM database containing 370,000 games. The database is contained in the repo.
The results are listed in a table, and the matching games can be found in the folder named output.
You can download or fork this repo and play around with those scripts. You can also run them on your own PGN databases.
Happy chess research :-)

user4418: During all standard / book openings tactical motifs which win material don't feature. They wouldn't be book openings if they did. That rules out forks, deflections, double attacks, etc. and leaves only pins.
As it happens pins are very common and feature sooner or later in a lot of openings but they only win material if the player with the pinned piece lets something else go wrong. Usually the pinned piece is a knight pinned by a bishop against king or queen and usually the player with the pinned piece has the opportunity to break the pin with a bishop move or force the pinning bishop away with a couple of pawn moves.
I think you are wasting your time looking at tactical motifs in standard openings, i.e. in openings which are played properly. What you really need to do as a priority is look at what tactical motifs you miss in your own games. As a second priority you need to improve your knowledge of the openings you personally play. The openings I play or which are played most often generally are no use to you if you don't play them.
You need to be familiar not just with pages of moves and analysis. Much more useful is to be familiar with the ideas behind the openings you play. You need to be familiar and comfortable with the kinds of positions which arise from those openings and know how to handle them.
That way you are much less likely to make tactical mistakes playing moves that go against the ideas of your favoured openings. That way, too, you are more likely to spot when your opponent makes a move which doesn't "fit in" with the ideas of the opening and which may be some kind of "hope chess" trap. Then you are more likely to avoid falling into it and maybe even taking advantage of your opponent's deviation.

user8154: Opening puzzles
On Lichess it's possible to train opening related puzzles:
https://lichess.org/training/opening
Puzzles for other phases of the game are available as well:
https://lichess.org/training/themes
Keep in mind, that the puzzle selection will be only as good as the votes given by Lichess users. Also, as far as I know, it's not possible to select specific openings.
Statistics
Because of a question by @BCLC in the comments I found this link, where you can download all Lichess puzzles. I made a little table based on all puzzles tagged with "opening". Actual motifs are marked in bold other tags in italic.
Remember, that the statistics will be only as good as the data. Apparently there is one puzzle tagged with "opening" and "rookEndgame".




Tag
Count
Perc.




short
71723
74.27%


advantage
58328
60.40%


crushing
25978
26.90%


fork
20514
21.24%


long
11694
12.11%


oneMove
11204
11.60%


mate
9170
9.50%


hangingPiece
8307
8.60%


discoveredAttack
8110
8.40%


kingsideAttack
7507
7.77%


pin
6299
6.52%


mateIn2
4618
4.78%


trappedPiece
4150
4.30%


mateIn1
3597
3.72%


attackingF2F7
3451
3.57%


sacrifice
3412
3.53%


equality
3099
3.21%


intermezzo
2842
2.94%


defensiveMove
2683
2.78%


attraction
2003
2.07%


veryLong
1954
2.02%


deflection
1952
2.02%


capturingDefender
1605
1.66%


master
1042
1.08%


advancedPawn
1022
1.06%


clearance
892
0.92%


mateIn3
784
0.81%


skewer
741
0.77%


exposedKing
740
0.77%


quietMove
582
0.60%


doubleCheck
550
0.57%


interference
455
0.47%


queensideAttack
416
0.43%


smotheredMate
393
0.41%


backRankMate
212
0.22%


enPassant
177
0.18%


mateIn4
120
0.12%


castling
110
0.11%


masterVsMaster
91
0.09%


promotion
89
0.09%


bodenMate
57
0.06%


mateIn5
51
0.05%


xRayAttack
47
0.05%


superGM
35
0.04%


doubleBishopMate
28
0.03%


dovetailMate
20
0.02%


underPromotion
4
0.00%


anastasiaMate
3
0.00%


hookMate
1
0.00%


arabianMate
1
0.00%


rookEndgame
1
0.00%



Code
Here is the Kotlin snippet I used to generate the table:
val data = File("lichess_db_puzzle.csv").readText().trim().split('\n')
    .map { it.split(',')[7].split(' ') }.filter { it.contains("opening") }.flatten()
    .groupingBy { it }.eachCount().toList().sortedByDescending { it.second }
for (i in 1..data.lastIndex) {
    val t = if (data[i].first in listOf("advancedPawn", "anastasiaMate", "arabianMate", "attackingF2F7", "attraction", "backRankMate", "bodenMate", "capturingDefender", "clearance", "defensiveMove", "deflection", "discoveredAttack", "doubleBishopMate", "doubleCheck", "dovetailMate", "exposedKing", "fork", "hangingPiece", "hookMate", "interference", "intermezzo", "kingsideAttack", "mate", "mateIn1", "mateIn2", "mateIn3", "mateIn4", "mateIn5", "pin", "promotion", "queensideAttack", "quietMove", "sacrifice", "skewer", "smotheredMate", "trappedPiece", "underPromotion", "xRayAttack", "zugzwang")) "**" else "*"
    println("| %-24s | %10s | %11s |".format("${t}${data[i].first}${t}", "${t}${data[i].second}${t}", "${t}${"%.2f".format(100.0 * data[i].second / data[0].second)}%${t}"))
}


4183: <p>On analyzing my games, I found that I usually miss tactics in the opening than during middlegame and endgame. To supplement my study by solving tactical problems based on motifs, it would be helpful if I understand the key motifs I must stress on. Hence the question below.</p>
<p><strong>Based on different tactical motifs like fork, pin, deflection, double-attack, etc. what is the most common tactical motif during the opening phase statistically?</strong></p>
 15049: <p>The Lichess categorization of tactical motifs is not bad, but these are not common tactical motifs of the opening phase, in my opinion. They describe motifs which happen in the final phase of the game.</p>
<p>I created a <a href="https://github.com/nilslindemann/Chess_Opening_Tactics_Frequency" rel="nofollow noreferrer">GitHub repository</a> where I have put some <a href="https://haydoooke.github.io/Scidpp/cqltut.html" rel="nofollow noreferrer">CQL</a> scripts which I used to search for the motifs I consider typical in the opening phase. The first twenty moves were considered. I searched in a GM database containing 370,000 games. The database is contained in the repo.</p>
<p>The results are listed in a table, and the matching games can be found in the folder named <em>output</em>.</p>
<p>You can download or fork this repo and play around with those scripts. You can also run them on your own PGN databases.</p>
<p>Happy chess research :-)</p>
 4418: <p>During all standard / book openings tactical motifs which win material don't feature. They wouldn't be book openings if they did. That rules out forks, deflections, double attacks, etc. and leaves only pins.</p>
<p>As it happens pins are very common and feature sooner or later in a lot of openings but they only win material if the player with the pinned piece lets something else go wrong. Usually the pinned piece is a knight pinned by a bishop against king or queen and usually the player with the pinned piece has the opportunity to break the pin with a bishop move or force the pinning bishop away with a couple of pawn moves.</p>
<p>I think you are wasting your time looking at tactical motifs in standard openings, i.e. in openings which are played properly. What you really need to do as a priority is look at what tactical motifs you miss in <em>your own</em> games. As a second priority you need to improve your knowledge of the openings you personally play. The openings I play or which are played most often generally are no use to you if you don't play them.</p>
<p>You need to be familiar not just with pages of moves and analysis. Much more useful is to be familiar with the ideas behind the openings <em>you</em> play. You need to be familiar and comfortable with the kinds of positions which arise from those openings and know how to handle them.</p>
<p>That way you are much less likely to make tactical mistakes playing moves that go against the ideas of your favoured openings. That way, too, you are more likely to spot when your opponent makes a move which doesn't &quot;fit in&quot; with the ideas of the opening and which may be some kind of &quot;hope chess&quot; trap. Then you are more likely to avoid falling into it and maybe even taking advantage of your opponent's deviation.</p>
 8154: <h1>Opening puzzles</h1>
<p>On Lichess it's possible to train opening related puzzles:</p>
<p><a href="https://lichess.org/training/opening" rel="nofollow noreferrer">https://lichess.org/training/opening</a></p>
<p>Puzzles for other phases of the game are available as well:</p>
<p><a href="https://lichess.org/training/themes" rel="nofollow noreferrer">https://lichess.org/training/themes</a></p>
<p>Keep in mind, that the puzzle selection will be only as good as the votes given by Lichess users. Also, as far as I know, it's not possible to select specific openings.</p>
<h1>Statistics</h1>
<p>Because of a question by @BCLC in the comments I found this <a href="https://database.lichess.org/#puzzles" rel="nofollow noreferrer">link</a>, where you can download all Lichess puzzles. I made a little table based on all puzzles tagged with &quot;opening&quot;. Actual motifs are marked in <strong>bold</strong> other tags in <em>italic</em>.</p>
<p>Remember, that the statistics will be only as good as the data. Apparently there is one puzzle tagged with &quot;opening&quot; and &quot;rookEndgame&quot;.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Tag</th>
<th style="text-align: right;">Count</th>
<th style="text-align: right;">Perc.</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>short</em></td>
<td style="text-align: right;"><em>71723</em></td>
<td style="text-align: right;"><em>74.27%</em></td>
</tr>
<tr>
<td><em>advantage</em></td>
<td style="text-align: right;"><em>58328</em></td>
<td style="text-align: right;"><em>60.40%</em></td>
</tr>
<tr>
<td><em>crushing</em></td>
<td style="text-align: right;"><em>25978</em></td>
<td style="text-align: right;"><em>26.90%</em></td>
</tr>
<tr>
<td><strong>fork</strong></td>
<td style="text-align: right;"><strong>20514</strong></td>
<td style="text-align: right;"><strong>21.24%</strong></td>
</tr>
<tr>
<td><em>long</em></td>
<td style="text-align: right;"><em>11694</em></td>
<td style="text-align: right;"><em>12.11%</em></td>
</tr>
<tr>
<td><em>oneMove</em></td>
<td style="text-align: right;"><em>11204</em></td>
<td style="text-align: right;"><em>11.60%</em></td>
</tr>
<tr>
<td><strong>mate</strong></td>
<td style="text-align: right;"><strong>9170</strong></td>
<td style="text-align: right;"><strong>9.50%</strong></td>
</tr>
<tr>
<td><strong>hangingPiece</strong></td>
<td style="text-align: right;"><strong>8307</strong></td>
<td style="text-align: right;"><strong>8.60%</strong></td>
</tr>
<tr>
<td><strong>discoveredAttack</strong></td>
<td style="text-align: right;"><strong>8110</strong></td>
<td style="text-align: right;"><strong>8.40%</strong></td>
</tr>
<tr>
<td><strong>kingsideAttack</strong></td>
<td style="text-align: right;"><strong>7507</strong></td>
<td style="text-align: right;"><strong>7.77%</strong></td>
</tr>
<tr>
<td><strong>pin</strong></td>
<td style="text-align: right;"><strong>6299</strong></td>
<td style="text-align: right;"><strong>6.52%</strong></td>
</tr>
<tr>
<td><strong>mateIn2</strong></td>
<td style="text-align: right;"><strong>4618</strong></td>
<td style="text-align: right;"><strong>4.78%</strong></td>
</tr>
<tr>
<td><strong>trappedPiece</strong></td>
<td style="text-align: right;"><strong>4150</strong></td>
<td style="text-align: right;"><strong>4.30%</strong></td>
</tr>
<tr>
<td><strong>mateIn1</strong></td>
<td style="text-align: right;"><strong>3597</strong></td>
<td style="text-align: right;"><strong>3.72%</strong></td>
</tr>
<tr>
<td><strong>attackingF2F7</strong></td>
<td style="text-align: right;"><strong>3451</strong></td>
<td style="text-align: right;"><strong>3.57%</strong></td>
</tr>
<tr>
<td><strong>sacrifice</strong></td>
<td style="text-align: right;"><strong>3412</strong></td>
<td style="text-align: right;"><strong>3.53%</strong></td>
</tr>
<tr>
<td><em>equality</em></td>
<td style="text-align: right;"><em>3099</em></td>
<td style="text-align: right;"><em>3.21%</em></td>
</tr>
<tr>
<td><strong>intermezzo</strong></td>
<td style="text-align: right;"><strong>2842</strong></td>
<td style="text-align: right;"><strong>2.94%</strong></td>
</tr>
<tr>
<td><strong>defensiveMove</strong></td>
<td style="text-align: right;"><strong>2683</strong></td>
<td style="text-align: right;"><strong>2.78%</strong></td>
</tr>
<tr>
<td><strong>attraction</strong></td>
<td style="text-align: right;"><strong>2003</strong></td>
<td style="text-align: right;"><strong>2.07%</strong></td>
</tr>
<tr>
<td><em>veryLong</em></td>
<td style="text-align: right;"><em>1954</em></td>
<td style="text-align: right;"><em>2.02%</em></td>
</tr>
<tr>
<td><strong>deflection</strong></td>
<td style="text-align: right;"><strong>1952</strong></td>
<td style="text-align: right;"><strong>2.02%</strong></td>
</tr>
<tr>
<td><strong>capturingDefender</strong></td>
<td style="text-align: right;"><strong>1605</strong></td>
<td style="text-align: right;"><strong>1.66%</strong></td>
</tr>
<tr>
<td><em>master</em></td>
<td style="text-align: right;"><em>1042</em></td>
<td style="text-align: right;"><em>1.08%</em></td>
</tr>
<tr>
<td><strong>advancedPawn</strong></td>
<td style="text-align: right;"><strong>1022</strong></td>
<td style="text-align: right;"><strong>1.06%</strong></td>
</tr>
<tr>
<td><strong>clearance</strong></td>
<td style="text-align: right;"><strong>892</strong></td>
<td style="text-align: right;"><strong>0.92%</strong></td>
</tr>
<tr>
<td><strong>mateIn3</strong></td>
<td style="text-align: right;"><strong>784</strong></td>
<td style="text-align: right;"><strong>0.81%</strong></td>
</tr>
<tr>
<td><strong>skewer</strong></td>
<td style="text-align: right;"><strong>741</strong></td>
<td style="text-align: right;"><strong>0.77%</strong></td>
</tr>
<tr>
<td><strong>exposedKing</strong></td>
<td style="text-align: right;"><strong>740</strong></td>
<td style="text-align: right;"><strong>0.77%</strong></td>
</tr>
<tr>
<td><strong>quietMove</strong></td>
<td style="text-align: right;"><strong>582</strong></td>
<td style="text-align: right;"><strong>0.60%</strong></td>
</tr>
<tr>
<td><strong>doubleCheck</strong></td>
<td style="text-align: right;"><strong>550</strong></td>
<td style="text-align: right;"><strong>0.57%</strong></td>
</tr>
<tr>
<td><strong>interference</strong></td>
<td style="text-align: right;"><strong>455</strong></td>
<td style="text-align: right;"><strong>0.47%</strong></td>
</tr>
<tr>
<td><strong>queensideAttack</strong></td>
<td style="text-align: right;"><strong>416</strong></td>
<td style="text-align: right;"><strong>0.43%</strong></td>
</tr>
<tr>
<td><strong>smotheredMate</strong></td>
<td style="text-align: right;"><strong>393</strong></td>
<td style="text-align: right;"><strong>0.41%</strong></td>
</tr>
<tr>
<td><strong>backRankMate</strong></td>
<td style="text-align: right;"><strong>212</strong></td>
<td style="text-align: right;"><strong>0.22%</strong></td>
</tr>
<tr>
<td><em>enPassant</em></td>
<td style="text-align: right;"><em>177</em></td>
<td style="text-align: right;"><em>0.18%</em></td>
</tr>
<tr>
<td><strong>mateIn4</strong></td>
<td style="text-align: right;"><strong>120</strong></td>
<td style="text-align: right;"><strong>0.12%</strong></td>
</tr>
<tr>
<td><em>castling</em></td>
<td style="text-align: right;"><em>110</em></td>
<td style="text-align: right;"><em>0.11%</em></td>
</tr>
<tr>
<td><em>masterVsMaster</em></td>
<td style="text-align: right;"><em>91</em></td>
<td style="text-align: right;"><em>0.09%</em></td>
</tr>
<tr>
<td><strong>promotion</strong></td>
<td style="text-align: right;"><strong>89</strong></td>
<td style="text-align: right;"><strong>0.09%</strong></td>
</tr>
<tr>
<td><strong>bodenMate</strong></td>
<td style="text-align: right;"><strong>57</strong></td>
<td style="text-align: right;"><strong>0.06%</strong></td>
</tr>
<tr>
<td><strong>mateIn5</strong></td>
<td style="text-align: right;"><strong>51</strong></td>
<td style="text-align: right;"><strong>0.05%</strong></td>
</tr>
<tr>
<td><strong>xRayAttack</strong></td>
<td style="text-align: right;"><strong>47</strong></td>
<td style="text-align: right;"><strong>0.05%</strong></td>
</tr>
<tr>
<td><em>superGM</em></td>
<td style="text-align: right;"><em>35</em></td>
<td style="text-align: right;"><em>0.04%</em></td>
</tr>
<tr>
<td><strong>doubleBishopMate</strong></td>
<td style="text-align: right;"><strong>28</strong></td>
<td style="text-align: right;"><strong>0.03%</strong></td>
</tr>
<tr>
<td><strong>dovetailMate</strong></td>
<td style="text-align: right;"><strong>20</strong></td>
<td style="text-align: right;"><strong>0.02%</strong></td>
</tr>
<tr>
<td><strong>underPromotion</strong></td>
<td style="text-align: right;"><strong>4</strong></td>
<td style="text-align: right;"><strong>0.00%</strong></td>
</tr>
<tr>
<td><strong>anastasiaMate</strong></td>
<td style="text-align: right;"><strong>3</strong></td>
<td style="text-align: right;"><strong>0.00%</strong></td>
</tr>
<tr>
<td><strong>hookMate</strong></td>
<td style="text-align: right;"><strong>1</strong></td>
<td style="text-align: right;"><strong>0.00%</strong></td>
</tr>
<tr>
<td><strong>arabianMate</strong></td>
<td style="text-align: right;"><strong>1</strong></td>
<td style="text-align: right;"><strong>0.00%</strong></td>
</tr>
<tr>
<td><em>rookEndgame</em></td>
<td style="text-align: right;"><em>1</em></td>
<td style="text-align: right;"><em>0.00%</em></td>
</tr>
</tbody>
</table>
</div><h1>Code</h1>
<p>Here is the Kotlin snippet I used to generate the table:</p>
<pre><code>val data = File(&quot;lichess_db_puzzle.csv&quot;).readText().trim().split('\n')
    .map { it.split(',')[7].split(' ') }.filter { it.contains(&quot;opening&quot;) }.flatten()
    .groupingBy { it }.eachCount().toList().sortedByDescending { it.second }
for (i in 1..data.lastIndex) {
    val t = if (data[i].first in listOf(&quot;advancedPawn&quot;, &quot;anastasiaMate&quot;, &quot;arabianMate&quot;, &quot;attackingF2F7&quot;, &quot;attraction&quot;, &quot;backRankMate&quot;, &quot;bodenMate&quot;, &quot;capturingDefender&quot;, &quot;clearance&quot;, &quot;defensiveMove&quot;, &quot;deflection&quot;, &quot;discoveredAttack&quot;, &quot;doubleBishopMate&quot;, &quot;doubleCheck&quot;, &quot;dovetailMate&quot;, &quot;exposedKing&quot;, &quot;fork&quot;, &quot;hangingPiece&quot;, &quot;hookMate&quot;, &quot;interference&quot;, &quot;intermezzo&quot;, &quot;kingsideAttack&quot;, &quot;mate&quot;, &quot;mateIn1&quot;, &quot;mateIn2&quot;, &quot;mateIn3&quot;, &quot;mateIn4&quot;, &quot;mateIn5&quot;, &quot;pin&quot;, &quot;promotion&quot;, &quot;queensideAttack&quot;, &quot;quietMove&quot;, &quot;sacrifice&quot;, &quot;skewer&quot;, &quot;smotheredMate&quot;, &quot;trappedPiece&quot;, &quot;underPromotion&quot;, &quot;xRayAttack&quot;, &quot;zugzwang&quot;)) &quot;**&quot; else &quot;*&quot;
    println(&quot;| %-24s | %10s | %11s |&quot;.format(&quot;${t}${data[i].first}${t}&quot;, &quot;${t}${data[i].second}${t}&quot;, &quot;${t}${&quot;%.2f&quot;.format(100.0 * data[i].second / data[0].second)}%${t}&quot;))
}
</code></pre>
