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
You can use GitHub Copilot, with the `@db2i` chat participant, to ask questions either about Db2 for IBM i or about specific tables in the current schema of the selected job. You can ask things like:
12
-
13
-
```text
14
-
@db2i What columns make up an employee?
15
-
```
16
-
17
-
```text
18
-
@db2i Can you get the department name for each employee?
19
-
```
20
-
21
-
```text
22
-
@db2i Write a select statement to count how many employees are in each department
23
-
```
24
-
25
7
### Install the GitHub Copilot extension
26
8
27
9
<Steps>
@@ -42,27 +24,58 @@ You can use GitHub Copilot, with the `@db2i` chat participant, to ask questions
42
24
43
25
Once GitHub Copilot is installed, you can ask questions about your database using the `@db2i` chat participant. Here are some examples:
44
26
27
+
<CardGrid><Card>
45
28
46
-
**Example 1** Summarize the columns in the `EMPLOYEE` table
29
+
**Example 1**: Summarize the columns in the `EMPLOYEE` table
47
30
48
31
This is a simple example to show how you can ask questions about the structure of your database. You can ask the chat participant to summarize the columns in a table.
49
32
50
-

33
+
</Card><Card>
51
34
52
-
**Example 2:** Get the department name for each employee
35
+

53
36
54
-
This example shows how you can ask the chat participant to write a query that joins two tables to get the department name for each employee. The chat participant will generate the SQL query for you that you can run directly in your SQL editor in VS Code.
37
+
</Card></CardGrid>
55
38
56
-

39
+
<CardGrid><Card>
57
40
58
-
Run the Generated SQL to get the result:
59
-

41
+
**Example 2:** Ask to find out what objects are related to `employee`?
60
42
61
-
<Asidetype="tip">
62
-
You can set the current schema by running the `SET SCHEMA` command in the SQL script editor.
63
-
</Aside>
43
+
This example shows how you can ask the chat participant to find out what objects are related to the `employee` table. The chat participant will return a list of related objects, including the `department` table.
44
+
45
+
It will tell you if it can't get the related objects or if there are none.
46
+
47
+
</Card><Card>
48
+
49
+

50
+
51
+
</Card></CardGrid>
52
+
53
+
<CardGrid><Card>
54
+
55
+
**Example 3:** Try out a follow up question.
56
+
57
+
The screenshots that after the participant has responsed, it will sometimes offer some additional follow up questions. Simply clicking on one of these will ask the question to the chat participant.
58
+
59
+
</Card><Card>
60
+
61
+

62
+
63
+
</Card></CardGrid>
64
+
65
+
---
66
+
67
+
**Example 4**: Using our 'Run SQL statement' tool to summarize information.
68
+
69
+
This example shows how you can use the `Run SQL statement` tool to ask information about the data in your system. Before the tool will run any SQL statement, it will ask you to confirm that you want to run the SQL statement. This is a safety feature to prevent you from running SQL statements that could modify your data.
70
+
71
+
<CardGrid><Card>
72
+
73
+

74
+
75
+
</Card><Card>
76
+
77
+
It will then take the result set of the statement and summarize the information based on your request.
64
78
65
-
**Example 3:** Calculate the Average salary for each department
79
+

66
80
67
-
A slightly more complex example that shows how you can ask the chat participant to write a query that calculates the average salary for each department.
0 commit comments