5.3 Data Manipulation Language (DML)

5.3.1 INSERT

INSERT INTO CUSTOMER (BVN, FirstName, LastName, PhoneNumber, LGA, State, AccountType, DateOpened, Balance)

VALUES ('12345678901', 'Abdulrahman', 'Musa', '08012345678', 'Chanchaga', 'Niger State', 'Savings', '2024-01-15', 50000.00);

 

5.3.2 UPDATE

-- Give all Savings account customers in Minna a 5% balance top-up

UPDATE CUSTOMER

SET Balance = Balance * 1.05

WHERE AccountType = 'Savings' AND LGA = 'Chanchaga';

 

5.3.3 DELETE

-- Delete inactive customers who have zero balance

DELETE FROM CUSTOMER

WHERE Balance = 0.00 AND IsActive = FALSE;