The invention relates to an
SQL (Structured
Query Language) generation method and device,
computer equipment, a computer readable storage medium and a
computer program product. The method comprises the steps of determining supplementary information corresponding to an initial problem based on the initial problem, and obtaining a target problem; based on a pre-configured
label system, determining a first fine-grained
label of each entity contained in the target question, and performing association matching on the first fine-grained
label and a second fine-grained label of each field in each preset
database table to obtain a candidate table; according to the method, the target problem is converted based on the candidate table to obtain the conversion problem, and the conversion problem is processed through the preset large
language model to obtain the
SQL statement, so that knowledge enhancement can be performed on the problem directly input by the user, the definition of
problem description can be improved, the efficiency of
data retrieval can be optimized, and the
interpretability of data can be optimized; in addition, alignment
processing can be carried out on text descriptions of different semantic spaces, and the accuracy degree and the generation efficiency of
SQL statements generated by a large
language model are improved.