Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

ANSWER KEY

S.NO. ANSWER

(1.) Update Personal set Salary=Salary*0.5 where Allowance is not null;

(2.) Select Name ,Salary +Allowance as “Total Salary “ from Personal;

(3.) Delete from Personal where salary>25000;

(4.) Select name from teacher department=”Mathematics” and gender=”F”;

(5.) Select name from teacher order by date _ of _ join;

(6.) Select name, salary*0.1 as bonus from teacher;

(7.) Select * from STUDEN order by Name;

(8.) Update STUDENT set Mark=Mark+20 where class=”XII”;

(9.) Select * from employees order by Salary desc limit 5;

(10.) Use the foreign key constraints

(11.)

(12.) Use any one of the primary, foreign ,default ,check and unique constraints

(13.) Use any one of the command are CREATE,DROP,ALTER

(14.) Select * from <table _ name> ;

(15.) Select * from <table _ name> where name like ‘_ _ _ _%’;

(16.) Select * from customer where name like ‘a%’;


(17.) Alter table <table _name> change <old _column _name> <new _column _name>
<data _type>;

(18.) Show the error of the primary key.

(19.) Update employees set salary=salary*1.1 where department=(select id from


departments where name = ‘sales’);

(20.) ->Update cs set cont_no=753889623 where name=’Siva’;


-> Update cs set ID=10323 where name=’guru’;
-> Update cs set Age=28 where name=’guru’;

(21.) Insert into cs values(Ram,10423,8367956,24);

(22.) Select max(Age) “oldest person” from cs;

(23.) Create view <view_table_name> as select <field_name> from <table_name>;


Select sum(<field_name>) from <table_name>;

(24.) Select name from sports where grade1=”c” or grade2=”c”;

(25.) Select name frim sports where game1=game2;

(26.) Select * from sports order by name ASC;

(27.) Update CUSTOMER set PRICE=PRICE+1000 where NAME like ‘s%’;

(28.) 11(average value of Rohit Sharma [20] , Deepak Kumar[10] , Mohan


Kumar[5] ,Sonal Aggarwal[5],Arun Singh[15])

(29.) Alter table COMPANY modify CID integer primary key;


Alter table CUSTOMER add foreign key (CID) references COMPANY(CID);

30.) Select distinct (CID) from CUSTOMER;


Select distinct (CITY) from COMPANY;

You might also like