You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/advocates/challenge-github-copilot-sql/includes/2-introduction-github-copilot-codespaces.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,7 @@ You can also use the terminal pane within a GitHub Codespace to run commands, su
32
32
33
33

34
34
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
38
36
39
37
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.
40
38
@@ -49,9 +47,13 @@ To open a codespace from your GitHub account, start at the landing page of your
49
47
50
48

51
49
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
+
52
54
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.
53
55
54
-
## Understanding GitHub Copilot in GitHub Codespaces
56
+
## GitHub Copilot in GitHub Codespaces
55
57
56
58
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.
Copy file name to clipboardExpand all lines: learn-pr/advocates/challenge-github-copilot-sql/includes/2-working-with-sql-using-github-copilot.md
+14-20Lines changed: 14 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,24 +16,20 @@ GitHub Copilot provides better outcomes when your prompts are more specific. If
16
16
17
17
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:
18
18
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_
22
20
23
21

24
22
25
23
## Understanding an application that includes SQL
26
24
27
25
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:
28
26
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?_
33
29
34
30

35
31
36
-
## How to understand SQL queries and code
32
+
## Understand SQL code
37
33
38
34
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.
39
35
@@ -74,7 +70,7 @@ You can request that GitHub Copilot to generate SQL-based tests or assertions to
74
70
75
71
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.
76
72
77
-
## Debugging SQL errors.
73
+
## Debugging SQL errors
78
74
79
75
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.
80
76
@@ -86,14 +82,12 @@ You can use GitHub Copilot to generate prompts to create code that performs bett
86
82
87
83
1. Have an understanding of the code. This understanding can be derived from existing interaction with GitHub Copilot.
88
84
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._
Copy file name to clipboardExpand all lines: learn-pr/advocates/challenge-github-copilot-sql/includes/3-github-skills-exercise.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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.
6
2
7
3
By the end of this workshop, you will:
8
4
@@ -11,7 +7,7 @@ By the end of this workshop, you will:
11
7
- Apply generic concepts that can improve suggestions and select from different strategies that can yield better results.
12
8
- Get a clear understanding of poor prompting techniques, and how these can drastically affect the output from GitHub Copilot.
13
9
14
-
## Hands-on exercise: Challenging GitHub Copilot with SQL
10
+
## Exercise: Challenging GitHub Copilot with SQL
15
11
16
12
This exercise walks you through the following steps:
0 commit comments