Write a PL/SQL program to find area and perimeter of rectangle.
Consider a relation Employee with following attributes:
Name Null Type
-------------------------------- ----------------------- -------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(3)
AGE NUMBER(3)
ESAL NUMBER(10)
a. List minimum , maximum , average salaries of employee.
b. What is the difference between maximum and minimum salaries of employees in the organization?
c. Display all employee names and salary whose salary is greater than minimum salary of the company and job title starts with ‘M’.
d. Display total salary spent for each job category.
e. Display lowest paid employee details under each manager.
create table emp with attributes (eid number,ename varchar2(10),age number,salary number);
a. Count number of employee names from employee table.
b. Display the Sum of age employee table.
c. Find grouped salaries of employees (group by clause).
d. Find salaries of employee in Ascending Order (order by clause).
e. Find salaries of employee in Descending Order.
a. Get the description EMP table.
b. List all employees details.
c. List all employee names and their salaries, whose salary lies between 1500/- and 3500/- both inclusive.
d. List all employee names and their and their manager whose manager is 7902 or 7566 0r 7789.
e. List all employees who belongs to the department 10 or 20.
Get all the potential users. Fetch the user_ids who liked at least 2 videos published by "Disney" channel, and who did not subscribe to the channel (channel_id = 352).
potential_user_id no_of_likes
Best time to upload a comedy video:
DunkFest channel is planning to upload a video in the "COMEDY" genre
Give the channel the best suitable hour of the day when users positively engage more with comedy videos.
hour_of_engagement no_of_likes5...
Get all the distinct user_ids who liked at least one video uploaded by Android Authority Channel (channel__id = 364) but didn't like the video uploaded by Tech savvy channel with video_id = 1005.
user_id
Get the number of users who possitively engaged with at least one video of Disney Channel (channel_id = 352).
no_of_users_reached
Get the top 10 channels for which more number of users are subscribed in the year 2018.
In case, if the no_of_subscribers are same, then sort the output in the ascending order of channel_name.
channel_id channel_name no_of_subscribers