Select Into Address From Address: ''
Select Into Address From Address: ''
Select Into Address From Address: ''
Course/Section: COE182P
1. Using Adventure Work 2016 Database Generate/Create Scripts that will transfer all person
schema including data into new database name AdventurePerson.(Output is SQL command)
(hindi ko na po canopy yung lahat ng command po, bali bawat person schema po
ginayan ko po)
2. What is “Megan E. Burke address” in the adventure work 2016 database? Result set outputted
column should be Fullname and Address including city. (Includes SQL COMMAND SELECT
STATEMENT)
3. Which person have a surname “Allen”? Result output should be two column Firstname and
LastName. (Includes SQL COMMAND SELECT STATEMENT)
4. What is “Harold K. Chandra” email address? Result output should be two column name as
Fullname and Email Address. (Includes SQL COMMAND SELECT STATEMENT)
5. What is “Katherine A. Price” CELL PHONENUMBER? Result output should be two column name
as Fullname and phonenumber. (Includes SQL COMMAND SELECT STATEMENT)
6. Make a select statement showing all person with OWNER as contact type sort by lastname
descending.
SELECT FirstName,MiddleName, LastName, ContactTypeID
FROM AdventurePerson.Person, AdventurePerson.ContactType
WHERE ContactTypeID = 11
ORDER BY LastName DESC
7. Make a select statement showing all person originated from England as state province sort by
firstname.
SELECT FirstName,StateProvinceID,StateProvinceCode, Name
FROM AdventurePerson.Person, AdventurePerson.StateProvince
WHERE StateProvinceCode = 'ENG'
ORDER BY FirstName
8. Make a SQL select statement showing all person came from country region name AUSTRALIA.
SELECT *FROM Person.Person, Person.CountryRegion WHERE CountryRegionCode = 'AU'
10. CREATE a Restoration script of the database backup AdventurePerson.BAK and store it file into a
new folder name Exam3.
RESTORE DATABASE [ADVENTUREPERSON]
FROM DISK = 'C:\Users\Martin\Desktop\DotNET 2\Exam3\AdventurePerson.bak'
GO
11. Create stored procedure that will create/add new value to table
Demo.DemoSalesOrderHeaderSeed.
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
END
13. Create stored procedure that will remove/delete value to table
Demo.DemoSalesOrderHeaderSeed.
ALTER PROCEDURE [dbo].[ DeleteDemoSalesOrderHeaderSeed]
-- Add the parameters for the stored procedure here
@LID INT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;