WGUl D427l Pre-l Assessmentl V2l (Newl
2026/l 2027l Update)l Datal Managementl –l
Applications|l Questionsl &l Answers|l
Gradel A|l 100%l Correctl (Verifiedl
Solutions)
QUESTION
Selectl talll horsesl withl subquery
l Thel Horsel tablel hasl thel followingl columns:
l IDl -l integer,l primaryl key
l RegisteredNamel -l variable-lengthl string
l Breedl -l variable-lengthl string
l Heightl -l decimall number
l BirthDatel -l date
Writel al SELECTl statementl tol selectl thel registeredl namel andl heightl forl onlyl horsesl
thatl havel anl abovel averagel height.l Orderl thel resultsl byl heightl (ascending).
Hint:l Usel al subqueryl tol findl thel averagel height.
Answer:
SELECTl RegisteredName,l Height
FROMl Horsel
WHEREl Heightl >
l (SELECTl AVG(Height)l
l FROMl Horse)
l ORDERl BYl HEIGHT;
QUESTION
Alterl Moviel table
Thel Moviel tablel hasl thel followingl columns:
l IDl -l positivel integer
l Titlel -l variable-lengthl string
l Genrel -l variable-lengthl string
l RatingCodel -l variable-lengthl string
l Yearl -l integer
Writel ALTERl statementsl tol makel thel followingl modificationsl tol thel Moviel table:
,Addl al Producerl columnl withl VARCHARl datal typel (maxl 50l chars).
Removel thel Genrel column.
Changel thel Yearl column'sl namel tol ReleaseYear,l andl changel thel datal typel tol
SMALLINT.
Note:l Yourl SQLl codel doesl notl displayl anyl resultsl inl Developl mode.l Usel Submitl model
tol testl yourl code.
Answer:
ALTERl TABLEl Movie
ADDl Producerl VARCHAR(50),
DROPl COLUMNl Genre,
CHANGEl COLUMNl Yearl ReleaseYearl SMALLINT;
QUESTION
Insertl rowsl intol Horsel table
Thel Horsel tablel hasl thel followingl columns:
IDl -l integer,l autol increment,l primaryl key
RegisteredNamel -l variable-lengthl string
Breedl -l variable-lengthl string,l mustl bel onel ofl thel following:l Egyptianl Arab,l Holsteiner,l
Quarterl Horse,l Paint,l Saddlebred
Heightl -l decimall number,l mustl bel betweenl 10.0l andl 20.0
BirthDatel -l date,l mustl bel onl orl afterl Janl 1,l 2015
Insertl thel followingl datal intol thel Horsel table:
RegisteredNamel Breedl Heightl BirthDate
Babel Quarterl Horsel 15.3l 2015-02-10
Independencel Holsteinerl 16.0l 2017-03-13
Elliel Saddlebredl 15.0l 2016-12-22
NULLl Egyptianl Arabl 14.9l 2019-10-12
Notes:
Yourl SQLl codel doesl notl displayl anyl resultsl inl Developl mode.l Usel Submitl model tol
testl yourl code.
Inl anotherl thatl createsl thel Horsel table,l Reg
Answer:
INSERTl INTOl HORSEl (
RegisteredName,l
Breed,l
Height,l
, Birthdate)
VALUESl (
'Babe',
'Quarterl Horse',
l 15.3,
'2015-02-10'),
(l 'Independence',
l 'Holsteiner',
l 16.0,
l '2016-12-22'),
l (l 'Ellie',
l 'Saddlebred',
l 15.0,
l '2016-10-12'),
l (l NULL,
l 'Egyptianl Arab',
l 14.9,
l '2019-10-12');
QUESTION
Updatel rowsl inl Horsel table
Thel Horsel tablel hasl thel followingl columns:
IDl -l integer,l autol increment,l primaryl key
RegisteredNamel -l variable-lengthl string
Breedl -l variable-lengthl string,l mustl bel onel ofl thel following:l Egyptianl Arab,l Holsteiner,l
Quarterl Horse,l Paint,l Saddlebred
Heightl -l decimall number,l mustl bel ≥l 10.0l andl ≤l 20.0
BirthDatel -l date,l mustl bel ≥l Janl 1,l 2015
Makel thel followingl updates:
l Changel thel heightl tol 15.6l forl horsel withl IDl 2.
l Changel thel registeredl namel tol Ladyl Luckl andl birthl datel tol Mayl 1,l 2015l forl horsel
withl IDl 4.
l Changel everyl horsel breedl tol NULLl forl horsesl bornl onl orl afterl Decemberl 22,l 2016.
Note:l Yourl SQLl codel doesl notl displayl anyl resultsl inl Developl mode.l Usel Submitl model
tol testl yourl code.
Answer:
2026/l 2027l Update)l Datal Managementl –l
Applications|l Questionsl &l Answers|l
Gradel A|l 100%l Correctl (Verifiedl
Solutions)
QUESTION
Selectl talll horsesl withl subquery
l Thel Horsel tablel hasl thel followingl columns:
l IDl -l integer,l primaryl key
l RegisteredNamel -l variable-lengthl string
l Breedl -l variable-lengthl string
l Heightl -l decimall number
l BirthDatel -l date
Writel al SELECTl statementl tol selectl thel registeredl namel andl heightl forl onlyl horsesl
thatl havel anl abovel averagel height.l Orderl thel resultsl byl heightl (ascending).
Hint:l Usel al subqueryl tol findl thel averagel height.
Answer:
SELECTl RegisteredName,l Height
FROMl Horsel
WHEREl Heightl >
l (SELECTl AVG(Height)l
l FROMl Horse)
l ORDERl BYl HEIGHT;
QUESTION
Alterl Moviel table
Thel Moviel tablel hasl thel followingl columns:
l IDl -l positivel integer
l Titlel -l variable-lengthl string
l Genrel -l variable-lengthl string
l RatingCodel -l variable-lengthl string
l Yearl -l integer
Writel ALTERl statementsl tol makel thel followingl modificationsl tol thel Moviel table:
,Addl al Producerl columnl withl VARCHARl datal typel (maxl 50l chars).
Removel thel Genrel column.
Changel thel Yearl column'sl namel tol ReleaseYear,l andl changel thel datal typel tol
SMALLINT.
Note:l Yourl SQLl codel doesl notl displayl anyl resultsl inl Developl mode.l Usel Submitl model
tol testl yourl code.
Answer:
ALTERl TABLEl Movie
ADDl Producerl VARCHAR(50),
DROPl COLUMNl Genre,
CHANGEl COLUMNl Yearl ReleaseYearl SMALLINT;
QUESTION
Insertl rowsl intol Horsel table
Thel Horsel tablel hasl thel followingl columns:
IDl -l integer,l autol increment,l primaryl key
RegisteredNamel -l variable-lengthl string
Breedl -l variable-lengthl string,l mustl bel onel ofl thel following:l Egyptianl Arab,l Holsteiner,l
Quarterl Horse,l Paint,l Saddlebred
Heightl -l decimall number,l mustl bel betweenl 10.0l andl 20.0
BirthDatel -l date,l mustl bel onl orl afterl Janl 1,l 2015
Insertl thel followingl datal intol thel Horsel table:
RegisteredNamel Breedl Heightl BirthDate
Babel Quarterl Horsel 15.3l 2015-02-10
Independencel Holsteinerl 16.0l 2017-03-13
Elliel Saddlebredl 15.0l 2016-12-22
NULLl Egyptianl Arabl 14.9l 2019-10-12
Notes:
Yourl SQLl codel doesl notl displayl anyl resultsl inl Developl mode.l Usel Submitl model tol
testl yourl code.
Inl anotherl thatl createsl thel Horsel table,l Reg
Answer:
INSERTl INTOl HORSEl (
RegisteredName,l
Breed,l
Height,l
, Birthdate)
VALUESl (
'Babe',
'Quarterl Horse',
l 15.3,
'2015-02-10'),
(l 'Independence',
l 'Holsteiner',
l 16.0,
l '2016-12-22'),
l (l 'Ellie',
l 'Saddlebred',
l 15.0,
l '2016-10-12'),
l (l NULL,
l 'Egyptianl Arab',
l 14.9,
l '2019-10-12');
QUESTION
Updatel rowsl inl Horsel table
Thel Horsel tablel hasl thel followingl columns:
IDl -l integer,l autol increment,l primaryl key
RegisteredNamel -l variable-lengthl string
Breedl -l variable-lengthl string,l mustl bel onel ofl thel following:l Egyptianl Arab,l Holsteiner,l
Quarterl Horse,l Paint,l Saddlebred
Heightl -l decimall number,l mustl bel ≥l 10.0l andl ≤l 20.0
BirthDatel -l date,l mustl bel ≥l Janl 1,l 2015
Makel thel followingl updates:
l Changel thel heightl tol 15.6l forl horsel withl IDl 2.
l Changel thel registeredl namel tol Ladyl Luckl andl birthl datel tol Mayl 1,l 2015l forl horsel
withl IDl 4.
l Changel everyl horsel breedl tol NULLl forl horsesl bornl onl orl afterl Decemberl 22,l 2016.
Note:l Yourl SQLl codel doesl notl displayl anyl resultsl inl Developl mode.l Usel Submitl model
tol testl yourl code.
Answer: