9) Write a query to display the entire contents of the skill table, sorted by name in ascending order.
select * from skill order by name asc;
10) Write a query to display the entire contents of the department table, sorted by name in descending order.
select * from department order by name desc;
11) Write a query to display the entire contents of the post_type table, sorted by name in descending order.
select * from post_type order by name desc;
12) Write a query to display all role names, sorted in ascending order.
select name from ROLE order by name asc;
13) Write a query to display all the name and description present in the skill table. Display the records sorted in ascending order based on name.
select name,description from skill
order by name asc;
@MRProgrammer89
14) Write a query to insert any 2 records into the skill table.
insert into skill values (1,'pune','jayesh');
insert into skill values (2,'Dhule','Jp');
15) Write a query to change the skill name 'CAD' to 'CADCAM'.
update skill set name= 'CADCAM' where name = 'CAD';
16) Write a query to delete the skill 'Web Design'.
delete from skill where name = 'Web Design';
17) Write a query to display the names of all administrators (role Admin) sorted in ascending order based on name.
select name from users
where role_id in (select id from role where name='Admin')
order by name;
@MRProgrammer89
18) Write a query to display the names of all alumni (role Alumni) sorted by name in descending order.
select name from users where role_id
in (select id from role where name='Alumni')
order by name desc;
19) Write a query to display the names of all degrees offered by 'CSE' department, sorted in ascending order.
select name from degree where department_id
in(select id from department where name='CSE')
order by name ;
20) Write a query to display the name of the department offering the degree 'BSC_CT'.
select name from department where id
in (select department_id from degree where name='BSC_CT');
21) Write a query to display the department of user Ram in the college.
select name from department where id
in (select department_id from degree where id in
(select degree_id from profile where id in
(select profile_id from users where name='Ram')));
@MRProgrammer89
22) Write a query to display the university name(s) in which Ram has done his higher studies. Display the records sorted in ascending order university_name.
Select university_name from higher_degree where profile_id
in (select id from profile where id in
(select profile_id from users where name='Ram' ));
@MRProgrammer89