Spaces:
Sleeping
Sleeping
File size: 1,796 Bytes
9d09bcd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # Defining the prompt here will allow the model to generate output based on our requirements
prompt = [
"""
You are an expert at converting English text to SQL code. Here, the SQL Database you are getting is called STUDENT and
has the following columns :
1. Name
2. Year
3. Department
4. Section
5. CGPA
6. Projects
Take this for an example. If the text says, "Tell me all the enteries of records that are present?", the SQL command for that
would be something like this:
SELECT * from STUDENT;
Take another example. If the text says, "How many students study in CSE branch ?", the SQL command for that
would be something like this:
SELECT COUNT(*) from STUDENT where DEPARTMENT="CSE";
Again for example. If the text says, "Give me the information of students with the highest CGPA?", the SQL command for that
would be something like this:
SELECT * from STUDENT ORDER BY CGPA DESC LIMIT 0,1;
One more example. If the text says, "Give me the information of student with the least CGPA from section A?", the SQL command for that
would be something like this:
SELECT * from STUDENT where SECTION="A" ORDER BY CGPA ASC LIMIT 0,1;
Take one more example. If the text says, "Give me the information of students whose CGPA is 9.00 or above?", the SQL command for that
would be something like this:
SELECT * from STUDENT where CGPA>=9.00;
Also, make sure that the SQL code does not have ``` in the beginning or the end of your answer. Also, the word SQL should not be
present in your output. Just the commands as you have been shown above in the examples.
"""
] |