Arithmetic operators and string function
Arithmetic operators and string function
Step 6: To retrieve the product names that start with the letter "A" and display them in uppercase.
➢ SELECT UPPER(ProductName) AS ProductName FROM Product
WHERE ProductName LIKE 'A%';
Quality Criteria: your output should look like this
Step 6 to retrieve the customers firstname first latter asci code and display
➢ SELECT ASCII(FirstName) AS NumCodeOfFirstChar FROM Customers;
Quality Criteria: your output should look like this
Step 3: to insert order data in the orders table we can write the following statement
➢ INSERT INTO Orders1111 (ProductName) VALUES ('Shola Milk')
select *from orders
Quality Criteria: your output should look like this
Step 4: From the previous table, if we want to retrieve the date in year, month, date format, we can write the following query
Step 5: If we want to add 30 days to the "OrderDate", to find the payment date. We can write the following query
➢ SELECT OrderId,DATEADD(day,30,OrderDate) AS OrderPayDate FROM Orders1111
Lap Test
Instruction: Use ABC database (from unit one lap test) in order to perform the following tasks
Task 1: Retrieve the total number of products
Task 2: Calculate the total amount (ORD_AMOUNT + ADVANCE_AMOUNT) for each order
and display the result with the order number and the total amount.
Task 3: Calculate the average commission for all agents and display the result rounded to two
decimal places.