Dbms Exp3b
Dbms Exp3b
Assessment Marks :
Timeliness (2)
DDL/DML/TCL (2)
Applies Appropriate SQL /
PLSQL (3)
Knowledge (2)
Total (10)
Theory:
Data Manipulation Language
A Data Manipulation Language enables programmers and users of the database to retrieve insert, delete
and update data in a database. e.g. INSERT, UPDATE, DELETE, SELECT.
INSERT:
INSERT statement adds one or more records to any single table in a relational database.
INSERT INTO tablename VALUES (expr1,expr2……..);
UPDATE:
UPDATE statement that changes the data of one or more records in a table. Either all the rows can be
updated, or a subset may be chosen using a condition.
UPDATE table_name SET column_name = value [, column_name = value ...] [WHERE condition]
DELETE:
DELETE statement removes one or more records from a table. A subset may be defined for deletion
using a condition, otherwise all records are removed.
DELETE FROM tablename WHERE condition
Second Year Computer Engineering Database Management System
Implementation:
1. Create following tables:
Table name : client_master
Product_master
IMPLEMENTATION
Code-
Create table Product_master3(
Product_no varchar(6),
desciption varchar(15),
profit_percent numeric(4,2),
unit_measure varchar(10),
qty_on_hand varchar(8),
Recoder_level numeric (8),
sell_Price numeric(8,2),
Cost_price numeric(8,2)
);
output:-
Second Year Computer Engineering Database Management System
2.Code:-
INSERT INTO Client_master3 VALUES ('C001','SAM','KOTHRUD','PUNE',411077,'MAHARASHTRA',10000.23);
INSERT INTO Client_master3 VALUES ('C002','JOHN','KURLA','MUMBAI',400087,'MAHARASHTRA',50000.55);
INSERT INTO Client_Master3 VALUES ('C003','JACK','KISHAN NAGAR','GANDHI',400055,'GUJRAT',25000.93);
INSERT INTO Client_Master3 VALUES
('C004','ANN','CHARMINAR','HYDERABAD',400090,'ANDHRA PRADESH',77000.00);
INSERT INTO Client_Master3 VALUES ('C005','PITER','BANDRA','MUMBAI',400045,'MAHARASHTRA',88000.23);
INSERT INTO Client_Master3 VALUES ('C006','NICK','MUMBAI','MUMBAI',400077,'MAHARASHTRA',100000.23);
output:-
code:-
INSERT INTO Product_master3 VALUES ('P1','LAPTOP',30.12,'LOW',1200,13000,60000.23,50000.34);
INSERT INTO Product_master3 VALUES ('P2','REFRIGERATOR',30.92,'MEDIUM',4354,42255,4243.24,35000.55);
INSERT INTO Product_master3 VALUES ('P3','HARD DISK',10.00,'HIGH',5678,8723,10000.23,2500.00);
INSERT INTO Product_master3 VALUES ('P4','MIXTURE',40.12,'LOW',9000,44000,40000.99,8000.34);
INSERT INTO Product_master3 VALUES ('P5','WASHING MACHINE',35.12,'HIGH',9000,90000,40000.99,280000.90);
Output:-
3.Code:-
SELECT Client_name FROM Client_Master3
output:-
Second Year Computer Engineering Database Management System
5. Code:-
output:
6.Code-
select * from Product_master3
output:-
Second Year Computer Engineering Database Management System
7.Code:-
Select Client_name from client_master3 where city ='MUMBAI';
output:-
8.Code:-
update client_master3 set city='MUMBAI' where client_no='C001';
output:-
11.Code:-
Second Year Computer Engineering Database Management System
12.Code:-
Delete from Client_master3 Where state='ANDHRA PRADESH'
Output:-