SQL - Hands-On Exercises (Session 2)


1.    insert into role(id,name)
values(1,'designer'),
(2,'guide');

2.    insert into skill(id,description,name)
values(1,'self learning','learn'),
(2,'technical skills','coding');

3.    insert into post_type(id,name)
values(1,'business'),
(2,'business');

4.    insert into department(id,name)
values(1,'bpo'),
(2,'IT');

5.    insert into degree(id,department_id,name)
values(1,04,'EEE'),
(2,05,'ECE');

6.    insert into profile(id,address,batch,degree_id,designation,gender)
values(1,'London','En',044,'HR','Male'),
(2,'Chennai','For',045,'Manager','Female');

7.    insert into higher_degree(id,degree_name,university_name,profile_id)
values(1,'BE','Anna University',017),
(2,'BE','Anna University',016);

8.    insert into experience(id,company_name,current,end,start,profile_id)
values(1,'CTS',1,'2008-11-11 13:23:44','2015-11-11 13:23:44',017),
(2,'CTS',1,'2008-11-11 13:23:44','2015-11-11 13:23:44',016);

9.    insert into project(id,name,number_of_members,profile_id,short_description)
values(1,'Alumini management',10,017,'for school and college'),
(2,'Library management',11,016,'for school and college');

10.  insert into user(id,emailid,name,password,phonenumber,profile_id,role_id,username)
values(1,'abcd@efgh.com','abcd','efgh',9884642005,017,46,'abcdefgh'),
(2,'ijkl@mnop.com','ijkl','mnop',9845621745,016,47,'ijklmnop');

11.  insert into query(id,content,date,parent_id,user_id)
values(1,'Alumini management','2008-11-11 13:23:44',78,45),
(2,'Library management','2008-11-11 13:23:44',79,46);

12.  insert into event(id,date,description,invitation,name,organiser_id)
values(1,'2008-11-11 13:23:44','Alumni meet','OBA','Manikandan',123),
(2,'2008-11-11 13:23:44','Library opening','member','Narayanan',456);

13.  insert into post(id,content,date,type_id,user_id)
values(1,'Alumni meet','2008-11-11 13:23:44',789,123),
(2,'Library opening','2008-11-11 13:23:44',987,456);


14.  update role set name='Administrator' where name='Admin';

15.  delete from role where name='Student';

16.  Update skill set name="CADCAM" WHERE name="CAD";

17.  delete from skill where name='Web Design';

18.  update post_type set name='Technology' where name='Tech';

19.  delete from post_type where name='Technology';

20.  update profile set batch='1998' where batch='98';

21.  UPDATE query SET date=DATE_FORMAT(date,'2013-%m-%d');

22.  update query set date=date_add(date,interval 1 day) where date(date)='2013-01-31';

23.  delete from query where date between date_format(date,'0000-%m-%d') and 
date_format(date,'2011-%m-%d');

24.  delete from experience where end is not null;


25.  update event set date=date_add(date,interval 3 hour) where name='ALUMNI MEET';
SHARE
    Blogger Comment
    Facebook Comment

1 comments :

  1. Any writer that takes the time to research a subject as thoroughly as you have deserves to be commended. This article is appealing and very well-written. The first two sentences encouraged me to read more. For more information visit here: curtain track fitter dovetails!

    ReplyDelete

loading...