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.
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.
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.
Write a SQL query to find the top 10 customers by total spent.
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.
This query will find all pairs of values in a table where one value is double the other.
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.
Query a database for customers who live in a given state and have made a purchase within the past 30 days.