分析以下成功执行的语句:CREATE TABLE rental (
Rental id int unsigned NOT NULL AUTO INCREMENT,
Rental date datetime NOT NULL,
Inventory id int unsigned NOT NULL,
Customer id int unsigned NOT NULL,
Return date datetime DEFAULT NULL,
Staff id int unsigned NOT NULL,
Iast update timestamp NOT NULL DEFAULT CURRENT TIMESTAMP ON UPDATE
CURRENT TIMESTAMP,
PRIMARY KEY (rental id)
ENGINE-InnoDB;
现在检查以下查询:
SELECT rental_id,customer_id
FROM rental
Where rental date between now()- interval 1 month and now()
AND inventory_id=42
AND staff_id-1024;
您希望添加一个或多个索引,最大程度的减少查询工作量;
以下哪条语句可以完成此任务?