Try me¶
In these exercises you are going to work with the car_retail.sql database in the folder test_databases. Copy the contents of the file in your test environment and execute it. Then, build queries as instructed in the exercises below:
Build a select query that returns for each car record, the model and the greatest value between 10000 and the cost of a car
-- Insert you answer here
Build a select query that for each car record, it uses the function concat to return a message stating which employee sold each car. For instance, “the car Ford F-150 was sold by John Johnson”
-- Insert you answer here
Build a select query that returns, for each car record, the bonus for the employee, which is calculated as the lowest value between the maximum bonus, 2000 and 10% of the total cost of the car.
-- Insert you answer here
Build a select query that returns, for each employee record, the corporate email, as the concatenation of the left most character of the first name (FName column), the last name (LName column) and the corporate email suffix (‘@dinoco-dealers.com’).
-- Insert you answer here
Build a select query that returns, for each employee record, the total number of days passed between the current date and the HireDate.
-- Insert you answer here