Content text Untitled document - 2024-09-13T183203.258.pdf
3. List few compound operators. Here is a list of compound operators: 1. `+=` 2. `-=` 3. `*=` 4. `/=` 5. `%=` Exercise 1. Consider the following schema Orders(cust_id, order_id, items, amount) Write queries for the following: i. Display new column named total_amount which is 200 added to the amount field. Practicalkida.com
ii. Display new column named offer_price which is 100 subtracted from the amount field. iii. Display new column named revised_amount which is multiplied by 5 times the amount field. iv. Display new column named half_amount which is divided by 2 to the amount field. Answer: i. Display a new column named total_amount which is 200 added to the amount field: SELECT cust_id, order_id, items, amount, amount + 200 AS total_amount FROM Orders; ii. Display a new column named offer_price which is 100 subtracted from the amount field: SELECT cust_id, order_id, items, amount, amount - 100 AS offer_price FROM Orders; iii. Display a new column named revised_amount which is multiplied by 5 times the amount field: SELECT cust_id, order_id, items, amount, amount * 5 AS revised_amount FROM Orders; iv. Display a new column named half_amount which is divided by 2 to the amount field: SELECT cust_id, order_id, items, amount, amount / 2 AS half_amount FROM Orders; Practicalkida.com