Interpreting SQL
题目描述
[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1698
[PDF](https://uva.onlinejudge.org/external/107/p10757.pdf)
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10757/22961f18d003e066930fd4ae78217192c5dc0216.png)
输入输出格式
输入格式
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10757/16c9af5e229465f2e5414020da8fcc378f1de6a3.png)
输出格式
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10757/6d5e80e111b774944c162e71c53b4639dbe27f00.png)
输入输出样例
输入样例 #1
1
2
AccountInfo 4 3
Account I
LastName S
FirstName S
Balance I
1 Ivanov Petr 2500
2 Petrov Ivan 2000
3 Ivanov Ivan 3000
AccountTransfers 3 4
From I
To I
Amount I
1 2 1000
2 3 2000
3 1 3000
2 1 10
SELECT LastName, FirstName, To, Amount
FROM AccountInfo
INNER JOIN AccountTransfers ON Account=From
WHERE FirstName"Petr"
ORDER BY LastName DESCENDING, Amount
输出样例 #1
4 3
LastName
FirstName
To
Amount
Petrov Ivan 1 10
Petrov Ivan 3 2000
Ivanov Ivan 1 3000