Recent posts

SQL query to find the number of distinct values in each column of a table
AskAI SQL Problems

This technical problem deals with writing a SQL query to find the number of distinct values in each column of a table. The input is a table with two columns, and the output is the number of distinct values in each column.

153
Jan 29
SQL query for finding pairs of rows with same value for column C
AskAI SQL Problems

Write a SQL query to find all pairs of rows (a, b) such that a is in table A, b is in table B, and a and b have the same value for column C.

156
Jan 28
Top 3 Most Populous Countries
AskAI SQL Problems

The technical problem is how to write a SQL query that returns the top 3 most populous countries. The example output is China, India, United States.

158
Jan 28
SQL Query to Find Top 10 Customers by Total Spent
AskAI SQL Problems

Write a SQL query to find the top 10 customers by total spent.

157
Jan 28
Replicating a Database Across Multiple Servers
AskAI SQL Problems

To replicate a database across multiple servers, you would need to set up a master server with the database, and then set up replication on the other servers. This would allow the other servers to have copies of the database, which would be updated whenever the master server's database is updated.

106
Jan 27
Finding all pairs of values where one value is double the other in a SQL table
AskAI SQL Problems

This query will find all pairs of values in a table where one value is double the other.

151
Jan 27
Update customer credit score on address update
AskAI SQL Problems

Update customer credit score on address update: - Given a table of customer data with name, address, credit score, and date of last address update columns, - write a trigger that will automatically update the customer's credit score whenever their address is updated. - Output will be the customer table with updated credit scores.

149
Jan 27
Query a Database for Customers Who Live in a Given State and Have Made a...
AskAI SQL Problems

Query a database for customers who live in a given state and have made a purchase within the past 30 days.

171
Nov 28