Hands-on exercise - Challenging GitHub Copilot with SQL

Completed

In this exercise, you take the role of a developer who has been asked to examine and optimize a project written by a person who recently left the organization for another role. Their code was incompletely documented, so you have chosen to use GitHub Copilot to quickly gain an understanding of the code functionality and application structure.

By the end of this workshop, you will:

  • Use advanced GitHub Copilot interaction techniques to deal with complex problems regarding SQL queries.
  • Iterate, validate, and refine answers to get better and more accurate suggestions.
  • Apply generic concepts that can improve suggestions and select from different strategies that can yield better results.
  • Get a clear understanding of poor prompting techniques, and how these can drastically affect the output from GitHub Copilot.

Exercise: Challenging GitHub Copilot with SQL

This exercise walks you through the following steps:

  1. Start a GitHub Codespace with the web application code.
  2. Explore the project using GitHub Copilot.
  3. Determine what performance problems exist using GitHub Copilot.
  4. Examine and optimize SQL code.
  5. Update the SQL code to remove unnecessary components.
  6. Verify the improvement in performance.
  7. Determine if GitHub Copilot can create a more performant query from scratch.

Where applicable, each step in the exercise may contain hints, which can be used to validate Copilot suggestions against the correct command.

Get started

Select Start the exercise on GitHub to navigate to repository where you complete a series of tasks. You'll need a GitHub account to complete this exercise. Follow the README instructions in the repository to complete the exercise. One of the first steps you'll take is to open a GitHub Codespace that is provided by Microsoft for the purposes of completing the exercise.

Once you completed the exercise, return to this module for:

  • A quick knowledge check
  • A summary of what you've learned