SQL Practical Code
SQL Practical Code
-> ('P03','Soap',25,'Lux'),
-> ('P05','Soap',38,'Dove'),
-> ('P06','Shampoo',245,'Dove');
E. SELECT NAME FROM STUDENT WHERE NAME LIKE '%A' ORDER BY NAME;
3.
4.
5.
6.
III. SELECT E.NAME,J.JOBTITLE FROM EMPLOYEE E,JOB J WHERE E.NAME LIKE '%SINGH%' AND
E.JOBID=J.JOBID;
IV. UPDATE EMPLOYEE SET JOBID=104 WHERE EMPLOYEEID='E4';
create table member(EmpId int primary key,Name varchar(30),Pay int,Divno int,foreign key(divno)
references division(divno) on delete cascade on update cascade);
-> (1002,'Surya','Jammu',13),
-> (1003,'Karish','Chennai',21),
-> (1004,'Sunish','Delhi',10),
-> (1005,'Ajay','Jammu',15);
-> (20,'Vijay','Delhi',150,1004),
-> (30,'April','Delhi',230,1004),
-> (40,'Misha','Chennai',120,1003),
-> (50,'Aarav','Chennai',210,1001);
iii. select s.name from salesman s,customer c where s.salesman_id=c.salesman_id and c.city!='Delhi' and
c.city!='Jammu';
iv. select s.name from salesman s,customer c where s.salesman_id=c.salesman_id and c.grade>=200;
v. select s.name from salesman s,customer c where s.salesman_id=c.salesman_id and c.grade=200 and
c.city='Jammu';