Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Find all of the customers that did not have any sales orders. select c.custid , c.companyname , c.contactname , o.orderid from Sales.Customers as c

1. Find all of the customers that did not have any sales orders.

select c.custid

, c.companyname

, c.contactname

, o.orderid

from Sales.Customers as c

Sales.Orders as o on o.custid = c.custid

where

2.

Complete the function named DoubleTheValueOfTheInput that passes a single integer parameter and calculate the parameter times itself. (ie 5 x 5 =25)

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE FUNCTION dbo.DoubleTheValueOfTheInput

(

--Add the parameters for the function here

@IntegerNumber int

)

RETURNS int

AS

BEGIN

--Declare the return variable here

DECLARE @Result int

SELECT @Result = -- Add the T-SQL statements to compute the return value here

--Return the result of the function

RETURN @Result

END

GO

3.

Generate the Numbers from Zero to 99 in descending order through a Cartesian product using the dbo.Digits table with itself.

Select NumbersFromZeroTo99 =

From dbo.Digits

4.

Define your understanding of first through third normal form. It may be an informal definition.

In the table [dbo].[Employees] below exam the gender:

Is it a required column [Y/N]?

If it has a default value, what is it?

Does it have a check constraint, if so what are the valid values?

What is the datatype?

What is the count of non-required columns?

What is the primary key constraint name?

5. Using the dbo.Nums table derive the calendar year (2015-15-1 through 12) months.

(hint: use the Dataadd function). Make sure the result set has only 12 rows.

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 Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions