Answer to Question #43082 in Programming & Computer Science for Rohit Arya

Question #43082
Perform the following DML operations on the table:
1. Insert values for the table CUSTOMERS with fields – ID, name, age, address and salary and insert records in the table given below:
+----+----------+-----+-----------+----------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+-----------+----------+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |
+----+----------+-----+-----------+----------+
2. Based on the customer table given above update the salary to 20000 whose salary is less than that.
Based on the customer table given above Fetch ID,
3. Name and Salary fields from the CUSTOMERS table for a customer with name Hardik.
1
Expert's answer
2014-06-06T11:53:58-0400
Solution:
INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY)
VALUES (1, 'Ramesh', 32, 'Ahmedabad', 2000),
(2, 'Khilan', 25, 'Delhi', 1500),
(3, 'kaushik', 23, 'Kota', 2000),
(4, 'Chaitali', 25, 'Mumbai', 6500),
(5, 'Hardik', 27, 'Bhopal', 8500),
(6, 'Komal', 22, 'MP', 4500),
(7, 'Muffy', 24, 'Indore', 10000);
2. Based on the customer table given above update the salary to 20000 whose salary is less than
that.
Solution:
UPDATE CUSTOMERS SET SALARY=20000 WHERE SALARY<20000;
Based on the customer table given above Fetch ID,
3. Name and Salary fields from the CUSTOMERS table for a customer with name Hardik.
Solution:
SELECT ID, NAME, SALARY FROM CUSTOMERS WHERE NAME='Hardik';

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS