Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started