Sie sind auf Seite 1von 6

ASSIGNMENT SHEET NO: 1 ASSIGNMENT SHEET on RELATIONAL ALGEBRA AND SQL Instructions to the students: 1.

Answer the following 110 queries in SQL using the sample database tables given below. 2. For each query, you have to specify the question (as mentioned in the assignment sheet), the corresponding query representation in SQL and then followed by the answer returned by it. 3. Also you have to specify the DDL description instructions used in creating the database has to be submitted in a separate file. ( SQL scripts) 4. Answer the questions in relational algebra wherever possible. This query has to be included along with a comment ALGEBRAIC QUERY for Question No. ____ . just before SQL query for the question. If there is no equivalent query, just give a comment NO Equivalent Relational algebraic query exists for the question No. ____. 5. The evaluation mode for this question will be as follows: i) on Feb 16th and 17th, every student will be called for showing the execution of five queries randomly from this list. ii) Student has to explain how the evaluation takes place and should give explanation for the query asked /posed. TABLE NAME PNAME ANAND ALTAF JULIANA KAMALA MARY NELSON PATRICK QADIR RAMESH RESECCA REMITHA VIJAYA TABLE NAME : PNAME MARY : STUDIES COURSE PGDCA DCA MCA DCP PGDCA DAP DCAP HDCP PGDCA DCAP DCS DCA COURSEFEE 4500 7200 22000 5000 4500 6200 5200 14000 4500 11000 6000 48000

INSTITUTE SABHARI COIT BITS PRAGATHI SABHARI PRAGATHI PRAGATHI APPLE SABHARI BRILLIANT BDPS BDPS SOFTWARE TITLE

DEVELOP IN CPP

SCOST 100.00

DCOST 1200

SOLD 84

README

ANAND ANAND JULIANA KAMALA MARY MARY PATTRICK QADIR QADIR RAMESH RAMESH REMITHA REMITHA REVATHI VIJAYA

PARACHUTES VIDEOTITLING INVENTORY PAYROLLPRG FINANCIALACC CODEGENRRAT OP README BOMBSAWAY VACCINES HOTLIMGMT DEADLEE PCUTILITIES TSRHELPPKG HOSPITALMGM T TSREDITOR

BASIC PASCAL COBOL DBASE ORACLE C CPP ASSEMBL Y C DBASE PASCAL C ASSEMBL Y PASCAL C

399.95 7500.00 3000.00 9000.00 18000.00 4500.00 300.00 750.00 1900.00 12000.00 599.95 725.00 2500.00 1100.00 900.00

6000 16000 3500 20000 85000 20000 1200 5000 3400 35000 4500 5000 6000 75000 700

43 9 0 7 4 23 84 11 21 4 73 51 7 2 6

TABLE NAME : PNAME ANAND ALTAF JULIANA KAMALA MARY NELSON PATTRICK QADIR RAMESH REBECCA REMITHA REVATHI VIJAYA DOB

PROGRAMMER DOJ 21-APR-92 13-NOV-90 21-APR-90 02-JAN-92 01-FEB-91 11-MAR-89 21-APR-90 21-APR-90 26-FEB-91 01-DEC-90 20-APR-93 02-JAN-92 02-MAY-92 SE X M M F F F M M M M F F F F PROF1 PASCAL CLIPPER COBOL C CPP COBOL PASCAL ASSEMBLY PASCAL BASIC C PASCAL FOXPRO PROF2 BASIC COBOL DBASE DBASE ORACLE DBASE C DBASE COBOL ASSEMBLY BASIC C SALAR Y 3200 2800 3000 2900 4500 2500 2800 3000 3200 2500 3000 3200 4500

12-APR-66 02-JUL-64 31-JAN-60 30-OCT-68 24-JUN-70 11-SEP-85 10-NOV-65 31-AUG-65 03-MAY-67 01-JAN-67 19-APR-70 02-DEC-69 14-DEC-65

1.

Find out the selling cost av.. Packages developed in pascal.

2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33.

Display the names ages of all programmers Display the names of those who have done the dap course. Display the names and date of births of all programmers born in january. What is the highest number of copies sold by a package Display the lowest course fee How many programmers done the pgdca course How much revenue has been earned thru sales of packages developed in c. Display the details of the software developed by ramesh. How may programmers studied at sabhari Display details of packages whose sales crossed the 2000 mark Find out the number of copies which should be sold in order to Display the details of packages for which developments cost have been recovered. What is the cost of the costliest software developed in basic How many packages developed in dbase How many programmers studies in pragathi How many programmers paid 5000 to 10000 for their studies. What is avg course fee Display the detail the programmers knowing c How many programmers know either cobol or pascal How many programmers dont know pascal and c How old is the oldest male programmers Calculate the experience in years for each programmers and. Display along with the names in descending order. Who are the programmers who celebrate their birthdays during the current month. How many female programmers are there What are the languages by male programmers What is the avg salary How many people draw salary 2000 to 4000 Display the details of those who dont know clipper cobol or pascal Display the cost of package developed by each programmer Display the sales values of the packages developed by the each programmer Display the number of packages sold by each programmer. Display the sales cost of the packages developed by each programmer

34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61.

Display the sales cost cf the packages developed by each programmer language wise Display each language name with avg development cost avg selling cost and avg price per copy. Display each programmers name costliest and cheapes packages developed by him or her . Display each institute name with number of courses average cost per course. Display each institute name with number of students. Display names of male and female programmers name and sex also Display the name of programmers and their packages Display the number of packages in each languages except c and c++. Display the number of packages in each language for which development cost is less than 1000. Display the avg difference between scost and dcost for each package. Display the total scost, dcost and amount to be recovered for each programmer for those whose dcost has not yet been recovered. Display highest losest and average salaries for those earning more than 2000. Who is the highest paid in c programmers. Who is the highest paid female cobol programmer Display the names of the highest paid programmer for each language Who is the least experienced programmer Who is the most experienced male programmer knowing pascal Which language is known by only one programmer. Who is the above programmer referred in 51. Who is the youngest programmer knowing dbase Which female programmer earning more than 3000 does not know c. C++ oracle or dbase. Which institute has most number of students What is the costliest course Which course has been done by the most of the students Which course has been done by the most of the student Which institute conducts costiest course Display the name of the institute and course which has below avg course fee Display the names of the courses whose fees are within 1000 (+or) of the average fee.

62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88.

Which package has the highest development cost Which course has below avg number of students Which package has the lowest selling cost. Who developed the package that has sold the least number of copies Which language has used to develop the package which has the highest sales amount How many copies of package that has the least difference between development and selling cost were sold Which is the costliest package developed in pascal Which language was used to develop the most number of packages Which programmer has developed the highest number of packages Display the names of the package which have sold less than the avg number of copies Who are the authors of the packages which have recovered more than double the development cost Display the programmer names and the cheapest packages developed by them in each language Display the language used by each programmer to develop the highest selling and lowest selling package Who is the youngest male programmer born in 1965 Who is the oldest female programmer who joined in 1992. In which year were the most number of programmers born. In which month did most number of programmers join In which language are most of the programmers proficient Who are the male programmers earning below the avg salary of female programmers. Who are the female programmers earning more than the highest paid male programmer Which language has been stated as the prof by most of the programmers Display the details of those who are drawing the same salary. Display the details of the software developed by the male programmers earning more than 3000/Display the details of the packages developed in pascal by the female programmers Display the details of the programmers who joined before 1990 Display the details of the software developed in c by female programmers of pragathi Display the number of packages no. Of copies sold and sales value of each programmer institute wise.

89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99.

Display the details of the software developed in dbase by male programmers who belong to the institute in which most number of programmers studied Display the details of the software developed by the male programmers born before 1965 and female programmers born after 1975 Display the details of the software that has developed in the language which is neither the first nor the second proficiency of the programmer Display the details of the software developed by the male students of sabhari Display the names of the programmers who have not developed any packages What is the total cost of the software developed by the programmers of apple Display the names of the programmers who have not developed any packages Who are the programmers who have the same prof2. Display the total sales value of the software institute wise. In which institute does the person who developed the costliest package studied. Which language list d in prof1, prof2 has not been used to develop any package course did he / she undergo

100. How much does the person who developed the highest selling package earn and what 101. How many months will it take for each programmer to recover the cost of the course under went 102. Which is the costliest package by a person with under 3 years experience 103. What is the avg salary for those whose software sales is more than 50,000/104. How many packages were developed by students who studied in instt that charge the lowest courser fee 105. How many packages were developed by the person who developed the cheapest package, where did he / she studied. 106. How many packages were developed by the female programmers earning more than the highest paid male programmer 107. How many packages are developed by the most experienced programmers from bdps. 108. List the programmers from the software table and the institutes they studied including those who did not develop and package 109. List each prof with the number of programmers having that prof and the number of the packages in that prof. 110. List the programmer names from the programmer table and the no of packages each has developed.

Das könnte Ihnen auch gefallen