I am trying to clear all test orders from Magento 2.2.x using this SQL query in my PHPMyAdmin but I'm getting an error.  

Here's the query I am running:

```
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `sales_order`;
TRUNCATE `sendfriend_log`;
TRUNCATE `wishlist`;
TRUNCATE `report_event`;

ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;

```

The error I am getting is:

> 
> SQL query: 
> 
> 
> TRUNCATE `sales\_order`  
> 
>  MySQL said: Documentation
> 
> 
> #1701 - Cannot truncate a table referenced in a foreign key constraint (`store`.`downloadable\_link\_purchased`, CONSTRAINT `DOWNLOADABLE\_LINK\_PURCHASED\_ORDER\_ID\_SALES\_ORDER\_ENTITY\_ID` FOREIGN KEY (`order\_id`) REFERENCES `store`.`sales\_order` (`entity\_id`))
> 
> 
>