Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO ALL THESE QUESTION IN SQL SERVER/SQL SERVER MANAGEMENT STUDIO, ATTACH SCREENSHOT OF THE INPUT/OUTPUT(SSMS) NOTE:- DO NOT COPY EXISTING ANSWERS FROM CHEGG OR

PLEASE DO ALL THESE QUESTION IN SQL SERVER/SQL SERVER MANAGEMENT STUDIO, ATTACH SCREENSHOT OF THE INPUT/OUTPUT(SSMS) NOTE:- DO NOT COPY EXISTING ANSWERS FROM CHEGG OR ELSE I WILL DOWNVOTE, I WILL DEFINETLY UPVOTE CORRECT ANSWER, THANK YOU

Task 1.You are given a table, Projects, containing three columns: Task_ID, Start_Date and End_Date. It is guaranteed that the difference between the End_Date and the Start_Date is equal to 1 day for each row in the table.

If the End_Date of the tasks are consecutive, then they are part of the same project. Samantha is interested in finding the total number of different projects completed.

Write a query to output the start and end dates of projects listed by the number of days it took to complete the project in ascending order. If there is more than one project that have the same number of completion days, then order by the start date of the project.

Sample Input

image text in transcribed

Sample Output

2015-10-28 2015-10-29

2015-10-30 2015-10-31

2015-10-13 2015-10-15

2015-10-01 2015-10-04

Task 2. You are given three tables: Students, Friends and Packages. Students contains two columns: ID and Name. Friends contains two columns: ID and Friend_ID (ID of the ONLY best friend). Packages contains two columns: ID and Salary (offered salary in $ thousands per month).

Write a query to output the names of those students whose best friends got offered a higher salary than them. Names must be ordered by the salary amount offered to the best friends. It is guaranteed that no two students got same salary offer.

Sample Input

image text in transcribed

Sample Output

Samantha
Julia
Scarlet

Task 3. You are given a table, Functions, containing two columns: X and Y.

Two pairs (X1, Y1) and (X2, Y2) are said to be symmetric pairs if X1 = Y2 and X2 = Y1.

Write a query to output all such symmetric pairs in ascending order by the value of X.

Sample Input

image text in transcribed

Sample Output

20 20
20 21
22 23

Everything is specified please answer

Task_ID Start_Date End_Date 1 1 2015-10-01 2015-10-02 2 2015-10-02 2015-10-03 3 2015-10-03 2015-10-04 4 2015-10-13 2015-10-14 5 2015-10-14 2015-10-15 6 2015-10-28 2015-10-29 7 2015-10-30 2015-10-31 Column Type ID Integer Name String Students Column Type ID Integer Friend_ID Integer Friends Column Type ID Integer Salary Float Packages ID Friend_ID 1 2 2 3 3 4 4 1 Friends ID Name ID Salary 1 Ashley 1 1 15.20 2 Samantha 2 10.06 3 Julia 3 11.55 4 Scarlet 4 12.12 Students Packages

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago