Update README.md
Browse files
README.md
CHANGED
@@ -221,7 +221,7 @@ text=''' <example_response>
|
|
221 |
### 2. SQL Generation
|
222 |
### prompt
|
223 |
```python
|
224 |
-
text = f"""Generate simple SQL query from the schema mentioned for the following
|
225 |
<schema>CREATE TABLE department (Department_ID number,
|
226 |
Name text,
|
227 |
Creation text,
|
@@ -246,5 +246,79 @@ text = f"""Generate simple SQL query from the schema mentioned for the following
|
|
246 |
SELECT head.name FROM head WHERE head.born_state <> 'California';
|
247 |
```
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
### Team
|
250 |
Avi Kothari, Gyan Ranjan, Pratham Gupta, Ritvik Aryan Kalra, Soham Acharya
|
|
|
221 |
### 2. SQL Generation
|
222 |
### prompt
|
223 |
```python
|
224 |
+
text = f"""Generate a simple SQL query from the schema mentioned for the following question.
|
225 |
<schema>CREATE TABLE department (Department_ID number,
|
226 |
Name text,
|
227 |
Creation text,
|
|
|
246 |
SELECT head.name FROM head WHERE head.born_state <> 'California';
|
247 |
```
|
248 |
|
249 |
+
### 3. Performance Schema Monitoring
|
250 |
+
### prompt
|
251 |
+
```python
|
252 |
+
text = f"""Generate the SQL query for SkySQL performance schema for the following question.
|
253 |
+
<example>
|
254 |
+
--question: What are the top 10 most frequently used queries/statements?
|
255 |
+
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
|
256 |
+
</example>
|
257 |
+
<schema>
|
258 |
+
CREATE TABLE `accounts` (`USER` char(128) DEFAULT NULL -- 'The connection''s client user name for the connection, or NULL if an internal thread.',
|
259 |
+
`HOST` char(255) DEFAULT NULL -- 'The connection client''s host name, or NULL if an internal thread.',
|
260 |
+
`CURRENT_CONNECTIONS` bigint(20) NOT NULL -- 'Current connections for the account.',\n
|
261 |
+
`TOTAL_CONNECTIONS` bigint(20) NOT NULL -- 'Total connections for the account.'
|
262 |
+
) ;
|
263 |
+
</schema>
|
264 |
+
<question>
|
265 |
+
Tell me the number of active connections each user has.
|
266 |
+
</question>
|
267 |
+
<sql>
|
268 |
+
"""
|
269 |
+
```
|
270 |
+
### response
|
271 |
+
```sql
|
272 |
+
SELECT USER, CURRENT_CONNECTIONS FROM accounts;
|
273 |
+
```
|
274 |
+
|
275 |
+
### prompt
|
276 |
+
```python
|
277 |
+
prompt = """Generate the SQL query for SkySQL performance schema for the following question.
|
278 |
+
<example>
|
279 |
+
--question: What are the top 10 most frequently used queries/statements?
|
280 |
+
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
|
281 |
+
</example>
|
282 |
+
<schema>
|
283 |
+
CREATE TABLE `file_summary_by_instance` (
|
284 |
+
`FILE_NAME` varchar(512) NOT NULL -- 'File name.',
|
285 |
+
`EVENT_NAME` varchar(128) NOT NULL -- 'Event name.',
|
286 |
+
`OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL -- 'Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row.',
|
287 |
+
`COUNT_STAR` bigint(20) unsigned NOT NULL -- 'Number of summarized events',
|
288 |
+
`SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Total wait time of the summarized events that are timed.',
|
289 |
+
`MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Minimum wait time of the summarized events that are timed.',
|
290 |
+
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Average wait time of the summarized events that are timed.',
|
291 |
+
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Maximum wait time of the summarized events that are timed.',
|
292 |
+
`COUNT_READ` bigint(20) unsigned NOT NULL -- 'Number of all read operations, including FGETS, FGETC, FREAD, and READ.',
|
293 |
+
`SUM_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Total wait time of all read operations that are timed.',
|
294 |
+
`MIN_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Minimum wait time of all read operations that are timed.',
|
295 |
+
`AVG_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Average wait time of all read operations that are timed.',
|
296 |
+
`MAX_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Maximum wait time of all read operations that are timed.',
|
297 |
+
`SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL -- 'Bytes read by read operations.',
|
298 |
+
`COUNT_WRITE` bigint(20) unsigned NOT NULL -- 'Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.',
|
299 |
+
`SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Total wait time of all write operations that are timed.',
|
300 |
+
`MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Minimum wait time of all write operations that are timed.',
|
301 |
+
`AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Average wait time of all write operations that are timed.',
|
302 |
+
`MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Maximum wait time of all write operations that are timed.',
|
303 |
+
`SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL -- 'Bytes written by write operations.',
|
304 |
+
`COUNT_MISC` bigint(20) unsigned NOT NULL -- 'Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.',
|
305 |
+
`SUM_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Total wait time of all miscellaneous operations that are timed.',
|
306 |
+
`MIN_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Minimum wait time of all miscellaneous operations that are timed.',
|
307 |
+
`AVG_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Average wait time of all miscellaneous operations that are timed.',
|
308 |
+
`MAX_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Maximum wait time of all miscellaneous operations that are timed.'
|
309 |
+
);
|
310 |
+
</schema>
|
311 |
+
<question>
|
312 |
+
List out 10 names of the files with the most read and writes
|
313 |
+
</question>
|
314 |
+
<sql>
|
315 |
+
"""
|
316 |
+
```
|
317 |
+
|
318 |
+
### response
|
319 |
+
```sql
|
320 |
+
SELECT FILE_NAME FROM file_summary_by_instance ORDER BY SUM_NUMBER_OF_BYTES_READ DESC, SUM_NUMBER_OF_BYTES_WRITE DESC LIMIT 10;
|
321 |
+
```
|
322 |
+
|
323 |
### Team
|
324 |
Avi Kothari, Gyan Ranjan, Pratham Gupta, Ritvik Aryan Kalra, Soham Acharya
|