Cursors

Printing id, start, and end times from a table of data
AskAI

This question asks for a cursor that will print the id, start, and end times for each row in a table. The input table has three columns: id, start, and end. The example output should print the id and start and end times for each row in the table, as shown in the example output.

166
Jan 29
Update prices by 10% using a cursor
AskAI

This problem asks the reader to write a cursor to update the prices of all products in a table by 10%. The table is provided as input, and the expected output is also shown.

162
Nov 27
SQL Query to Find Products That Have Been in Stock for More Than 365 Days
AskAI

Write a SQL query to find the products that have been in stock for more than 365 days.

148
Nov 23
Printing employee information from a table
AskAI

This problem asks the user to write a cursor that will loop through a table of employee information and print the employee ID and name for each employee.

121
Nov 14
SQL Query to Find Employees Who Have Been with the Company for More Than 5 Years
AskAI

To find the employees who have been with the company for more than 5 years, we can write a SQL query that uses the StartDate column in the table to filter the results.

158
Nov 12
Calculating Average Salary per Department Using a Cursor
AskAI

This technical problem deals with calculating the average salary for each department using a cursor. Given a table of employees and their salaries, the cursor will iterate over the table and calculate the average salary for each department. The output will be a table with the department ID and the corresponding average salary.

165
Nov 11
Find customers living in the same city as 'John Smith'
AskAI

Given a table of customer data, write a SQL query to find the names of all customers who live in the same city as the customer with the name 'John Smith'.

166
Nov 11
Iterate over a table and print name and age for each row.
AskAI

This problem asks the reader to write a cursor that will iterate over a table and print the name and age of each row.

190
Nov 07