How I Use ChatGPT & GitHub Copilot in My Projects
Best Practices using AI in Data Projects including 15x Top Prompts
Hey friends! 👋
Happy Tuesday! After two years with ChatGPT and a year with GitHub Copilot, I would like to share my thoughts and show you exactly how I use them in my own projects
My Honest Opinion About Using AI
The essential step in learning is struggling through complex tasks—this is where the magic happens and real skills take shape. If you really want to grow as a developer, try solving those tough problems on your own first. Yes, it’s hard, but pushing through helps you learn what’s going wrong, how to fix it, and how to spot. If you jump straight to AI too soon, you miss out on the real learning experience.
So, push yourself before you ask for help—only reach out to AI when you’ve run out of ideas. That’s how you build true confidence and skill.
ChatGPT vs. Copilot
When working on projects, there’s always a mix of tasks—brainstorming ideas, planning, coding, debugging, and so on. I’ve found myself turning to two tools—ChatGPT and GitHub Copilot—for different parts of the process:
ChatGPT: My Brainstorming Buddy
When I start a new project, I usually have plenty of ideas, but not always a clear path to follow. That’s where ChatGPT comes in. I treat it like an experienced teammate who’s always up for a chat. I ask open-ended questions, like “How should I structure this?” or “What technologies would best fit this idea?” It’s not about getting code right away; it’s about exploring possibilities.
ChatGPT helps me refine my project ideas, plan the architecture, and even suggest best practices that I hadn’t considered. Beyond that, ChatGPT is my go-to when I’m stuck on a specific technical concept or need quick research. Instead of combing through endless documentation, I’ll just ask a direct question: “What’s the difference between X and Y?” or “How do I implement feature Z using this framework?”
GitHub Copilot: The Assistant at My Fingertips
Once I have a solid plan in place and I’m ready to roll up my sleeves and write code — This is when GitHub Copilot steps in! As soon as I start typing, Copilot offers quick suggestions right inside my editor. I can tweak it, test it, and directly integrated in my code without breaking my flow. It feels like having a second pair of eyes that can guess what I’m trying to do and offer helpful snippets of code.
Using Them Together
The real magic happens when I combine both tools. First, I’ll jump into ChatGPT and outline the core logic, plan the architecture, and think about how different modules will interact. Once I’m comfortable with the approach, I switch to my code editor, where Copilot is ready to help me write and refine the actual implementation.
15 ChatGPT Prompts
Here are the prompts I’ve found myself using the most in my projects.
Note: Just remember to follow your company’s guidelines for using ChatGPT to keep things secure.
1. Solve an SQL Task
In my SQL Server database, we have two tables:
The first table is `orders` with the following columns: order_id, sales, customer_id, product_id.
The second table is `customers` with the following columns: customer_id, first_name, last_name, country.
Do the following:
Write a query to rank customers based on their sales.
The result should include the customer's customer_id, full name, country, total sales, and their rank.
Include comments but avoid commenting on obvious parts.
Write three different versions of the query to achieve this task.
Evaluate and explain which version is best in terms of readability and performance
2. Improve the Readability
The following SQL Server query is long and hard to understand.
Do the following:
Improve its readability.
Remove any redundancy in the query and consolidate it.
Include comments but avoid commenting on obvious parts.
Explain each improvement to understand the reasoning behind it.
[ Code Goes Here ]
3. Optimize the Performance Query
The following SQL Server query is slow.
Do the following:
Propose optimizations to improve its performance.
Provide the improved SQL query.
Explain each improvement to understand the reasoning behind it.
[ Code Goes Here ]
4. Optimize Execution Plan
The image is the execution plan of SQL Server query.
Do the following:
Describe the execution plan step by step.
Identify performance bottlenecks and issues.
Suggest ways to improve performance and optimize the execution plan.
[ Code Goes Here ]
5. Debugging
The following SQL Server query causes this error: [ Error Message Goes Here ]
.
Do the following:
Explain the error message.
Identify the root cause of the issue.
Suggest a solution to fix it.
[ Code Goes Here ]
6. Explain the Result
The result of the following SQL Server query is unclear.
Do the following:
Break down how SQL processes the query step by step.
Explain each stage and how the result is formed.
[ Code Goes Here ]
7. Styling & Formatting
The following SQL Server query hard to understand.
Restyle the code to make it easier to read.
Align column aliases.
Keep it compact - do not introduce unnecessary new lines.
Ensure the formatting follows best practices.
Do the following:
[ Code Goes Here ]
8. Documentation & Comments
The following SQL Server query lacks comments and documentation.
Do the following:
Insert a leading comment at the start of the query describing its overall purpose.
Add comments only where clarification is necessary, avoiding obvious statements.
Create a separate document explaining the business rules implemented by the query.
Create another separate document describing how the query works.
[ Code Goes Here ]
9. Improve Database DDL
The following SQL Server DDL Script has to be optimized.
Do the following:
Naming: Check the consistency of table/column names, prefixes, standards.
Data Types: Ensure data types are appropriate and optimized.
Integrity: Verify the integrity of primary keys and foreign keys.
Indexes: Check that indexes are sufficient and avoid redundancy.
Normalization: Ensure proper normalization and avoid redundancy.
10. Generate Test Dataset
I need dataset for testing the following SQL Server DDL
Do the following:
Generate test dataset as Insert statements.
Dataset should be realistic.
Keep the dataset small.
Ensure all primary/foreign key relationships are valid (use matching IDs).
Dont introduce any Null values.
11. Create SQL Course
Create a comprehensive SQL course with a detailed roadmap and agenda.
Do the following:
Start with SQL fundamentals and advance to complex topics.
Make it beginner-friendly.
Include topics relevant to data analytics.
Focus on real-world data analytics use cases and scenarios.
12. Understand SQL Concept
I want detailed explanation about SQL Window Functions.
Do the following:
Explain what Window Functions are.
Give an analogy.
Describe why we need them and when to use them.
Explain the syntax.
Provide simple examples.
List the top 3 use cases.
13. Comparing SQL Concepts
I want to understand the differences between SQL Windows and GROUP BY.
Do the following:
Explain the key differences between the two concepts.
Describe when to use each concept, with examples.
Provide the pros and cons of each concept.
Summarize the comparison in a clear side-by-side table.
14. Practice SQL Window Functions
Act as an SQL trainer and help me practice SQL Window Functions.
Do the following:
Make it interactive Practicing, you provide task and give solution.
Provide a sample dataset.
Give SQL tasks that gradually increase in difficulty.
Act as an SQL Server and show the results of my queries.
Review my queries, provide feedback, and suggest improvements.
15. Prepare for SQL Interview
Act as Interviewer and prepare me for a SQL interview.
Do the following:
Ask common SQL interview questions.
Make it interactive Practicing, you provide question and give answer.
Gradually progress to advanced topics.
Evaluate my answer and give me a feedback.
16. Prepare for SQL Exam
Prepare me for a SQL exam
Do the following:
Ask common SQL interview questions.
Make it interactive Practicing, you provide question and give answer.
Gradually progress to advanced topics.
Evaluate my answer and give me a feedback.
I hope you found this helpful, and if you have any questions or want to share your own tips, I’m all ears! Happy querying!
Baraa
Hey friends —
I’m Baraa. I’m an IT professional and YouTuber.
My mission is to share the knowledge I’ve gained over the years and to make working with data easier, fun, and accessible to everyone through courses that are free, simple, and easy!