Write a query that consists of one block only

Assignment Help Database Management System
Reference no: EM132078962

You need help with a few SQL database codes to return some resutls! The queries that You need to write are described below this and the tables you have are described below the questions.

Now this is the difficult part for me, what would I need to input as the queries to get the results below?

Find the ssn and last name of every employee whose ssn contains two consecutive 8's, and has a supervisor. Sort the results by ssn.

For every employee who works for more than 20 hours on any project that is controlled by the research department: Find the ssn, project number, and number of hours. Sort the results by ssn.

Write a query that consists of one block only.

For every employee who works less than 10 hours on any project that is controlled by the department he works for: Find the employee's lname, his department number, project number, the number of the department controlling it, and the number of hours he works on that project. Sort the results by lname.

For every employee who works on any project that is located in Houston: Find the employees ssn and lname, and the names of his/her dependent(s) and their relationship(s) to the employee. Notice that there will be one row per qualyfing dependent. Sort the results by employee lname.

Write a query that consists of one block only.

For every employee who works for a department that is different from his supervisor's department: Find his ssn, lname, department number; and his supervisor's ssn, lname, and department number. Sort the results by ssn.

Find pairs of employee lname's such that the two employees in the pair work on the same project for the same number of hours. List every pair once only. Sort the result by the lname in the left column in the result.

For every employee who has more than one dependent: Find the ssn, lname, and number of dependents. Sort the result by lname

For every project that has more than 2 employees working on and the total hours worked on it is less than 40: Find the project number, project name, number of employees working on it, and the total number of hours worked by all employees on that project. Sort the results by project number.

For every employee whose salary is above the average salary in his department: Find the dno, ssn, lname, and salary. Sort the results by department number.

For every employee who works for the research department but does not work on any one project for more than 20 hours: Find the ssn and lname. Sort the results by lname

For every employee who works on every project that is controlled by department 4: Find the ssn and lname. Sort the results by lname

Tables

employee, department, dept_locations, project, works_on, dependent

Keys in order of tables

fname, lname, ssn, bdate, address, sex, super_ssn, dno

dnumber, dname, mgrssn, mgrstartdate

dnumber, dlocation

pname, pnumber, plocation, dnum

essn, pno, hours

essn, dependent_name, sex, bdate, relationship

Reference no: EM132078962

Questions Cloud

Determine the temperature of the gas in celsius : Using the ideal gas law, determine the Temperature of the gas in Celsius the volume is 20,440.0 liters and a pressure of 1 atmosphere
Create a graphical interface : Create a graphical interface, and using the Graphics class for drawing the board, the markers, and line through the winning set of markers.
Ksp for the dissociation : What is the solubility of CuBr in a 0.05 M HBr (strong) acid solution? The Ksp for the dissociation of CuBr(s) is 4.2 × 10-8.
Calculate the mole fraction of bromine in water : Calculate the mole fraction of bromine in water in both solutions.
Write a query that consists of one block only : Find the ssn and last name of every employee whose ssn contains two consecutive 8's, and has a supervisor. Sort the results by ssn.
What is the probability of a collision between packets : What is the probability of a collision between packets of the two piconets? Assume nodes are not using CSMA.
What will the final temperature be in kelvin : If the volume of a balloon at 24oC changes from 4L to 7,547mL, what will the final temperature be in kelvin?
Write a program that accepts a number of minutes : You need help with a question for Java. You have to write a program that accepts a number of minutes and converts it to both hours and days.
Develop and implement an interactive two-player yahtzee game : Develop and implement an interactive two-player Yahtzee game. Yahtzee is a dice game that was invented by Milton Bradley and Edwin S. Lowe in 1956.

Reviews

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