Commit ·
fc8480f
1
Parent(s): 9419d93
Upload sql4.csv
Browse files
sql4.csv
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SQL Query,Description,text
|
| 2 |
+
SELECT * FROM Customers WHERE Country = 'USA';,Retrieve all customers from the USA.,"###Human:
|
| 3 |
+
Retrieve all customers from the USA.
|
| 4 |
+
|
| 5 |
+
###Assistant:
|
| 6 |
+
SELECT * FROM Customers WHERE Country = 'USA';"
|
| 7 |
+
"SELECT ProductName, Price FROM Products WHERE Category = 'Electronics';",Get the names and prices of products in the Electronics category.,"###Human:
|
| 8 |
+
Get the names and prices of products in the Electronics category.
|
| 9 |
+
|
| 10 |
+
###Assistant:
|
| 11 |
+
SELECT ProductName, Price FROM Products WHERE Category = 'Electronics';"
|
| 12 |
+
SELECT AVG(Age) FROM Employees;,Calculate the average age of all employees.,"###Human:
|
| 13 |
+
Calculate the average age of all employees.
|
| 14 |
+
|
| 15 |
+
###Assistant:
|
| 16 |
+
SELECT AVG(Age) FROM Employees;"
|
| 17 |
+
SELECT COUNT(*) FROM Orders WHERE ShipCountry = 'Germany';,Count the number of orders shipped to Germany.,"###Human:
|
| 18 |
+
Count the number of orders shipped to Germany.
|
| 19 |
+
|
| 20 |
+
###Assistant:
|
| 21 |
+
SELECT COUNT(*) FROM Orders WHERE ShipCountry = 'Germany';"
|
| 22 |
+
"SELECT FirstName, LastName, Salary FROM Employees WHERE Salary > 50000;","Fetch first name, last name, and salary of employees earning over $50,000.","###Human:
|
| 23 |
+
Fetch first name, last name, and salary of employees earning over $50,000.
|
| 24 |
+
|
| 25 |
+
###Assistant:
|
| 26 |
+
SELECT FirstName, LastName, Salary FROM Employees WHERE Salary > 50000;"
|
| 27 |
+
"SELECT Category, MAX(Price) FROM Products GROUP BY Category;",Find the highest price for each product category.,"###Human:
|
| 28 |
+
Find the highest price for each product category.
|
| 29 |
+
|
| 30 |
+
###Assistant:
|
| 31 |
+
SELECT Category, MAX(Price) FROM Products GROUP BY Category;"
|
| 32 |
+
UPDATE Customers SET City = 'New York' WHERE Country = 'USA';,Update the city of all USA customers to 'New York'.,"###Human:
|
| 33 |
+
Update the city of all USA customers to 'New York'.
|
| 34 |
+
|
| 35 |
+
###Assistant:
|
| 36 |
+
UPDATE Customers SET City = 'New York' WHERE Country = 'USA';"
|
| 37 |
+
DELETE FROM Orders WHERE OrderDate < '2023-01-01';,"Delete orders placed before January 1, 2023.","###Human:
|
| 38 |
+
Delete orders placed before January 1, 2023.
|
| 39 |
+
|
| 40 |
+
###Assistant:
|
| 41 |
+
DELETE FROM Orders WHERE OrderDate < '2023-01-01';"
|
| 42 |
+
"INSERT INTO Products (ProductName, Price, Category) VALUES ('Smartphone', 599, 'Electronics');",Insert a new product 'Smartphone' with price $599 into the Electronics category.,"###Human:
|
| 43 |
+
Insert a new product 'Smartphone' with price $599 into the Electronics category.
|
| 44 |
+
|
| 45 |
+
###Assistant:
|
| 46 |
+
INSERT INTO Products (ProductName, Price, Category) VALUES ('Smartphone', 599, 'Electronics');"
|
| 47 |
+
SELECT DISTINCT Country FROM Customers;,Retrieve a list of unique countries from the Customers table.,"###Human:
|
| 48 |
+
Retrieve a list of unique countries from the Customers table.
|
| 49 |
+
|
| 50 |
+
###Assistant:
|
| 51 |
+
SELECT DISTINCT Country FROM Customers;"
|
| 52 |
+
"SELECT OrderID, COUNT(ProductID) FROM OrderDetails GROUP BY OrderID HAVING COUNT(ProductID) > 5;",Get the order IDs with more than 5 products in the OrderDetails table.,"###Human:
|
| 53 |
+
Get the order IDs with more than 5 products in the OrderDetails table.
|
| 54 |
+
|
| 55 |
+
###Assistant:
|
| 56 |
+
SELECT OrderID, COUNT(ProductID) FROM OrderDetails GROUP BY OrderID HAVING COUNT(ProductID) > 5;"
|
| 57 |
+
"SELECT LastName, FirstName FROM Employees ORDER BY LastName ASC, FirstName ASC;","Retrieve employees' last names and first names, sorted alphabetically by last name and then first name.","###Human:
|
| 58 |
+
Retrieve employees' last names and first names, sorted alphabetically by last name and then first name.
|
| 59 |
+
|
| 60 |
+
###Assistant:
|
| 61 |
+
SELECT LastName, FirstName FROM Employees ORDER BY LastName ASC, FirstName ASC;"
|
| 62 |
+
SELECT ProductName FROM Products WHERE Price BETWEEN 50 AND 100;,Find product names with prices between $50 and $100.,"###Human:
|
| 63 |
+
Find product names with prices between $50 and $100.
|
| 64 |
+
|
| 65 |
+
###Assistant:
|
| 66 |
+
SELECT ProductName FROM Products WHERE Price BETWEEN 50 AND 100;"
|
| 67 |
+
"SELECT Category, COUNT(*) FROM Products GROUP BY Category ORDER BY COUNT(*) DESC;","List product categories and their counts, ordered by count in descending order.","###Human:
|
| 68 |
+
List product categories and their counts, ordered by count in descending order.
|
| 69 |
+
|
| 70 |
+
###Assistant:
|
| 71 |
+
SELECT Category, COUNT(*) FROM Products GROUP BY Category ORDER BY COUNT(*) DESC;"
|
| 72 |
+
"SELECT CustomerName, COUNT(OrderID) FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID GROUP BY CustomerName;","Count the number of orders for each customer, including customers with zero orders.","###Human:
|
| 73 |
+
Count the number of orders for each customer, including customers with zero orders.
|
| 74 |
+
|
| 75 |
+
###Assistant:
|
| 76 |
+
SELECT CustomerName, COUNT(OrderID) FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID GROUP BY CustomerName;"
|
| 77 |
+
SELECT ProductName FROM Products WHERE Price BETWEEN 50 AND 100;,Find product names with prices between $50 and $100.,"###Human:
|
| 78 |
+
Find product names with prices between $50 and $100.
|
| 79 |
+
|
| 80 |
+
###Assistant:
|
| 81 |
+
SELECT ProductName FROM Products WHERE Price BETWEEN 50 AND 100;"
|
| 82 |
+
"SELECT Category, COUNT(*) FROM Products GROUP BY Category ORDER BY COUNT(*) DESC;","List product categories and their counts, ordered by count in descending order.","###Human:
|
| 83 |
+
List product categories and their counts, ordered by count in descending order.
|
| 84 |
+
|
| 85 |
+
###Assistant:
|
| 86 |
+
SELECT Category, COUNT(*) FROM Products GROUP BY Category ORDER BY COUNT(*) DESC;"
|
| 87 |
+
"SELECT CustomerName, COUNT(OrderID) FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID GROUP BY CustomerName;","Count the number of orders for each customer, including customers with zero orders.","###Human:
|
| 88 |
+
Count the number of orders for each customer, including customers with zero orders.
|
| 89 |
+
|
| 90 |
+
###Assistant:
|
| 91 |
+
SELECT CustomerName, COUNT(OrderID) FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID GROUP BY CustomerName;"
|
| 92 |
+
"SELECT CustomerName, OrderDate FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE Country = 'France';",Retrieve customer names and order dates for orders from customers in France.,"###Human:
|
| 93 |
+
Retrieve customer names and order dates for orders from customers in France.
|
| 94 |
+
|
| 95 |
+
###Assistant:
|
| 96 |
+
SELECT CustomerName, OrderDate FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE Country = 'France';"
|
| 97 |
+
SELECT * FROM employees WHERE department = 'Sales';,Retrieve all employees from the 'Sales' department.,"###Human:
|
| 98 |
+
Retrieve all employees from the 'Sales' department.
|
| 99 |
+
|
| 100 |
+
###Assistant:
|
| 101 |
+
SELECT * FROM employees WHERE department = 'Sales';"
|
| 102 |
+
"SELECT product_name, price FROM products WHERE price > 100;",Get the names and prices of products that cost more than $100.,"###Human:
|
| 103 |
+
Get the names and prices of products that cost more than $100.
|
| 104 |
+
|
| 105 |
+
###Assistant:
|
| 106 |
+
SELECT product_name, price FROM products WHERE price > 100;"
|
| 107 |
+
"SELECT customer_id, COUNT(order_id) AS order_count FROM orders GROUP BY customer_id;",Count the number of orders for each customer.,"###Human:
|
| 108 |
+
Count the number of orders for each customer.
|
| 109 |
+
|
| 110 |
+
###Assistant:
|
| 111 |
+
SELECT customer_id, COUNT(order_id) AS order_count FROM orders GROUP BY customer_id;"
|
| 112 |
+
"SELECT customers.customer_name, orders.order_date FROM customers JOIN orders ON customers.customer_id = orders.customer_id;",Retrieve customer names and their order dates using a table join.,"###Human:
|
| 113 |
+
Retrieve customer names and their order dates using a table join.
|
| 114 |
+
|
| 115 |
+
###Assistant:
|
| 116 |
+
SELECT customers.customer_name, orders.order_date FROM customers JOIN orders ON customers.customer_id = orders.customer_id;"
|
| 117 |
+
"SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department;",Calculate the average salary for each department.,"###Human:
|
| 118 |
+
Calculate the average salary for each department.
|
| 119 |
+
|
| 120 |
+
###Assistant:
|
| 121 |
+
SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department;"
|
| 122 |
+
"SELECT product_name, price FROM products ORDER BY price DESC LIMIT 1;",Find the product with the highest price.,"###Human:
|
| 123 |
+
Find the product with the highest price.
|
| 124 |
+
|
| 125 |
+
###Assistant:
|
| 126 |
+
SELECT product_name, price FROM products ORDER BY price DESC LIMIT 1;"
|
| 127 |
+
"SELECT order_id, SUM(price * quantity) AS total_revenue FROM order_items GROUP BY order_id;",Calculate the total revenue for each order from the order items.,"###Human:
|
| 128 |
+
Calculate the total revenue for each order from the order items.
|
| 129 |
+
|
| 130 |
+
###Assistant:
|
| 131 |
+
SELECT order_id, SUM(price * quantity) AS total_revenue FROM order_items GROUP BY order_id;"
|
| 132 |
+
SELECT * FROM customers WHERE email IS NOT NULL;,Retrieve customers with non-null email addresses.,"###Human:
|
| 133 |
+
Retrieve customers with non-null email addresses.
|
| 134 |
+
|
| 135 |
+
###Assistant:
|
| 136 |
+
SELECT * FROM customers WHERE email IS NOT NULL;"
|
| 137 |
+
"SELECT product_name, category, price FROM products ORDER BY category, price;",Sort products by category and within each category by price.,"###Human:
|
| 138 |
+
Sort products by category and within each category by price.
|
| 139 |
+
|
| 140 |
+
###Assistant:
|
| 141 |
+
SELECT product_name, category, price FROM products ORDER BY category, price;"
|
| 142 |
+
SELECT product_name FROM products WHERE category_id IN (SELECT category_id FROM categories WHERE category_name = 'Electronics');,Retrieve product names from the 'Electronics' category using a subquery.,"###Human:
|
| 143 |
+
Retrieve product names from the 'Electronics' category using a subquery.
|
| 144 |
+
|
| 145 |
+
###Assistant:
|
| 146 |
+
SELECT product_name FROM products WHERE category_id IN (SELECT category_id FROM categories WHERE category_name = 'Electronics');"
|
| 147 |
+
UPDATE employees SET salary = salary * 1.1 WHERE department = 'Sales';,Increase the salary by 10% for all employees in the 'Sales' department.,"###Human:
|
| 148 |
+
Increase the salary by 10% for all employees in the 'Sales' department.
|
| 149 |
+
|
| 150 |
+
###Assistant:
|
| 151 |
+
UPDATE employees SET salary = salary * 1.1 WHERE department = 'Sales';"
|
| 152 |
+
DELETE FROM products WHERE stock_quantity <= 10;,Delete products with stock quantity less than or equal to 10.,"###Human:
|
| 153 |
+
Delete products with stock quantity less than or equal to 10.
|
| 154 |
+
|
| 155 |
+
###Assistant:
|
| 156 |
+
DELETE FROM products WHERE stock_quantity <= 10;"
|
| 157 |
+
"SELECT customers.customer_name, orders.order_date FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id;",Retrieve customer names and their order dates using a LEFT JOIN.,"###Human:
|
| 158 |
+
Retrieve customer names and their order dates using a LEFT JOIN.
|
| 159 |
+
|
| 160 |
+
###Assistant:
|
| 161 |
+
SELECT customers.customer_name, orders.order_date FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id;"
|
| 162 |
+
UPDATE orders SET status = 'Shipped' WHERE order_date < '2023-01-01';,"Update the status to 'Shipped' for orders placed before January 1, 2023.","###Human:
|
| 163 |
+
Update the status to 'Shipped' for orders placed before January 1, 2023.
|
| 164 |
+
|
| 165 |
+
###Assistant:
|
| 166 |
+
UPDATE orders SET status = 'Shipped' WHERE order_date < '2023-01-01';"
|
| 167 |
+
DELETE FROM employees WHERE hire_date < '2020-01-01';,"Delete employees hired before January 1, 2020.","###Human:
|
| 168 |
+
Delete employees hired before January 1, 2020.
|
| 169 |
+
|
| 170 |
+
###Assistant:
|
| 171 |
+
DELETE FROM employees WHERE hire_date < '2020-01-01';"
|
| 172 |
+
"SELECT customers.customer_name, COUNT(orders.order_id) AS order_count FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id GROUP BY customers.customer_name;","Count the number of orders for each customer, even those without orders.","###Human:
|
| 173 |
+
Count the number of orders for each customer, even those without orders.
|
| 174 |
+
|
| 175 |
+
###Assistant:
|
| 176 |
+
SELECT customers.customer_name, COUNT(orders.order_id) AS order_count FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id GROUP BY customers.customer_name;"
|
| 177 |
+
UPDATE products SET price = price * 0.9 WHERE category = 'Electronics';,Apply a 10% discount on prices for products in the 'Electronics' category.,"###Human:
|
| 178 |
+
Apply a 10% discount on prices for products in the 'Electronics' category.
|
| 179 |
+
|
| 180 |
+
###Assistant:
|
| 181 |
+
UPDATE products SET price = price * 0.9 WHERE category = 'Electronics';"
|
| 182 |
+
DELETE FROM categories WHERE category_name = 'Obsolete';,Delete the 'Obsolete' category from the categories table.,"###Human:
|
| 183 |
+
Delete the 'Obsolete' category from the categories table.
|
| 184 |
+
|
| 185 |
+
###Assistant:
|
| 186 |
+
DELETE FROM categories WHERE category_name = 'Obsolete';"
|
| 187 |
+
"SELECT employees.employee_name, departments.department_name FROM employees INNER JOIN departments ON employees.department_id = departments.department_id;",Retrieve employee names and their department names using an INNER JOIN.,"###Human:
|
| 188 |
+
Retrieve employee names and their department names using an INNER JOIN.
|
| 189 |
+
|
| 190 |
+
###Assistant:
|
| 191 |
+
SELECT employees.employee_name, departments.department_name FROM employees INNER JOIN departments ON employees.department_id = departments.department_id;"
|
| 192 |
+
UPDATE customers SET last_purchase_date = '2023-07-31' WHERE last_purchase_date IS NULL;,"Set the last purchase date to July 31, 2023, for customers with no previous purchase date.","###Human:
|
| 193 |
+
Set the last purchase date to July 31, 2023, for customers with no previous purchase date.
|
| 194 |
+
|
| 195 |
+
###Assistant:
|
| 196 |
+
UPDATE customers SET last_purchase_date = '2023-07-31' WHERE last_purchase_date IS NULL;"
|
| 197 |
+
UPDATE servers SET status = 'online' WHERE environment = 'production';,Change the status of servers in the 'production' environment to 'online'.,"###Human:
|
| 198 |
+
Change the status of servers in the 'production' environment to 'online'.
|
| 199 |
+
|
| 200 |
+
###Assistant:
|
| 201 |
+
UPDATE servers SET status = 'online' WHERE environment = 'production';"
|
| 202 |
+
DELETE FROM applications WHERE last_deployed < '2023-01-01';,"Delete applications that were last deployed before January 1, 2023.","###Human:
|
| 203 |
+
Delete applications that were last deployed before January 1, 2023.
|
| 204 |
+
|
| 205 |
+
###Assistant:
|
| 206 |
+
DELETE FROM applications WHERE last_deployed < '2023-01-01';"
|
| 207 |
+
"SELECT server_name, COUNT(*) AS instance_count FROM instances GROUP BY server_name;",Count the number of instances running on each server.,"###Human:
|
| 208 |
+
Count the number of instances running on each server.
|
| 209 |
+
|
| 210 |
+
###Assistant:
|
| 211 |
+
SELECT server_name, COUNT(*) AS instance_count FROM instances GROUP BY server_name;"
|
| 212 |
+
UPDATE databases SET backup_enabled = 1 WHERE environment = 'staging';,Enable database backups for databases in the 'staging' environment.,"###Human:
|
| 213 |
+
Enable database backups for databases in the 'staging' environment.
|
| 214 |
+
|
| 215 |
+
###Assistant:
|
| 216 |
+
UPDATE databases SET backup_enabled = 1 WHERE environment = 'staging';"
|
| 217 |
+
DELETE FROM containers WHERE resource_utilization > 90;,Delete containers with resource utilization over 90%.,"###Human:
|
| 218 |
+
Delete containers with resource utilization over 90%.
|
| 219 |
+
|
| 220 |
+
###Assistant:
|
| 221 |
+
DELETE FROM containers WHERE resource_utilization > 90;"
|
| 222 |
+
"SELECT application_name, SUM(response_time) AS total_response_time FROM logs GROUP BY application_name;",Calculate the total response time for each application from log data.,"###Human:
|
| 223 |
+
Calculate the total response time for each application from log data.
|
| 224 |
+
|
| 225 |
+
###Assistant:
|
| 226 |
+
SELECT application_name, SUM(response_time) AS total_response_time FROM logs GROUP BY application_name;"
|
| 227 |
+
UPDATE load_balancers SET active = 0 WHERE traffic_threshold > 80;,Deactivate load balancers with a traffic threshold higher than 80%.,"###Human:
|
| 228 |
+
Deactivate load balancers with a traffic threshold higher than 80%.
|
| 229 |
+
|
| 230 |
+
###Assistant:
|
| 231 |
+
UPDATE load_balancers SET active = 0 WHERE traffic_threshold > 80;"
|
| 232 |
+
DELETE FROM deployments WHERE deployment_date < '2023-03-01';,"Remove deployment records that are dated before March 1, 2023.","###Human:
|
| 233 |
+
Remove deployment records that are dated before March 1, 2023.
|
| 234 |
+
|
| 235 |
+
###Assistant:
|
| 236 |
+
DELETE FROM deployments WHERE deployment_date < '2023-03-01';"
|
| 237 |
+
"SELECT server_name, COUNT(*) AS error_count FROM logs WHERE log_level = 'error' GROUP BY server_name;",Count the number of error logs on each server.,"###Human:
|
| 238 |
+
Count the number of error logs on each server.
|
| 239 |
+
|
| 240 |
+
###Assistant:
|
| 241 |
+
SELECT server_name, COUNT(*) AS error_count FROM logs WHERE log_level = 'error' GROUP BY server_name;"
|
| 242 |
+
UPDATE environments SET auto_scaling = 1 WHERE usage > 70;,Enable auto-scaling for environments with usage over 70%.,"###Human:
|
| 243 |
+
Enable auto-scaling for environments with usage over 70%.
|
| 244 |
+
|
| 245 |
+
###Assistant:
|
| 246 |
+
UPDATE environments SET auto_scaling = 1 WHERE usage > 70;"
|
| 247 |
+
UPDATE servers SET maintenance_mode = 1 WHERE environment = 'development';,Activate maintenance mode for servers in the 'development' environment.,"###Human:
|
| 248 |
+
Activate maintenance mode for servers in the 'development' environment.
|
| 249 |
+
|
| 250 |
+
###Assistant:
|
| 251 |
+
UPDATE servers SET maintenance_mode = 1 WHERE environment = 'development';"
|
| 252 |
+
DELETE FROM backup_jobs WHERE completion_date < '2023-01-01';,"Remove backup jobs that were completed before January 1, 2023.","###Human:
|
| 253 |
+
Remove backup jobs that were completed before January 1, 2023.
|
| 254 |
+
|
| 255 |
+
###Assistant:
|
| 256 |
+
DELETE FROM backup_jobs WHERE completion_date < '2023-01-01';"
|
| 257 |
+
"SELECT app_name, AVG(response_time) AS average_response_time FROM app_logs GROUP BY app_name;",Calculate the average response time for each application from log data.,"###Human:
|
| 258 |
+
Calculate the average response time for each application from log data.
|
| 259 |
+
|
| 260 |
+
###Assistant:
|
| 261 |
+
SELECT app_name, AVG(response_time) AS average_response_time FROM app_logs GROUP BY app_name;"
|
| 262 |
+
UPDATE database_clusters SET replication_enabled = 1 WHERE environment = 'production';,Enable replication for database clusters in the 'production' environment.,"###Human:
|
| 263 |
+
Enable replication for database clusters in the 'production' environment.
|
| 264 |
+
|
| 265 |
+
###Assistant:
|
| 266 |
+
UPDATE database_clusters SET replication_enabled = 1 WHERE environment = 'production';"
|
| 267 |
+
DELETE FROM container_instances WHERE memory_utilization > 80;,Delete container instances with memory utilization over 80%.,"###Human:
|
| 268 |
+
Delete container instances with memory utilization over 80%.
|
| 269 |
+
|
| 270 |
+
###Assistant:
|
| 271 |
+
DELETE FROM container_instances WHERE memory_utilization > 80;"
|
| 272 |
+
"SELECT service_name, MAX(response_time) AS max_response_time FROM service_metrics GROUP BY service_name;",Find the maximum response time for each service from metrics data.,"###Human:
|
| 273 |
+
Find the maximum response time for each service from metrics data.
|
| 274 |
+
|
| 275 |
+
###Assistant:
|
| 276 |
+
SELECT service_name, MAX(response_time) AS max_response_time FROM service_metrics GROUP BY service_name;"
|
| 277 |
+
UPDATE caching_servers SET caching_enabled = 0 WHERE cache_hit_rate < 0.5;,Disable caching for servers with a cache hit rate lower than 50%.,"###Human:
|
| 278 |
+
Disable caching for servers with a cache hit rate lower than 50%.
|
| 279 |
+
|
| 280 |
+
###Assistant:
|
| 281 |
+
UPDATE caching_servers SET caching_enabled = 0 WHERE cache_hit_rate < 0.5;"
|
| 282 |
+
DELETE FROM build_records WHERE build_date < '2023-03-01';,"Remove build records that are dated before March 1, 2023.","###Human:
|
| 283 |
+
Remove build records that are dated before March 1, 2023.
|
| 284 |
+
|
| 285 |
+
###Assistant:
|
| 286 |
+
DELETE FROM build_records WHERE build_date < '2023-03-01';"
|
| 287 |
+
"SELECT server_name, COUNT(*) AS warning_count FROM server_logs WHERE log_level = 'warning' GROUP BY server_name;",Count the number of warning logs on each server.,"###Human:
|
| 288 |
+
Count the number of warning logs on each server.
|
| 289 |
+
|
| 290 |
+
###Assistant:
|
| 291 |
+
SELECT server_name, COUNT(*) AS warning_count FROM server_logs WHERE log_level = 'warning' GROUP BY server_name;"
|
| 292 |
+
UPDATE scaling_groups SET min_instances = 5 WHERE current_instances > 5;,Increase the minimum instances to 5 for scaling groups with more than 5 current instances.,"###Human:
|
| 293 |
+
Increase the minimum instances to 5 for scaling groups with more than 5 current instances.
|
| 294 |
+
|
| 295 |
+
###Assistant:
|
| 296 |
+
UPDATE scaling_groups SET min_instances = 5 WHERE current_instances > 5;"
|