CS 面试题总结(4)# JobHunting - 待字闺中
w*t
1 楼
8 -
Part A: We are writing a feature for customers to check how many times an up
load fee was
assessed last month. Another developer wrote the following SQL query:
SELECT c.*, t.*, FROM customer c LEFT JOIN transactions t on
t.customer_id = c.customer_id where c.name='$customer_name' ORDER BY
c.name ASC, t.date DESC;
You know nothing about the database except that it is MySQL, but your goal i
s to optimize
this query as much as you can. How would you start?
Part B: The developer uses PHP to conn
Part A: We are writing a feature for customers to check how many times an up
load fee was
assessed last month. Another developer wrote the following SQL query:
SELECT c.*, t.*, FROM customer c LEFT JOIN transactions t on
t.customer_id = c.customer_id where c.name='$customer_name' ORDER BY
c.name ASC, t.date DESC;
You know nothing about the database except that it is MySQL, but your goal i
s to optimize
this query as much as you can. How would you start?
Part B: The developer uses PHP to conn