Walmart Labs Interview Question for SDE-3s
- 0of 0 votes
You have a database table that stores information about the price change of various product with time. It's append only table. Whenever the price of the product p1 is changed to c1 at time t1, a new row will be appended.- neer.1304 April 11, 2019 in United States
product_id price time
p1 10 4
p2 40 4
p1 20 5
p1 25 6
p2 55 7
Write an SQL query that will give the price of every product at time t1.
e.g. at time 6
Note: Consider the case where two updates are made at the same time. Don't assume that the table is sorted by time.
| Report Duplicate | Flag | PURGE
Walmart Labs SDE-3 SQL
Open Chat in New Window