You are on page 1of 1

SQL Basic Test #1

Let’s say you have two SQL tables: Customers and Orders.

The Customers dataset has 100k+ rows. Here’s a small sample, the first six rows:

Customer_number Customer_name
1 Nguyen Van A
2 Company B
3 LE Van C
4 Company D
5 Company E
6 Tran Thi P

The Orders dataset has 20M+ rows. Here’s a small sample, the first 8 rows:

Order_number Customer_number Order_quantity


1 1 100
2 2 1,000
3 4 5,000
4 2 2,500
5 4 6,000
6 3 800
7 5 10,000
8 6 921
*Quantities were counted with the same unit of measure

Create an SQL query that shows the TOP 3 Customers who bought the most goods in total!

Programming Basic Test 1


Write a method ChuyenSoThanhChu(int) that receives a number (n < 1,000) and outputs the
Vietnamese reading of that number in string type.

For example:

1. ChuyenSoThanhChu(101) will return “một trăm linh một”


2. ChuyenSoThanhChu(231) will return “hai trăm ba mươi mốt”
3. ChuyenSoThanhChu(19) will return “mười chín”
4. ChuyenSoThanhChu(10) will return “mười”
5. ChuyenSoThanhChu(0) will return “không”

*Please use any programming language that you prefer. You can use procedures or functions if your
preferred language does not support OOP.

You might also like