{"id":22683,"date":"2025-09-01T12:12:57","date_gmt":"2025-09-01T12:12:57","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=22683"},"modified":"2026-05-29T10:24:49","modified_gmt":"2026-05-29T10:24:49","slug":"jetengine-query-builder-sql-query-type","status":"publish","type":"article","link":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/","title":{"rendered":"Query Builder SQL Query Type"},"content":{"rendered":"\n<p>By default, data stored in SQL database tables is only accessible through tools like phpMyAdmin and cannot be displayed on the frontend using standard WordPress functionality. However, <em>JetEngine<\/em>\u2019s \u201cSQL\/AI Query\u201d feature in the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/query-builder-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Query Builder<\/strong><\/a> allows retrieving data directly from database tables, creating a <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/listing-template-in-elementor-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Listing template<\/strong><\/a> based on that data, and displaying it on the frontend using the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/listing-grid-widget-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Listing Grid<\/strong><\/a> widget\/block\/element.<\/p>\n\n\n\n<p>SQL queries can be built using the available <strong>Query Builder<\/strong> options, such as query clauses, ordering, joins, and other settings.<\/p>\n\n\n\n<p>In <strong>Advanced\/AI mode<\/strong>, the SQL query can be written manually or generated automatically using AI.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to Generate SQL Queries with AI in JetEngine | SQL\/AI Query Builder\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/aQkX3O5fKpc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"general-settings\">General Settings<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>In the <strong><em>WordPress Dashboard &gt; JetEngine &gt; JetEngine &gt; Query Builder <\/em><\/strong>directory, the query adjusting starts from the following settings:<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings.webp\" alt=\"sql query general settings\" class=\"wp-image-48302\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<ul>\n<li><strong>Name <\/strong>\u2014 a field where the name of the query should be put;<\/li>\n\n\n\n<li><strong>Description <\/strong>\u2014 a short description of the query features that helps with navigating the list of built queries;<\/li>\n\n\n\n<li><strong>Query Type <\/strong>\u2014 in the given case, a \u201cSQL\/AI Query\u201d should be picked;<\/li>\n\n\n\n<li><strong>Custom Query ID <\/strong>\u2014 an optional field to connect a query to <a href=\"https:\/\/crocoblock.com\/plugins\/jetsmartfilters\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>JetSmartFilters<\/em><\/a>. The value set here should be identical to the one used in the filter;<\/li>\n\n\n\n<li><strong>Cache Query <\/strong>\u2014 a toggle activated by default. It caches the current query and can be deactivated if the query results are incorrect;<\/li>\n\n\n\n<li><strong>Cache Expires <\/strong>\u2014 a field where the object cache expiration time can be entered (in seconds). The default is \u201c0\u201d, meaning no expiration. Note: this option is relevant only when an external object cache (e.g., Redis, Memcached) is used. Otherwise, the cache remains valid only for a single request;<\/li>\n\n\n\n<li><strong>Register Rest API Endpoint<\/strong> \u2013 if enabled, this toggle activates settings with which you can register a WordPress Rest API endpoint to grant public access to query results and allow remote retrieval of current query data. For example, you can use the endpoint in the <a href=\"https:\/\/www.make.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>Make.com<\/strong><\/a> scenarios or as the backend for mobile applications. More about these settings can be found in the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/query-builder-overview\/#register-rest-api-endpoint\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Register Rest API Endpoint<\/strong><\/a> chapter of the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/query-builder-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Query Builder Overview<\/strong><\/a>.<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"custom-sql-query-settings\">Custom SQL Query Settings<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>If the <strong>Advanced\/AI mode<\/strong> toggle is turned off, it shows the options that help set the SQL query. If activated, it resets settings and allows writing the SQL query manually or with the help of AI.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"advancedai-mode-turned-off\">Advanced\/AI mode turned off<\/h3>\n\n\n\n<p>Such default settings are available for the SQL query:<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings.webp\" alt=\"custom SQL query settings\" class=\"wp-image-48303\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/custom-SQL-query-settings-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<ul>\n<li><strong>From Table <\/strong>\u2014 a dropdown menu where a SQL table can be chosen from which the data will be taken;<\/li>\n\n\n\n<li><strong>Show\/Per Page Limit<\/strong> \u2014 a field to define how many items will be shown at the same time (e.g., in the <strong>Listing Grid<\/strong>). If one adds the <em>JetSmartFilters<\/em> <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetsmartfilters\/pagination-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Pagination<\/strong><\/a>, this feature will define the number of items on one page;<\/li>\n\n\n\n<li><strong>Total Query Limit<\/strong> \u2014 a field to insert the maximum number of items that can be taken in the query. This is also a number that will be shown if the \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/query-results-count-dynamic-tag-for-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">Query Result Count<\/a>\u201d <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/dynamic-tags-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>dynamic tag<\/strong><\/a> is used. If one plans to add a <strong>Pagination<\/strong> widget or block to the <strong>Listing Grid<\/strong>, this feature will define the maximum number of items in the query;<\/li>\n\n\n\n<li><strong>Offset<\/strong> \u2014 a field to type the number of first items to skip from the start;<\/li>\n<\/ul>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">This option doesn\u2019t work without the <strong>Total Query Limit<\/strong>. If one needs unlimited query results with offset, an extra large number should be set in the <strong>Total Query Limit<\/strong> option.<\/p><\/div><\/div>\n\n\n\n<ul>\n<li><strong>Include columns<\/strong> \u2014 a dropdown to select what columns should be included in the query results. It should be left empty to return all possible columns;<\/li>\n\n\n\n<li><strong>Columns for filters<\/strong> \u2014 shows the columns list to filter with the <em>JetSmartFilters<\/em> plugin. To filter query results by selected column, the column name should be copied and pasted into the <strong>Query Variable<\/strong> bar of the selected filter;<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters.webp\" alt=\"sql columns for filters\" class=\"wp-image-48312\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-columns-for-filters-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"use-join\">Use Join<\/h4>\n\n\n\n<ul>\n<li><strong>Use Join<\/strong> \u2014 a toggle that enables the use of SQL joins. When enabled, such options can be defined in the repeater item:<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section.webp\" alt=\"sql query join tables section\" class=\"wp-image-48305\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-join-tables-section-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<ul>\n<li><strong>Join Type<\/strong> \u2014 specifies the type of SQL join to use. Options include: \u201cInner Join\u201d (default if not selected), \u201cLeft Join\u201d, \u201cRight Join\u201d, \u201cOuter Join\u201d. More information can be found in the <a href=\"https:\/\/www.w3schools.com\/sql\/sql_join.asp\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>SQL Joins<\/strong><\/a> article;<\/li>\n\n\n\n<li><strong>Join Table<\/strong> \u2014 selects the database table from which additional data will be joined;<\/li>\n\n\n\n<li><strong>When current table column<\/strong> \u2014 chooses a column from the main (current) table that will be used to match data with the join table;<\/li>\n\n\n\n<li><strong>Is equal to other table column<\/strong> \u2014 selects the corresponding column in the joined table. This column must contain values that match those in the column selected above to successfully relate the two tables.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"where-query-clauses\">Where (query clauses)<\/h4>\n\n\n\n<p><strong>Where (query clauses)<\/strong> section allows adding items to the list based on the values of specific columns. One can enter the desired value in the <strong>Value<\/strong> field, and the system will compare it to the data in the database column selected in the <strong>Column<\/strong> dropdown. If the values match, the item is included in the list. Multiple conditions can be added by clicking the \u201c<strong>Add New<\/strong>\u201d button. Every query clause has additional settings:<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"618\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses-1024x618.webp\" alt=\"sql where (query clauses)\" class=\"wp-image-48306\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses-600x362.webp 600w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-where-query-clauses.webp 1824w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div>\n\n\n\n<ul>\n<li><strong>Column <\/strong>\u2014<strong> <\/strong>here, one of the database table columns can be chosen. The items will be queried according to the values in that column;<\/li>\n\n\n\n<li><strong>Compare <\/strong>\u2014 here, one can select how the values will be compared:\n<ul>\n<li><strong>Equal <\/strong>\u2014 displays items having an equal value;<\/li>\n\n\n\n<li><strong>Not Equal<\/strong> \u2014 shows items that don\u2019t have an equal value;<\/li>\n\n\n\n<li><strong>Greater than<\/strong> \u2014 shows items that have a greater value. It works with numeric values only;<\/li>\n\n\n\n<li><strong>Greater or equal<\/strong> \u2014 displays items that have a greater or equal value. It also works only for numeric values;<\/li>\n\n\n\n<li><strong>Less than<\/strong> \u2014 shows items that have a lesser value. For numeric values only;<\/li>\n\n\n\n<li><strong>Less or equal<\/strong> \u2014 displays items that have a lesser or equal numeric value;<\/li>\n\n\n\n<li><strong>Like <\/strong>\u2014 shows items that have the value set in the <strong>Value <\/strong>field mentioned in the content;<\/li>\n\n\n\n<li><strong>Not like<\/strong> \u2014 displays only the items that don\u2019t have the value put in the <strong>Value <\/strong>field mentioned in the content;<\/li>\n\n\n\n<li><strong>In the list<\/strong> \u2014 after one adds several values to the <strong>Value <\/strong>field, it shows the items that have at least one of them in their content;<\/li>\n\n\n\n<li><strong>Not in the list<\/strong> \u2014 displays items that have any values except the ones typed into the <strong>Value <\/strong>field;<\/li>\n\n\n\n<li><strong>Between <\/strong>\u2014 displays items that contain the value between two, which are set in the <strong>Value <\/strong>field;&nbsp;<\/li>\n\n\n\n<li><strong>Not between<\/strong> \u2014 shows all the items except the ones that have a value that matches the set interval;<\/li>\n\n\n\n<li><strong>Exist <\/strong>\u2014 shows all the items that contain the <strong>Field key\/name <\/strong>of the selected meta field. There is no need to set the <strong>Value <\/strong>in this case;<\/li>\n\n\n\n<li><strong>Not exist<\/strong> \u2014 displays all the items that don\u2019t have the <strong>Field key\/name <\/strong>of the meta field. There is no need to set the <strong>Value <\/strong>either;<\/li>\n\n\n\n<li><strong>Regexp <\/strong>\u2014 queries items according to \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/meta-field-types-overview\/#checkbox\" target=\"_blank\" rel=\"noreferrer noopener\">Checkbox<\/a>\u201d and \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/meta-field-types-overview\/#radio\" target=\"_blank\" rel=\"noreferrer noopener\">Radio<\/a>\u201d meta field values;<\/li>\n\n\n\n<li><strong>Not regexp <\/strong>\u2014 excludes mentioned \u201cCheckbox\u201d and \u201cRadio\u201d meta field values from the query;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Value <\/strong>\u2014 the value set here will be compared to the value of the chosen <strong>Column<\/strong>. The \u201c<strong>database<\/strong>\u201d icon opens the macros list that can be used in this field;<\/li>\n\n\n\n<li><strong>Exclude this clause from the query if dynamic value is empty<\/strong> \u2014 allows skipping a query condition if the dynamic value linked to the field is empty. It only becomes available when a dynamic source (like a query variable or URL parameter) is selected for the <strong>Value<\/strong> field. It helps prevent unexpected results when no value is passed \u2014 for example, showing no posts or only those with empty meta fields. Enabling this ensures the query behaves as expected, such as displaying all posts when no filter is applied;<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query.webp\" alt=\"exclude this clause from the query if dynamic value is empty in sql query\" class=\"wp-image-48304\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/exclude-this-clause-from-the-query-if-dynamic-value-is-empty-in-sql-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<ul>\n<li><strong>Type <\/strong>\u2014&nbsp; this dropdown allows specifying what kind of data is stored in the chosen parameter:\n<ul>\n<li><strong>Char<\/strong> \u2014 alphabetic data;<\/li>\n\n\n\n<li><strong>Numeric<\/strong> \u2013 whole numbers only;<\/li>\n\n\n\n<li><strong>Date<\/strong> \u2014 date values;<\/li>\n\n\n\n<li><strong>Datetime<\/strong> \u2014 date and time values ;<\/li>\n\n\n\n<li><strong>Timestamp <\/strong>\u2014 date and time values stored as a timestamp. This format is particularly useful for tracking local events while accounting for time zones, as well as for use in analytics and statistical analysis;<\/li>\n\n\n\n<li><strong>Decimal<\/strong> \u2014 fraction number data;<\/li>\n\n\n\n<li><strong>Time<\/strong> \u2014 time values;<\/li>\n\n\n\n<li><strong>Binary<\/strong> \u2014 data compared in a case-sensitive manner by treating it as raw binary;<\/li>\n\n\n\n<li><strong>Signed<\/strong> \u2014 whole numbers, both positive and negative;<\/li>\n\n\n\n<li><strong>Unsigned<\/strong> \u2014 whole numbers, only positive.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>The <strong>Where (query clauses)<\/strong> section also contains the \u201c<strong>Add new group<\/strong>\u201d button. When it&#8217;s clicked, a group of clauses is added where the OR\/AND <strong>Relation<\/strong> can be selected.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query.webp\" alt=\"add new group of clauses in sql query\" class=\"wp-image-48307\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-group-of-clauses-in-sql-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>The group of clauses can be configured by pressing the \u201c<strong>Edit group clauses<\/strong>\u201d link, which opens a pop-up, where clauses will be added by pushing the \u201c<strong>Add new clause<\/strong>\u201d button.<\/p>\n\n\n\n<p>More details can be learned from the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/creating-group-clauses-for-query-arguments\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Create Group Clauses for Query Arguments<\/strong><\/a> tutorial.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query.webp\" alt=\"edit group clauses in SQL query\" class=\"wp-image-48309\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/edit-group-clauses-in-sql-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"group-results-and-calculated-columns\">Group Results and Calculated Columns<\/h4>\n\n\n\n<p>The <strong>Group Results <\/strong>feature allows combining query results by duplicate values in one of the columns. If this toggle is enabled, it activates the <strong>Group By<\/strong> dropdown, which allows choosing a column by which the results would be grouped.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query.webp\" alt=\"group results in SQL query\" class=\"wp-image-48310\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/group-results-in-sql-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>The <strong>Include Calculated Columns<\/strong> toggle adds the <strong>Calculated Columns<\/strong> section. The \u201c<strong>Add new<\/strong>\u201d button adds a repeater item with such settings:<\/p>\n\n\n\n<ul>\n<li><strong>Column<\/strong> \u2014 a dropdown to select the column to group the results;<\/li>\n\n\n\n<li><strong>Function<\/strong> \u2014 a dropdown to pick the function that will be applied to the values of the chosen column:\n<ul>\n<li><strong>COUNT <\/strong>\u2013 counts the values of the column;<\/li>\n\n\n\n<li><strong>MAX <\/strong>\u2013 checks the values and shows the maximum one;<\/li>\n\n\n\n<li><strong>MIN <\/strong>\u2013&nbsp; checks the values and shows the minimum one;<\/li>\n\n\n\n<li><strong>SUM <\/strong>\u2013 counts the sum of values;<\/li>\n\n\n\n<li><strong>AVG <\/strong>\u2013 counts the average value.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>More information can be found in the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-setting-calculated-columns-and-grouping-results-for-sql-queries\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Set Calculated Columns and Grouping Results for SQL Query<\/strong><\/a> tutorial.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query.webp\" alt=\"include calculated columns in SQL query\" class=\"wp-image-48311\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/include-calculated-columns-in-sql-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"order-amp-order-by\">Order &amp; Order By<\/h4>\n\n\n\n<p>In the <strong>Order &amp; Order By<\/strong> section, one or more sorting conditions can be added by pressing the \u201c<strong>Add new sorting parameter<\/strong>\u201d button. Every repeater item contains such settings:<\/p>\n\n\n\n<div class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query.webp\" alt=\"add new sorting parameter to SQL query\" class=\"wp-image-48308\" style=\"width:840px;height:auto\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/add-new-sorting-parameter-to-SQL-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<ul>\n<li><strong>Order By <\/strong>\u2014 in this dropdown menu, the parameter by which the items will be sorted can be set;<\/li>\n\n\n\n<li><strong>Order <\/strong>\u2014 here, one can select ascending \u201cFrom lowest to highest values (1, 2, 3; a, b, c)\u201d or descending \u201cFrom highest to lowest values (3, 2, 1; c, b, a)\u201d order;<\/li>\n\n\n\n<li><strong>Type<\/strong> \u2014 the same options as for the <strong>Where (query clauses)<\/strong> section.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"advancedai-mode-turned-on\">Advanced\/AI mode turned on<\/h3>\n\n\n\n<p>The <strong>Advanced\/AI mode<\/strong> toggle activates such additional options:<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"618\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query-1024x618.webp\" alt=\"advanced AI mode for SQL query\" class=\"wp-image-48313\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query-600x362.webp 600w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/advanced-AI-mode-for-SQL-query.webp 1824w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/div>\n\n\n\n<ul>\n<li><strong>SQL Query <\/strong>\u2014 a textarea where the SQL query can be written manually. The <em>JetEngine <\/em><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/macros-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">macros<\/a> can be used here.<\/li>\n<\/ul>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">The WordPress database table prefix should be applied to all tables used in the query. The prefix can be found in the <strong>wp-config.php<\/strong> file. Alternatively, the {prefix} placeholder can be used before the table name \u2014 it will be automatically replaced with the actual database prefix. For example: \u2018SELECT * FROM {prefix}posts\u2019.<\/p><\/div><\/div>\n\n\n\n<p>To use AI, the \u201c<strong>magic stick<\/strong>\u201d icon should be pressed, and the pop-up for the SQL query generation will appear.<\/p>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">Currently, 60 requests per month can be made with the Lifetime subscription plan and 5 requests per month with other subscriptions.<\/p><\/div><\/div>\n\n\n\n<p>The pop-up contains a textarea for prompts, prompt tips, and prompt examples.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up.webp\" alt=\"generate query with AI pop-up\" class=\"wp-image-48314\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generate-query-with-AI-pop-up-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>The prompt examples are clickable; after pressing on one of them, the generated query can be inserted into the <strong>SQL Query <\/strong>textarea.<\/p>\n\n\n\n<ul>\n<li><strong>Count SQL Query<\/strong> \u2014 an optional query textarea to calculate the total number of results. Required for correct pagination with <em>JetSmartFilters<\/em> when using complex queries. If not set, the total count is based on the main query result.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai.webp\" alt=\"generated sql query with open ai\" class=\"wp-image-48315\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/generated-sql-query-with-open-ai-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>There are such tutorials about SQL queries generated with AI:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/sql-query-with-open-ai-dynamic-sale-notifications\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Create Dynamic Sale Notifications for WooCommerce SQL Query with Open AI<\/strong><\/a>;<\/li>\n\n\n\n<li><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-woocommerce-categories-with-products-in-stock-jetengine-ai-query\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Display WooCommerce Product Categories with Products in Stock Using Open AI Query<\/strong><\/a>;<\/li>\n\n\n\n<li><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/generating-sql-query-with-open-ai-displaying-users-birthdays\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Generate SQL Query with Open AI: Displaying Users&#8217; Birthdays<\/strong><\/a>;<\/li>\n\n\n\n<li><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetsmartfilters\/how-to-create-visual-filter-based-on-sql-query-with-open-ai\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Create Visual Filter Based on SQL Query with Open AI<\/strong><\/a>.<\/li>\n<\/ul>\n\n\n\n<p>The <strong>Cast result to instance of object <\/strong>is a dropdown that is available for both modes. It defines how the query results will be returned and handled:<\/p>\n\n\n\n<ul>\n<li><strong>Keep stdClass<\/strong> \u2014 returns results as standard PHP objects (stdClass), with no transformation;<\/li>\n\n\n\n<li><strong>Keep stdClass, unserialize properties<\/strong> \u2014 returns results as stdClass objects and automatically unserializes any serialized properties, converting them into usable PHP arrays or objects;<\/li>\n\n\n\n<li><strong>Post <\/strong>\u2014 casts each result to a WP_Post object;<\/li>\n\n\n\n<li><strong>User<\/strong> \u2014 casts results to WP_User objects;<\/li>\n\n\n\n<li><strong>Taxonomy Term<\/strong> \u2014 casts results to WP_Term objects;<\/li>\n\n\n\n<li><strong>Comment <\/strong>\u2014 casts results to WP_Comment objects;<\/li>\n\n\n\n<li><strong>Booking<\/strong> \u2014 (available if the <em><a href=\"https:\/\/crocoblock.com\/plugins\/jetbooking\/\" target=\"_blank\" rel=\"noreferrer noopener\">JetBooking<\/a><\/em> plugin is installed and activated) casts results into booking objects, which are useful for booking-related templates and filters;<\/li>\n\n\n\n<li><strong>WC Product<\/strong> \u2014 (requires <em>WooCommerce<\/em>) treats each result as a <em>WooCommerce<\/em> product object for displaying prices, SKUs, etc.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"converting-simple-sql-query-settings-to-advanced\">Converting Simple SQL Query Settings to Advanced<\/h2>\n\n\n\n<p>Suppose some SQL settings are set in the default mode (the <strong>Advanced\/AI mode<\/strong> is turned off), for example, the <strong>Where (query clauses)<\/strong>.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode.webp\" alt=\"sql query settings in the default mode\" class=\"wp-image-49416\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-in-the-default-mode-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>After switching to the <strong>Advanced\/AI mode<\/strong>, the SQL query settings will be inserted into the <strong>SQL Query<\/strong> textarea if it is empty. If the textarea already contains content, it will remain unchanged.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode.webp\" alt=\"sql query settings are parsed in the advanced mode\" class=\"wp-image-49415\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/sql-query-settings-are-parsed-in-the-advanced-mode-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>That\u2019s all about <em>JetEngine<\/em> Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites. To narrow down the displayed results, the Listing can be created as described in the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-create-query-builder-listing-template\/\"><strong>How to Create Query Builder Listing Template<\/strong><\/a> tutorial.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This overview describes the settings of Query Builder\u2019s SQL\/AI Query type, which is a part of the JetEngine plugin.<\/p>\n","protected":false},"author":8,"featured_media":0,"template":"","format":"standard","builder-category":[],"article-category":[405],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL\/AI Query Type of Query Builder \u2014 JetEngine | Crocoblock<\/title>\n<meta name=\"description\" content=\"Discover the JetEngine Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL\/AI Query Type of Query Builder \u2014 JetEngine | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"Discover the JetEngine Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-29T10:24:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings.webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/\",\"name\":\"SQL\/AI Query Type of Query Builder \u2014 JetEngine | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2025-09-01T12:12:57+00:00\",\"dateModified\":\"2026-05-29T10:24:49+00:00\",\"description\":\"Discover the JetEngine Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Query Builder SQL Query Type\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"name\":\"Help Center\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\",\"name\":\"Help Center\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"contentUrl\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"caption\":\"Help Center\"},\"image\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL\/AI Query Type of Query Builder \u2014 JetEngine | Crocoblock","description":"Discover the JetEngine Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/","og_locale":"en_US","og_type":"article","og_title":"SQL\/AI Query Type of Query Builder \u2014 JetEngine | Crocoblock","og_description":"Discover the JetEngine Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/","og_site_name":"Help Center","article_modified_time":"2026-05-29T10:24:49+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2021\/05\/sql-query-general-settings.webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/","url":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/","name":"SQL\/AI Query Type of Query Builder \u2014 JetEngine | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2025-09-01T12:12:57+00:00","dateModified":"2026-05-29T10:24:49+00:00","description":"Discover the JetEngine Query Builder\u2019s SQL\/AI Query type, which retrieves data from database tables for use on WordPress websites.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/jetengine-query-builder-sql-query-type\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/crocoblock.com\/knowledge-base\/articles\/"},{"@type":"ListItem","position":3,"name":"Query Builder SQL Query Type"}]},{"@type":"WebSite","@id":"https:\/\/crocoblock.com\/knowledge-base\/#website","url":"https:\/\/crocoblock.com\/knowledge-base\/","name":"Help Center","description":"","publisher":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization","name":"Help Center","url":"https:\/\/crocoblock.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","contentUrl":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","caption":"Help Center"},"image":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article\/22683"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/8"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=22683"}],"wp:term":[{"taxonomy":"builder-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/builder-category?post=22683"},{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article-category?post=22683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}