Searching for Alekhine's Gun (CQL)
Alekhine's Gun is a tactical motif where a Queen and two Rooks are lined up along the same axis to put pressure on an opponent's weakness. The formation of Alekhine's Gun was first given its name after the game Alekhine - Nimzowitsch, San Remo 1930. If we wanted to find out whether there are earlier instances of Alekhine's Gun by Alekhine, we could search for his games showing this tactical motif with the following script:

- :pgn is the name of the pgn database I searched
- :output is the name of the result pgn it will create
- :player restricts matches to only games where one of the players is named Alekhine (case doesn't matter).
- The (position) contains only two tags
- :rayorthogonal looks for a pattern of a white Queen (Q) and two Rooks (R) attacking any Black piece (a). (White pieces are uppercase, and A/a stands for any piece, in this case any Black piece)
- :flipcolor tells CQL to check for this position with reversed colors, thus letting us find Alekhine's Gun from either color.