|
Download sys/sql-0002.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/sys/sql-0002.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm/sys/sql-0002.jsonl
-
curl -L -o sql-0002.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/sys/sql-0002.jsonl
1.92 kB
| {"type": "session", "harness": "deepseek-harness", "id": "sql-0002", "name": "PostgreSQL advanced queries"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "How do I write advanced PostgreSQL queries?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "```sql\n-- Window functions\nSELECT name, department, salary,\n RANK() OVER (PARTITION BY department ORDER BY salary DESC) as rank,\n AVG(salary) OVER (PARTITION BY department) as dept_avg,\n salary - LAG(salary) OVER (ORDER BY salary) as diff_from_prev\nFROM employees;\n\n-- CTEs\nWITH monthly_stats AS (\n SELECT date_trunc('month', created_at) as month,\n COUNT(*) as total,\n SUM(amount) as revenue\n FROM orders\n GROUP BY 1\n)\nSELECT month, revenue, \n revenue - LAG(revenue) OVER (ORDER BY month) as growth\nFROM monthly_stats;\n\n-- JSON queries\nSELECT data->>'name' as name,\n data->'address'->>'city' as city\nFROM users;\n\n-- Full text search\nSELECT * FROM articles\nWHERE to_tsvector('english', title || ' ' || body) \n @@ plainto_tsquery('english', 'search terms');\n\n-- LATERAL joins\nSELECT u.name, latest.order_id\nFROM users u\nCROSS JOIN LATERAL (\n SELECT order_id FROM orders \n WHERE user_id = u.id \n ORDER BY created_at DESC LIMIT 1\n) latest;\n\n-- Materialized views\nCREATE MATERIALIZED VIEW user_stats AS\nSELECT user_id, COUNT(*), SUM(amount)\nFROM orders GROUP BY 1;\nREFRESH MATERIALIZED VIEW CONCURRENTLY user_stats;\n```"}} | |