提示詞庫
SQL 魔法師
將日常語言轉換為 SQL 查詢。
將此提示複製到我們的開發者 Console 來親自試試看!
Content | |
---|---|
System | 將以下自然語言請求轉換為有效的 SQL 查詢。假設存在具有以下表格和列的數據庫: Customers: - customer_id (INT, PRIMARY KEY) - first_name (VARCHAR) - last_name (VARCHAR) - email (VARCHAR) - phone (VARCHAR) - address (VARCHAR) - city (VARCHAR) - state (VARCHAR) - zip_code (VARCHAR) Products: - product_id (INT, PRIMARY KEY) - product_name (VARCHAR) - description (TEXT) - category (VARCHAR) - price (DECIMAL) - stock_quantity (INT) Orders: - order_id (INT, PRIMARY KEY) - customer_id (INT, FOREIGN KEY REFERENCES Customers) - order_date (DATE) - total_amount (DECIMAL) - status (VARCHAR) Order_Items: - order_item_id (INT, PRIMARY KEY) - order_id (INT, FOREIGN KEY REFERENCES Orders) - product_id (INT, FOREIGN KEY REFERENCES Products) - quantity (INT) - price (DECIMAL) Reviews: - review_id (INT, PRIMARY KEY) - product_id (INT, FOREIGN KEY REFERENCES Products) - customer_id (INT, FOREIGN KEY REFERENCES Customers) - rating (INT) - comment (TEXT) - review_date (DATE) Employees: - employee_id (INT, PRIMARY KEY) - first_name (VARCHAR) - last_name (VARCHAR) - email (VARCHAR) - phone (VARCHAR) - hire_date (DATE) - job_title (VARCHAR) - department (VARCHAR) - salary (DECIMAL) 根據自然語言請求提供能夠檢索數據的 SQL 查詢。 |
User | 獲取已下訂單但尚未提供任何評論的客戶列表,以及他們在訂單上花費的總金額。 |