This action might not be possible to undo. Are you sure you want to continue?
Data Retrieval Part I 1.
See table structure of Designation_Master, Department_Master, Student_Master, Student_Marks, Staff_Master, Book_Master and Book_Transaction table. Query Student_Code, Student_Name and Department_Code of every Student. Retrieve detail of every Student and Staff. Display Student_Code, Subjects and Total_Marks for every student. Total_Marks will calculate as Subject1 + Subject2 + Subject3 from Student_Marks. . Display Student_Code, Student_Year, Subjects and Percentage of all student and heading for the columns would be Student#, Join_Year, Subject1, Subject2, Subject3, Total, and Percentage from Student_Marks. Create a query to display unique Department_Code from Student_Master table. . Create a query which will display all students’ data those who are passing (getting pass Subject1 + Subject2 + Subject3 > 180. And save the query . Create a query which displays Student_Code, Join_Year and Subject 1 of all students who scored more than 75 in Subject1. And save the query Modify the query to display student detail of those who getting marks in Subject1 between 50 and 75. And save the query . Write a query which will display Student_Name, Departmnet_Code and DOB of all students who born between January 1, 1981 and March 31, 1983. Order the query in ascending order of DOB.
6. 7. 8.
10. . Write a query which will display Student_Name, Department_Code of all students’ studies in departments 10 and 30, in alphabetical order by name. 11. Select Student_Name and Department_Code of all students those who have born in 1982. 12. . Display Book_Details for all books which have not being returned. 13. . Display Book_Details for all books which have not being returned and expected returned was last Monday. 14. . Select all students who have completed 25 years of age and their name starts with ‘S’; 15. . Display Student_Code & Year, of all students who is getting more than 60 in each subject and aggregate of marks is greater then 190 for year 2006 or 2007.
Student_Name first letter capitalized and all other letters lower case and length of the Student_Name for all students whose name starts with ‘S’ or ‘J’. 99. 27. 29. 23. 30. and Percentage as whole number for current year and percentage should be greater that 75. Salary of each staff. Order the result by the day of the week staring with Monday. List all Table Name contains ‘MASTER’ in their names. . Write a query that displays Staff_Name. 17. 19. . . Subject3. Hiredate and review date of all staff. Sample Output. 20.999. 21. Hiredate and day of the week on which staff was hired. 12 1981” for those who born on Saturday or Sunday. Label the column as DREAM SALARY. Round the number of months to closest whole number.00. Subject2. KING FORD 12000 10000 XXXXXXXXXX XXXXXXXXXXXX 24. . 22.16. . Subject1. Grade depends on the following table. and Grade of all staff. Order your result by number of months employed. Display each Staff_Name and number of months he worked for the organization. Salary. Display Student_Name and Date of birth where DOB must be displayed in the format similar to “January. Format the dream salary as Rs. If student does not belong to any department. 25. Write a query that produces the following for each staff : 28. Display Student_Code. Display the Staff_Name Staff_Salary and the Salary in X. Label the column as “Department”. Create a Query which display the Student_Name and Department_Code and Total_Marks and order it on Total_Marks descending and Student_Name ascending. Salary Salary >=50000 Grade A . <Staff_Name> earns <Salary> monthly but wants <2 times salary. put “No Department”. Review date is first Monday after six months of Service. 31. . Format the salary to be 15 character long and left padded with ‘$’. Create a Query which displays the Student_Name and Department_Code. Label the column as DAY. 18. List the Book details issued to Students for current month and last month. Create a query which will display Staff_Name. Label the column as ‘MONTHS WORKED’. Label the column as “Diff_Marks”. Each X represents a 1000 in Salary. Modify the query to add a column that will find the difference between Total_Marks and Maximum_Marks. Label the Column REVIEW 26. Display the Staff_Name. Write a query which displays Student_Name in upper case. Display Staff_Name. Total_Marks.
Total and Average respectively. Manager. 41. Sudent_Name. 35. Create a query which will give the following output ignore the lines. Create a query which will display Manager_Name. Staff_Name. Manager Hiredate of all staff hired before their manager. Label the heading as PAY DATE. Department_Name. Write a query which displays Staff_Name. Display Staff_Code. and Department_Name for all staff who do not works in Department code 10 and have ‘A’ in their name. Lowest. and his manager’s number and name. Label the columns Staff#. Edit the above query and display the same for each Department Name. Staff_Name. Write a query to display number of people in each Department. Total & Average salary of all staff. Write a query to display Staff_Name. 33. Department_Name. Save the query as E2Q20. Staff_Name Department_Name. Label the column as ‘Total Number of Managers’. Determine the number of managers without listing them. 2002”. Display the Manager_Name and the total strength of his/her team. 44. 36. Department_Name and Department_Code Salary for all staff who earns more than 20000. and Subject3 for all students who are getting more than 60 in each subject from department 10 and 20. Display the date in the format “Twenty Eighth of January. 37. Pay date is the last Friday of the month. Round the result to nearest whole number. 38. Subjec1. Create a query that will display Student_Code. Manager_Name and salary of lowest paid staff in that manager’s team. and Number of People. Salary. 42. Order you result on descending order of salary. Output should display Department_Code. Dept_Code 10 20 30 1980 1 1981 2 2 6 1982 1 1 1983 1 Total 3 5 6 Part II 40. Mgr#. 34. Exclude any group where minimum salary is less than 10000. 39. Staff Hiredate. Display Manager_Code. Department_Code.Salary >= 25000 < 50000 Salary>=10000 < 25000 OTHERS B C D 32. Subject2. 43. Display the Highest. Label the columns Maximum. . Write a query to find the pay date for the month. Minimum.
and Designation for those who have joined most recently. Book Code. 59. Department_Name. Student_Name. Give the column as appropriate label. Designation. Fine = 5 * (No. Sudent_Name. 60. Department_Name. Book_Name for all students whose expected book return date is today. Create a query that will display Staff_Code. Staff_Name. Staff_Name. Book_Name for those authors who wrote more than one book. Department Name for those who have taken more than one book. 47. List the Student_Code. 49. Designation. and Salary for those staff who are getting less then average salary in their own department 56. Generate a report which contains the following information. and Department_Name for that department in which there are maximum number of student are studying. Student_Name. Display Author_Name. of days = Current Date – Expected return date). Display the Student_Code. Generate a report which contains the following information. 57. Staff Code. 52. 51. 58. 5 per day. Department_Name. Fine will be calculated as Rs. Create a query that will display Student_Code. Author. Department_Name. and Salary for those who are getting less than the average salary of organization. Student_Name for that student who got highest marks in all three subjects in Computer Science department for current year. of Staff 10 20 30 Total 30 40 25 95 . Subject1. 50. Book Name. Department. Subject2. Book_Name. List the total staff and the number of staff hired in each Department Department No No. Book_Code. and all the staff that work in the same department as a given staff. Issue_Date. Staff_Name who are not Manager. 46. Staff_Name. Details are: Student_Code. Book_Code. Create a query that will display the Staff_Name. 55. Generate a report which contains the following information Student Code Student Name Department Name Total Marks HOD Name Sort the output on Department Name and Total Marks. List Staff_Code. Staff Name. Department_Name. 54. Total. Subject3. List the Staff_Code. Department_Name. For only those staff who have taken any book in last 30 days. 48.45. Staff_Name. Display top ten students for a specified department. Staff Code Staff Name Designation Department Name Department Head For all staff excluding HOD (List should not contain the details of Department head). Display Staff_Code. 53. Fine For the staff who have not return the book. Display the Staff_Name. Display Staff_Code.
Staff_Name. Display the Manager_Name. Calculate the fine for books returned after due date as Rs. .Use Department Master & Designation Master. Total No: of students yet to return the book 70. Faculty Code Faculty Name Name Designation Department 66. who has borrowed maximum number of books. Accept a specific book code from user and find the details of the students/staff who have borrowed that book and has not returned the same. Accept the student code and display only faculty details of that department. Display Details for only (HOD/Professor/Reader/Lecturer).61. Designation of all staff. before expected date and after expected date. List the department Name which has borrowed maximum number of time (Any book). and Department_Name. Output should be in following format. For current year in which month maximum numbers of books are borrowed by which department? 69. 5 per day. Display”NO STAFF” where there is no staff in the department. 72.List the faculties of the department in which the student obtaining the maximum total marks for current year 68. . Manager Name Staff_Name Allen Allen Ravi Raj Ajay Amit Raju Arvind 30000 Salary 10000 20000 15000 62. Send a report to every department in the following format: Dept Name. 67. List the student detail. List the details of the book which has not been borrowed so far. Book Code 100001 100002 100001 Total Book Name Author Status Java Complete Reference Schield Expected date C++ Complete Reference Schield Before date Oracle Complete Reference Scott After date Fine 0 0 15 15 64. The following details should be displayed Student/Staff Code Return Date Student/Staff Name Issue Date Expected 65. Also display the department name where there is no staff. Output should be in following format. 63. Write a query which will display Staff_Name. Generate the report that displays details for all books. List the books that are returned on expected date. Salary (The highest and the lowest paid staff in his team). 71.
Book CodeBook Name Author Number of Times Issues 73. Generate a report which contains the following information. Staff Name Designation Department . Book CodeBook Name Staff Code Name Number of Times Issued For current year only.
Display the contents of the STAFF_VU. Change the Miller’s department from 10 to 20. Q13. Hiredate: 08-APR1985. Q4. Sal: 25000. Select view name and text from USER_VIEWS. Name: HARRIS. Q11. Assign SMITH to department 30. Mgr_Code: 7566. Create a view Staff_VU from Staff_Master. Q9. salaries and departments of all staff in department 10. OTHER OBJECTS Q1. Q2. Q4. Display the structure of the DEPT20 view. From the above view list the average annual salary for all the people in department 10 who makes less than 5000. Dept_Code – Should refer to the DEPT_Code in Dept_Master Q10. Q5. Give all the staff in department 30 a salary hike of 10%. Q12. Department_Name. . Designation_Master & Dept_Master to make it possible to see where some one works. Label the columns staff. Confirm the same from data dictionary that the index is created. Create a view consisting of names. Do not allow a staff to be reassigned to another department through this view. Q3. What happened? Create a view called SALARY_VU based on the Staff_Name. Insert the values. Q7. staff name and department number for all staff in department 20. Display the structure of the view Staff_VU. designation. Q2. Delete all staff from department 20. Add a new staff with Staff_Code: 8888. Salary and salary grade for all staff. Dept_Code: 20. Create a table Dept_Master with the following columns DeptNo – Primary Key DeptName -. Create a table called TEST with one column as Primary key. Q8. Q7. Create a table Staff_Master_Dup which contains the following columns: Staff_Code -. Create an index on salary column of Staff_Master table. Department. Staff_Name and Dept_Code.DML & DDL Statements Q1. Q5. Q10. Q6. Q3. Create a view name DEPT20 that contains the staff code. code. Label the view column Staff_Code. HireDate –Default should be current date Q9.Primary key should generate numbers automatically Staff_Name – Should not be null Designation –Should always be one of them HOD / Reader/ Professor/ Lecturer. Salary and Grade respectively. Q14. Salary – Should be always >7000 Q8.It should not be null Q6. Create a view FINANCE with data from the Staff_Master which gives their total salary and average salary.
Q2. For Grade: Student should pass in each subject individually (pass marks 60). Q3. Q4. Handle exception if Staff_Code is not present or if it returns for more than one staff information. Write a procedure that accept staff code and update staff name to Upper case. Function. triggers Q1. Special Allowance will be decided based on the service in the company. Display the error message if wrong department code has entered. Write a procedure to find the manager of a staff. DA = 15% Salary. Write a function to compute the following. Bonus is twice of salary. Confirm that an index is created implicitly. Screen should display the following data – Staff_Code. table.Write a function to compute area of circle. Q2. Percent >= 80 then grade= A Percent >= 70 and < 80 then grade= B Percent >= 60 and < 70 then grade= C Else D Q1. Q5. Display the error message if the wrong department code has entered. [Formula: PI * Radius**2]. Function should take Staff_Code and return the cost to company. < 1 Year Nil >=1 Year< 2 Year 10% of Salary . TA= 8% of Salary. Procedures .Write a sql script to calculate bonus of staff for a given Staff_Code.Write a sql script to retrieve all staff under specific department number and display the result. Write a function to compute age.Q15. Q4.) Q3. Staff_Name. Create an index on Department_Code and Designation_Code of Staff_Master Q18. Q17. HRA= 20% of Salary. Create an index on salary of Staff_Master table. Write a sql script that generated the following report for a given Department code Subject1 Subject2 Subject3 Total Percentage Student_Code Sudent_Name Grade Note: Display suitable error massage if wrong department code has entered and if there is no student in the given department. Q16. (Note: The Department_Code will be accepted from user. Dept_Code and Manager Name. If the staff name is null raise a user defined exception. Drop the table TEST and check that the corresponding index is also dropped.Write a sql script block to increase the salary by 30 % or 5000 whichever minimum for a given Department_Code. The function should accept a date and return age in years.
Generate a report Using which displays the following information. and Experience in years and additional allowance in Staff_Allowance table.Status will be (Greater. Write a procedure that displays the following information of all staff Staff_Name Department Name Designation Salary Note: . Display the details of the students/staff that have borrowed that book and has not returned the same. Q7. Generate a report which displays the following information. The output will be rounded to the nearest year (1. Procedure: Capture the value returned by the above function to calculate the additional allowance for the staff based on the experience. Generate a report which displays the following information. Department Name: Computer Science Book Code Book Name Issue Date Student_Code Student Name 10001 C++ 11-Jan-07 10012 Raju 10005 Java 15-Jan-07 10011 Ravi . Student Code Student Name Department Name Name For only top three students from each department and for current year.>=2 Year< 4 Year >4 Year 20% of Salary 30% of Salary Status Q6. Q10. Issue Date 11-Jan-07 15-Jan-07 18-Jan-07 (Stu/Staff) 1001 10011 1005 Code (Stu/Staff) Allan Ravi Arvind Name HOD Student Book Code Book Name Designation 10001 C++ 10005 Java 10009 Oracle Lecturer Q12. Total Marks HOD Q11. Date of Joining. Display an error message Staff_Master table is empty of if there is no matching record.Write the following Function: This function will return years of experience for a staff. Create a procedure that accepts the book code as parameter from the user.5 year will be considered as 2 year). Write a procedure that accept Staff_Code and update the salary and store the old salary details in Staff_Master_Back (Staff_Master_Back has the same structure without any constraint) table. The following details should be displayed Student/Staff Code Ret_Date Student/Staff Name Issue Date Designation Expected Q9. Additional Allowance = Year of experience x 3000 Calculate the additional allowance and store Staff_Code.4 year will be considered as 1 year and 1. This function will take the hiredate of the staff as an input parameter. Lesser or Equal) respective to average salary of their own department. Exp < 2 then no Update Exp > 2 and < 5 then 20% of salary Exp > 5 then 25% of salary Q8.
Department Name: Robotics Book Code Book Name Issue Date 10009 Oracle 18-Jan-07 Student_Code 10015 Student Name Arvind .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.