Skip to content

Commit 3bed4cc

Browse files
committed
Minor updates & revisions
1 parent 3edb7f1 commit 3bed4cc

File tree

4 files changed

+24
-32
lines changed

4 files changed

+24
-32
lines changed

learn-pr/advocates/challenge-github-copilot-sql/3-github-skills-exercise.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### YamlMime:ModuleUnit
22
uid: learn.challenge-github-copilot-with-sql.github-skills-exercise
3-
title: GitHub skills exercise
3+
title: Hands-on exercise - Challenging GitHub Copilot with SQL
44
metadata:
5-
title: GitHub skills exercise
5+
title: Hands-on exercise - Challenging GitHub Copilot with SQL
66
description: Learn how to apply advanced GitHub Copilot features to interact with an application that uses complex SQL queries.
77
ms.date: 06/25/2025
88
author: Orin-Thomas

learn-pr/advocates/challenge-github-copilot-sql/includes/2-introduction-github-copilot-codespaces.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ You can also use the terminal pane within a GitHub Codespace to run commands, su
3232

3333
![A screenshot showing a python script being called from a GitHub codespace](../media/run-python-terminal.svg)
3434

35-
## Customizing GitHub Codespaces
36-
37-
You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your project. Each codespace you create is hosted by GitHub in a Docker container that runs on a virtual machine. You can choose the type of virtual machine you want to use depending on the resources you need.
35+
## Creating a GitHub Codespace
3836

3937
To begin developing using GitHub Codespaces, you can create a codespace from a template or from any branch or commit in a GitHub repository. When you create a codespace from a template, you can start from a blank template or choose a template suitable for the work you're doing.
4038

@@ -49,9 +47,13 @@ To open a codespace from your GitHub account, start at the landing page of your
4947

5048
![A screenshot showing how to open a GitHub Codespace from a GitHub repository](../media/open-codespace-repository.svg)
5149

50+
## Customizing GitHub Codespaces
51+
52+
You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your project. Each codespace you create is hosted by GitHub in a Docker container that runs on a virtual machine. You can choose the type of virtual machine you want to use depending on the resources you need.
53+
5254
You can configure the development container for a repository so that any codespace created for that repository gives you a tailored development environment, complete with all the tools and runtimes you need to work on a specific project. A development container file is a JSON file that lets you customize the default container image that runs your codespace. You can use this JSON file to configure VS Code settings, run custom code, manage network traffic port forwarding, and configure other settings.
5355

54-
## Understanding GitHub Copilot in GitHub Codespaces
56+
## GitHub Copilot in GitHub Codespaces
5557

5658
One of the tools you can use within a GitHub Codespace is GitHub Copilot. You can verify that GitHub Copilot and Copilot Chat are available in your GitHub Codespaces environment by checking the Extensions tab and searching for GitHub Copilot and choosing the Install option if GitHub Copilot isn't already present.
5759

learn-pr/advocates/challenge-github-copilot-sql/includes/2-working-with-sql-using-github-copilot.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,20 @@ GitHub Copilot provides better outcomes when your prompts are more specific. If
1616

1717
For example, you could use GitHub Copilot to provide you with the SQL code to create a table that included columns for first name, last name, date of birth, favorite movie, and pet name by issuing the following prompt:
1818

19-
```
20-
@workspace Please provide me with the SQL code to create a table that included columns for first name, last name, date of birth, favorite movie and pet name
21-
```
19+
_@workspace Please provide me with the SQL code to create a table that included columns for first name, last name, date of birth, favorite movie and pet name_
2220

2321
![A screenshot a GitHub Copilot prompt related to the creation of a table in SQL.](../media/create-table.svg)
2422

2523
## Understanding an application that includes SQL
2624

2725
For example, if you opened a codespace were presented with an application that included SQL code, you could query GitHub Copilot with the following prompt to understand more about the project in the following manner:
2826

29-
```
30-
@workspace Please briefly explain the structure of this project.
31-
What should I do to run it?
32-
```
27+
_@workspace Please briefly explain the structure of this project.
28+
What should I do to run it?_
3329

3430
![A screenshot showing GitHub Copilot's response to a query about project structure.](../media/project-structure.svg)
3531

36-
## How to understand SQL queries and code
32+
## Understand SQL code
3733

3834
You can use the /explain prompt to understand specific code. For example, a project might contain a file named complex.sql, which contains the query that is being executed in the application. To understand the contents of complex.sql, you can select it within the Explorer pane of GitHub Codespaces and then use the /explain prompt in the chat.
3935

@@ -74,7 +70,7 @@ You can request that GitHub Copilot to generate SQL-based tests or assertions to
7470

7571
GitHub Copilot can help you write tests for your application code by generating test code that covers your codebase. This includes unit tests, end-to-end tests, and tests for edge cases.
7672

77-
## Debugging SQL errors.
73+
## Debugging SQL errors
7874

7975
You can ask GitHub Copilot to help debug SQL errors or suggest fixes for common issues. For example, you can select a file or block of code and ask GitHub Copilot to locate and correct any syntax errors.
8076

@@ -86,14 +82,12 @@ You can use GitHub Copilot to generate prompts to create code that performs bett
8682

8783
1. Have an understanding of the code. This understanding can be derived from existing interaction with GitHub Copilot.
8884
1. Select the original code and open GitHub Copilot Chat.
89-
1. Provide as much detail as possible. For example, you might provide GitHub Copilot chat with the following prompt:
90-
91-
```
92-
Given the following requirements:
93-
The database is SQLite and contains tables relevant to movie ratings (see the structure in complex.sql).
94-
The query should efficiently aggregate and return the top-rated movies by region, minimizing execution time and avoiding unnecessary operations (such as redundant CASTs, unnecessary JOINs, or SELECT DISTINCT if not needed).
95-
The result should include movie title, average rating, region, and any other relevant fields.
96-
The query must complete in under 1.5 seconds on a large dataset.
97-
All business logic and correctness must be preserved as in the original complex.sql.
98-
Write a high-performance SQL query that fulfills these requirements, and explain any optimizations you apply.
99-
```
85+
1. Provide as much detail as possible. For example, you might provide GitHub Copilot chat with the following prompt:
86+
87+
_Given the following requirements:_
88+
_The database is SQLite and contains tables relevant to movie ratings (see the structure in complex.sql)._
89+
_The query should efficiently aggregate and return the top-rated movies by region, minimizing execution time and avoiding unnecessary operations (such as redundant CASTs, unnecessary JOINs, or SELECT DISTINCT if not needed)._
90+
_The result should include movie title, average rating, region, and any other relevant fields._
91+
_The query must complete in under 1.5 seconds on a large dataset.
92+
All business logic and correctness must be preserved as in the original complex.sql._
93+
_Write a high-performance SQL query that fulfills these requirements, and explain any optimizations you apply._

learn-pr/advocates/challenge-github-copilot-sql/includes/3-github-skills-exercise.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
## Exercise overview
2-
3-
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 get yourself across the code functionality and application structure.
4-
5-
## Workshop objectives
1+
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.
62

73
By the end of this workshop, you will:
84

@@ -11,7 +7,7 @@ By the end of this workshop, you will:
117
- Apply generic concepts that can improve suggestions and select from different strategies that can yield better results.
128
- Get a clear understanding of poor prompting techniques, and how these can drastically affect the output from GitHub Copilot.
139

14-
## Hands-on exercise: Challenging GitHub Copilot with SQL
10+
## Exercise: Challenging GitHub Copilot with SQL
1511

1612
This exercise walks you through the following steps:
1713

0 commit comments

Comments
 (0)