Explain the sql query

Assignment Help Database Management System
Reference no: EM132633645

Question 1:

The following SQL query is meant to output a list of fields (fieldnum) with the total number of academics for each field. It has syntax errors and logic errors. Give the correct query.

select fieldnum, count (acnum) from field, interest
where field.fieldnum=interest.fieldnum
group by acnum;

Question 2:

Explain the following query in English. Literal explanations will receive zero marks.

SELECT panum, title FROM paper
where (panum>=500 and panum<=599)
or (upper(title) like 'DATABASE %'
or upper(title) like '% 'DATABASE %' or upper(title) like '% 'DATABASE');

Question 3:

How many departments are there in the institute where instname=' Monash University'? Write a query to return the total number.

Question 4:

Return the famname and givename of academics having interests in ‘Data Structures' (descrip) with acnum in the range [100...399]. The output should be in alphabetical order of famname and then givename.

Question 5:

For each academic, give the acnum, givename, famname and the total number of fields s/he has worked in.
Note that if an academic has not worked in any fields, his/her total should be zero.

Question 6:

Are there academics whose interested field descriptions are missed? Print their fieldnum and acnum. The list should be in alphabetical order of acnum and then fieldnum.

Question 7:

List the deptnum of departments whose postcodes are in the range 3000...3999 and that do not have any academics with the title of Professor (stored as "Prof" or "Prof." in the database) , including departments that do not have any academics. You must use (NOT) EXISTS.

Question 8:

Output in alphabetical order the acnum, famname, givename of academics whose family name starts with "C" and whose interested field number is larger than 3.

Question 9:

Find departments where at least one academic has more than 10 research interests, and list the deptnum, depntname, instname of these departments. Must use a subquery.

Question 10:

Find the research fields whose number of interested academics is larger than the average. Return the fieldnum, title and the number of academics who are interested in these fields.

Question 11:

Find departments where there are academics that have at least two research interests without any description. List their instname and deptname in alphabetical order.

Question 12:

The productivity of an academic is measured by the total number of paper s/he has written. Find the papers that have the most productive author/s or the least productive author/s. Output the acnum, title, and the givename, famname of the most productive author/s or the least productive author/s together with the number of their papers.

Attachment:- Quiz Assignment SQL.rar

Reference no: EM132633645

Questions Cloud

Compute the amount of its retained earnings : The company sold additional common stock amounting to $5,000. As a result, compute the amount of its retained earnings at the end of the year
Is the flow of costs through the manufacturing accounts : The flow of costs through the manufacturing accounts is essentially the same in both process costing and job-order costing. TRUE/FALSE
What effect would accepting this order : What effect would accepting this order have on the company's net operating income if a special price of $349.95 is offered per Batarang for this order
How can chi adopt an effective budget process : How can Stephanie manage her work relationship with the board of directors and executive director and evaluate her progress during her first three months
Explain the sql query : Find departments where there are academics that have at least two research interests without any description. List their instname and deptname in alphabetical
Calculate physical units in ending work in process inventory : Pie Ltd produces high-quality pies that passes through two production processes. Calculate the physical units in ending work in process inventory
Which criteria is necessary for revenue recognition : What are examples of expense that would not be considered an expenditure and one expenditure that would not be considered expense.
Where in the general fund financial statements would report : Where in the General Fund financial statements would you report Salaries paid to government employees? Purchase of a capital asset?
Record Pippen pre-consolidation journal entries on January : Printer's and underwriting fees in relation to the common stock issued of $5,000, Record Pippen's pre-consolidation journal entries on January 1, 2019

Reviews

len2633645

9/16/2020 4:15:58 AM

I need only the syntax written down. I will enter them on SQL myself. Thanks.

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd