Week2 - Data Manipulation Language / Design

The questions can come in any order, so make sure you are selecting right option for all questions.

1. Write a query to insert any 3 records into the 'building' table.
insert into building values (1, 'Mohit', 'UP', 1, 0000000000, 'null');
insert into building values (2, 'Abhi', 'Bihar', 2, 0000000000, 'null');
insert into building values (3, 'Ashish', 'Delhi', 2, 0000000000, 'null');
2. Write a query to delete the details of the building whose owner got an email_address 'vivosupport@vivocity.com.sg'.
delete from building where email_address = 'vivosupport@vivocity.com.sg';
3. Write a query to change the owner_name 'Nicholas' to 'Alexander' present in the building table.
update building  set owner_name = 'Alexander' where owner_name='Niccholas';
4. Write a query to change the name 'Pharmacy' to 'Hospital' in the building_type table.
update building_type set name='Hospital' where name='Pharmacy';
5. Write a query to delete the records with meter_number 'SG288942' in meter table.
delete from meter where meter_number = 'SG288942';
6. Write a query to delete the records with owner_name 'Ron Sim' in building table.
delete from building where owner_name = 'Ron Sim';

Post a Comment