text
stringlengths
190
342
<s>[INST] Write a SQL code to count the number of shops for each unique member type name in English. [/INST] SELECT shop_member_type_name_en, COUNT(*) AS total_shops_per_member_type_name_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_member_type_name_en; </s>
<s>[INST] Write a SQL code to find the average longitude value of all shop locations. [/INST] SELECT AVG(shop_longitude) AS average_longitude FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to determine the average latitude value of all shop locations. [/INST] SELECT AVG(shop_latitude) AS average_latitude FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique subdistrict based on their addresses. [/INST] SELECT shop_address_subdistrict, COUNT(*) AS total_shops_per_subdistrict FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_subdistrict; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique volume name in English. [/INST] SELECT shop_volume_name_en, COUNT(*) AS total_shops_per_volume_name_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_volume_name_en; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique category name in English. [/INST] SELECT shop_category_name_en, COUNT(*) AS total_shops_per_category_name_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_category_name_en; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique photo quality control status. [/INST] SELECT shop_photo_qc_status, COUNT(*) AS total_shops_per_photo_qc_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_photo_qc_status; </s>
<s>[INST] Write a SQL code to identify the number of shops for each unique point-of-sale (POS) end date. [/INST] SELECT shop_pos_end_date, COUNT(*) AS total_shops_per_pos_end_date FROM order_transaction.transaction_detail_deprecated GROUP BY shop_pos_end_date; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique subdistrict in English. [/INST] SELECT shop_subdistrict_en, COUNT(*) AS total_shops_per_subdistrict_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_subdistrict_en; </s>
<s>[INST] Write a SQL code to find the average POS step value for all shops. [/INST] SELECT AVG(shop_pos_step) AS average_pos_step FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique province in English. [/INST] SELECT shop_province_en, COUNT(*) AS total_shops_per_province_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_province_en; </s>
<s>[INST] Write a SQL code to identify the earliest start date of the point-of-sale (POS) system for all shops. [/INST] SELECT MIN(shop_pos_start_date) AS earliest_pos_start_date FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique POS status. [/INST] SELECT shop_pos_status, COUNT(*) AS total_shops_per_pos_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_pos_status; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique POS reference ID. [/INST] SELECT shop_pos_reference_id, COUNT(*) AS total_shops_per_pos_reference_id FROM order_transaction.transaction_detail_deprecated GROUP BY shop_pos_reference_id; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique provider ID. [/INST] SELECT shop_provider_id, COUNT(*) AS total_shops_per_provider_id FROM order_transaction.transaction_detail_deprecated GROUP BY shop_provider_id; </s>
<s>[INST] Write a SQL code to identify the latest update date of the point-of-sale (POS) system for all shops. [/INST] SELECT MAX(shop_pos_update_date) AS latest_pos_update_date FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to count the number of shops with non-null photo entries. [/INST] SELECT COUNT(*) AS total_shops_with_photos FROM order_transaction.transaction_detail_deprecated WHERE shop_photo IS NOT NULL; </s>
<s>[INST] Write a SQL code to find the earliest date when shop quality control was last updated. [/INST] SELECT MIN(shop_qc_updated_at) AS earliest_qc_update_date FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to determine the total number of shops updated by each unique entity in the quality control process. [/INST] SELECT shop_qc_updated_by, COUNT(*) AS total_shops_updated_by_entity FROM order_transaction.transaction_detail_deprecated GROUP BY shop_qc_updated_by; </s>
<s>[INST] Write a SQL code to count the number of shops flagged as part of quality control. [/INST] SELECT COUNT(*) AS total_shops_flagged_qc FROM order_transaction.transaction_detail_deprecated WHERE shop_quality_control_flag = 1; </s>
<s>[INST] Write a SQL code to find the total number of shops assigned to each unique quality control (QC) assignee. [/INST] SELECT shop_qc_assignee_id, COUNT(*) AS total_shops_per_qc_assignee FROM order_transaction.transaction_detail_deprecated GROUP BY shop_qc_assignee_id; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique quality control status. [/INST] SELECT shop_qc_status, COUNT(*) AS total_shops_per_qc_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_qc_status; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique district based on their addresses. [/INST] SELECT shop_address_district, COUNT(*) AS total_shops_per_district FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_district; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique address type name in English. [/INST] SELECT shop_address_type_name_en, COUNT(*) AS total_shops_per_address_type_name_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_type_name_en; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique postal code area based on their addresses. [/INST] SELECT shop_address_postal_code, COUNT(*) AS total_shops_per_postal_code FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_postal_code; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique address quality control status. [/INST] SELECT shop_address_qc_status, COUNT(*) AS total_shops_per_address_qc_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_qc_status; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique province based on their addresses. [/INST] SELECT shop_address_province, COUNT(*) AS total_shops_per_province FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_province; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique branch code. [/INST] SELECT shop_branch_code, COUNT(*) AS total_shops_per_branch_code FROM order_transaction.transaction_detail_deprecated GROUP BY shop_branch_code; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique address type name in Thai. [/INST] SELECT shop_address_type_name_th, COUNT(*) AS total_shops_per_address_type_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_type_name_th; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique merchant status. [/INST] SELECT shop_address_type_name_th, COUNT(*) AS total_shops_per_address_type_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_address_type_name_th; </s>
<s>[INST] Write a SQL code to count the number of users born in each unique birth date. [/INST] SELECT user_birth_date, COUNT(*) AS total_users_per_birth_date FROM order_transaction.transaction_detail_deprecated GROUP BY user_birth_date; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique volume name in Thai. [/INST] SELECT shop_volume_name_th, COUNT(*) AS total_shops_per_volume_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_volume_name_th; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique merchant name. [/INST] SELECT shop_merchant_name, COUNT(*) AS total_shops_per_merchant_name FROM order_transaction.transaction_detail_deprecated GROUP BY shop_merchant_name; </s>
<s>[INST] Write a SQL code to identify the number of shops for each unique member type name in Thai. [/INST] SELECT shop_member_type_name_th, COUNT(*) AS total_shops_per_member_type_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_member_type_name_th; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique category quality control status. [/INST] SELECT shop_category_qc_status, COUNT(*) AS total_shops_per_category_qc_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_category_qc_status; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique category name in Thai. [/INST] SELECT shop_category_name_th, COUNT(*) AS total_shops_per_category_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_category_name_th; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique channel name in English. [/INST] SELECT shop_channel_name_en, COUNT(*) AS total_shops_per_channel_name_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_channel_name_en; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique channel name in English. [/INST] SELECT shop_status, COUNT(*) AS total_shops_per_shop_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_status; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique merchant status reason. [/INST] SELECT shop_merchant_status_reason, COUNT(*) AS total_shops_per_merchant_status_reason FROM order_transaction.transaction_detail_deprecated GROUP BY shop_merchant_status_reason; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique registration channel ID. [/INST] SELECT shop_register_channel_id, COUNT(*) AS total_shops_per_register_channel_id FROM order_transaction.transaction_detail_deprecated GROUP BY shop_register_channel_id; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique merchant type name in English. [/INST] SELECT shop_merchant_type_name_en, COUNT(*) AS total_shops_per_merchant_type_name_en FROM order_transaction.transaction_detail_deprecated GROUP BY shop_merchant_type_name_en; </s>
<s>[INST] Write a SQL code to determine the total number of shops for each unique report type. [/INST] SELECT shop_report_type, COUNT(*) AS total_shops_per_report_type FROM order_transaction.transaction_detail_deprecated GROUP BY shop_report_type; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique referral code. [/INST] SELECT shop_referral_code, COUNT(*) AS total_shops_per_referral_code FROM order_transaction.transaction_detail_deprecated GROUP BY shop_referral_code; </s>
<s>[INST] Write a SQL code to count the total number of unique shop IDs in the database. [/INST] SELECT COUNT(DISTINCT shop_id) AS total_unique_shop_ids FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to identify the number of shops for each unique operation hour quality control status. [/INST] SELECT shop_operation_hour_qc_status, COUNT(*) AS total_shops_per_operation_hour_qc_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_operation_hour_qc_status; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique Siam Commercial Bank (SCB) account type. [/INST] SELECT shop_scb_account_type, COUNT(*) AS total_shops_per_scb_account_type FROM order_transaction.transaction_detail_deprecated GROUP BY shop_scb_account_type; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique merchant type name in Thai. [/INST] SELECT shop_merchant_type_name_th, COUNT(*) AS total_shops_per_merchant_type_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_merchant_type_name_th; </s>
<s>[INST] Write a SQL code to determine the average date of birth for users associated with each shop. [/INST] SELECT shop_name, AVG(shop_merchant_user_date_of_birth) AS average_date_of_birth FROM order_transaction.transaction_detail_deprecated GROUP BY shop_name; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique channel name in Thai. [/INST] SELECT shop_channel_name_th, COUNT(*) AS total_shops_per_channel_name_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_channel_name_th; </s>
<s>[INST] Write a SQL code to count the number of shops with non-null descriptions. [/INST] SELECT COUNT(*) AS total_shops_with_descriptions FROM order_transaction.transaction_detail_deprecated WHERE shop_description IS NOT NULL; </s>
<s>[INST] Write a SQL code to determine the number of shops associated with each unique merchant user RMID. [/INST] SELECT shop_merchant_user_rmid, COUNT(*) AS total_shops_per_merchant_user_rmid FROM order_transaction.transaction_detail_deprecated GROUP BY shop_merchant_user_rmid; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique VAT address ID. [/INST] SELECT shop_vat_address_id, COUNT(*) AS total_shops_per_vat_address_id FROM order_transaction.transaction_detail_deprecated GROUP BY shop_vat_address_id; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique merchant user status. [/INST] SELECT shop_merchant_user_status, COUNT(*) AS total_shops_per_merchant_user_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_merchant_user_status; </s>
<s>[INST] Write a SQL code to identify the number of shops for each unique shop name. [/INST] SELECT shop_name, COUNT(*) AS total_shops_per_name FROM order_transaction.transaction_detail_deprecated GROUP BY shop_name; </s>
<s>[INST] Write a SQL code to count the total number of unique merchant user IDs in the database. [/INST] SELECT COUNT(DISTINCT shop_merchant_user_id) AS total_unique_merchant_user_ids FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique food category quality control status. [/INST] SELECT shop_food_category_qc_status, COUNT(*) AS total_shops_per_food_category_qc_status FROM order_transaction.transaction_detail_deprecated GROUP BY shop_food_category_qc_status; </s>
<s>[INST] Write a SQL code to determine the earliest date when shop quality control was assigned. [/INST] SELECT MIN(shop_qc_assign_at) AS earliest_qc_assign_date FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique user role code associated with the shop. [/INST] SELECT shop_user_role_code, COUNT(*) AS total_shops_per_user_role_code FROM order_transaction.transaction_detail_deprecated GROUP BY shop_user_role_code; </s>
<s>[INST] Write a SQL code to find the total number of shops for each unique district in Thai (Thailand). [/INST] SELECT shop_district_th, COUNT(*) AS total_shops_per_district_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_district_th; </s>
<s>[INST] Write a SQL code to count the number of shops for each unique province in Thai (Thailand). [/INST] SELECT shop_province_th, COUNT(*) AS total_shops_per_province_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_province_th; </s>
<s>[INST] Write a SQL code to count the number of shops in each unique subdistrict in Thai (Thailand). [/INST] SELECT shop_subdistrict_th, COUNT(*) AS total_shops_per_subdistrict_th FROM order_transaction.transaction_detail_deprecated GROUP BY shop_subdistrict_th; </s>
<s>[INST] Write a SQL code to determine the total number of orders for each unique date partition. [/INST] SELECT order_date_partition, COUNT(*) AS total_orders_per_date_partition FROM order_transaction.transaction_detail_deprecated GROUP BY order_date_partition; </s>
<s>[INST] Write a SQL code to find the total amount for delivery charges from all orders. [/INST] SELECT SUM(order_delivery_amount) AS total_delivery_charges FROM order_transaction.transaction_detail_deprecated; </s>
<s>[INST] Write a SQL code to calculate the total discount amount applied to Delivery Service (DS) charges from all orders. [/INST] SELECT SUM(order_ds_discount) AS total_ds_discount_amount FROM order_transaction.transaction_detail_deprecated; </s>