Professional Documents
Culture Documents
T ra ining Te st
Version 1.1
Hanoi, 05/2019
Training Test SQL Essential Issue/Revision: 1/1
RECORD OF CHANGES
Contents
For the following exam:.............................................................................................................. 4
SQL Essential - Final Test ......................................................................................................... 4
CODE: SQLE.Practice.T01
FPT SOFTWARE
Test topic : SQL Essential
ACADEMY
Test duration : 180 minutes
• Pack screenshots and SQL scripts or your answers into the zip file named
SQLE_FinalTest_AccountName.zip (for instance: SQLE_FinalTest_NamNT.zip) then handle
to the evaluator via email (XYZ@fsoft.com.vn ) or follow the guidance of the class admin.
Problem Description:
You work as a Database Developer for Guitar Shop. The shop is going to design their own database.
ERD for the future database as below.
As shown, the Project database contains five tables: Categories, Products, Orders, Customers and
OrderItems.
• DiscountPercent: decimal type, cannot be null, value in range from 0.00 to 75.00
Questions to answer:
- Create the tables with the most appropriate column constraints & types.
- Add at least 4 records for Categories, and add at least 10 records for Products, Orders,
Customers and OrderItems.
b. Write a query to select ProductCode, ProductName, Description and DateAdded from Products
table. The query returns product(s) added at least 12 months ago and sort older products on top
c. Write a query to update data in Customers table. Change the password to “Secret’@1234!” for the
customer with an email address of “rick@raven.com” and IsPasswordChanged is false.
d. Write a query to return [Full Name] from Customers table. Data of [Full Name] column is combined
from the LastName and FirstName column with format: the last name, a comma, a space, and the
first name. Example: “Stark, Tony”.
Return customer(s) whose has last name begins with letters from M to Z only.
e. Write a query that returns the columns ProductName, UnitPrice, DateAdded from the Products
table. Return the row(s) with a unit price that’s greater than 500 and less than 2000 only. Sort the
result set in descending sequence by the DateAdded column.
f. Write a query that returns customer information (includes CustomerId, FirstName, LastName,
Email, and Address) and total amount of all orders belong to that customer.
To calculate amount:
-- THE END --