Internal DBMS2

  • Upload
    suci-ap

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

  • 7/31/2019 Internal DBMS2

    1/6

    1)a. Display Deptno & Name of Department for all Departments.b. Extract 3 characters from 5th Position of the string MUFFAKHAM JAHc. Add the following constraints to employee table

    empno- primary keyename- should not be null

    comm- should be set to default value of odeptno- is a foreign key referencing deptno of department table.

    mgr- is a foreign key referencing empno of emp table.d. Demonstrate all TCL commands.e. Display your Age in i. Days. ii.Months. iii.Year.

    f. Write a PL/SQL block to generate the Fibonacci series.

    2)

    a) Display Names of Employees working in Department 10,(or) 20,(or) 40(or)Employees working as Clerk,Analyst.

    b) Display various jobs & total no of employees in each job group

    c) Insert values for all the attributes for emp table and values for empnomust be inserted using the emp_seq.

    d) Display employee names along with their manager names.

    e) create a view on emp and dept table with the fields ename,dname,job foremployees of department 30.

    f) f. Write a PL/SQL block to generate the Fibonacci series.

    3)a. Find all jobs of Employees & remove duplicates.

    b. Find names of all employees whose salary is greater than atleast oneemployee working in department 10.

    c. Increase salary by 5% of those employees whose sal>2500 and increase by 6%of all others.

    d. Write a query in such a way that scott can grant select privileges onstudent table to some other usere. Display the date 6 months

    i. Before the current date.

    ii.After current date.f. Write PL/SQL block for Increasing salary of an employee by 5% for a given

    employee no.

  • 7/31/2019 Internal DBMS2

    2/6

    4)a. Update salary of those employees with an increase of 5% of those

    whose salary is greater than average salary of organization.b. Display names of employees along with their annual salary,employee earninghighest salary should come First.c. add the constraint on Loc column of dept table that restricts the Loc column to

    have only unique values.d. Create a view of emp table with the fields ename,sal, comm for the employees

    of department 20.e. Display jobs found in dept no 10 &20 by eliminating duplicates

    f. Write a PL/SQL block for addition of 3 numbers.

    5)

    a. Display Names of Employees working in Department 10,(or) 20,(or) 40 (or)Employees working as Clerk,Analyst.

    b. Get the department ID,the Average ,maximum & minimum, pay of alldepartments.c. Add a constraint which checks that the salary of the employees does not fallbelow zero.

    d. create a view on emp and dept table with the fields ename,dname,job foremployees of department 30.

    e. create a table Department with the following constraints :Deptno-primary key

    Dname- should not be null.

    Loc should be unique.f. Write a PL/SQL block to generate the Fibonacci series.

    6)a. Update dept table and assign the location New York to the department

    Marketing.b.

    c. Display names of employees whose salary is more than 3000 after giving 20%raise.d. Find the deptno for all departments having more than 1 employee. e. Display the date 6 months

    i. Before the current date.ii.After current date.

    f. Write a PL/SQL block to check whether a number is Armstrong or not.

  • 7/31/2019 Internal DBMS2

    3/6

  • 7/31/2019 Internal DBMS2

    4/6

  • 7/31/2019 Internal DBMS2

    5/6

    a. Display names of employees whose Names start with alphabet J & ends withS.b. Display employees who joined the company before 20th of this month.

    c. Add a new column to the dept table called Budget of size 7.d. Modify the size of the Budget field to size 9 and a default value of 10.000.e. Display employee details along with their department details using full outer

    join,Left outer join and Right outer join.

    f. Write a PL/SQL block to check that number is even or odd.

    14)

    a. Display employees who were recruited before 1-1-90 or who are working inDepartment 10 (or) 20.b. Find total pay for all employees in the organizationc. Get the empno, name, deptno and department names of all employees.

    d. Delete the records of all employees whose salary is below the average sal at the

    organization.e. Display various jobs along with total salary for each job group where total salaryis greater than 50,000.

    f. Write PL/SQL block for Factorial of a number.

    15)a. Display common jobs between Department 10 & 20.

    b. Display employees who joined the company in the month of January.c. Disable the check constraint on cust_name column from cust_dtls table.

    d. Display all records from student table belonging to other user(scott).e. Display Deptno. & total Salary from each Department

    f. write a PL/SQL block to check whether a number is Armstrong or not

    16)a. Display names of employees whose name contains the alphabeta.

    b. Extract 3 characters from 5th Position of the string MUFFAKHAM JAH

    c. Find names of all employees whose pay is Greater than the average pay.d. Rename the department table as dept_details.e. Give No. of Departments after eliminating duplicates.

    f. write a PL/SQL block to check whether a number is Armstrong or not.

    17)a. Display Employee name ,Deptno & Dept Names of all employees

    b. Display the Length of all employee names.

  • 7/31/2019 Internal DBMS2

    6/6

    c. show all the constraints on the dept and emp table (default tables)d. Display various jobs along with total salary for each job group where total salary

    is greater than 50,000.e. Revoke select privilege on student table from user scott.f. write a PL/SQL block to generate a Fibonacci series.

    18)a. Display Names of Employees with employees No. of those who earnCommission.b. Display those employees who are not working under any Manager.

    c. Change the max value of the emp_seq to 99 and interval to 2.d. Display those departments where there are atleast 2 employees

    e. Delete the department with location chicago.f. Write PL/SQL block for Increasing salary of an employee by 5% for a given

    employee no.

    19)a. Display Those names whose name has minimum 4 characters in it.b. Display names of employees in Upper case.c. Display various jobs along with total salary for each job group where total salary

    is greater than 50,000.d. Display those employee who are working in sales Department

    e. Display Those employees who r not working in deptno.20

    f. Write PL/SQL block for Increasing salary of an employee by 5% for a givenemployee no.

    20)a. Display jobs which are unique to dept no.10.b. Find the day of nearest Friday after current day.

    c. delete all the tuples of department table use delete,truncated. Display dept no. if more than 3 employees work in each dept.

    e. Display employees who were recruited before 1-1-90 or who are working inDepartment 10 (or) 20.

    f. Write a PL/SQL block to check that number is even or odd.