Đề cương ôn thi Kỹ thuật phần mềm

Đề cương ôn thi Kỹ thuật phần mềm

Trường:

Đại học FPT Hà Nội 37 tài liệu

Thông tin:
39 trang 11 tháng trước

Bình luận

Vui lòng đăng nhập hoặc đăng ký để gửi bình luận.

Đề cương ôn thi Kỹ thuật phần mềm

Đề cương ôn thi Kỹ thuật phần mềm

94 47 lượt tải Tải xuống

 !
!" "#
!!#!$!#!
%&"
"%&"'
%(
%('
%&"
) )*most correct%
%&""&+,(
"%
%&""
&,+(
%&"-.
!
"%
)/never used as a data
model0
%1
"%
%2!3"
%43"
%5
%2!3"
6 67relaon name 
8"#%
%
"%"
%"
%
%
9 9)6notaon "
##" 

%
"%"
%!
%!#
%
)7#dening data
structures
%&&:
"%&+:
%&*:
%
%&&:
7 76/#to remove a
relaon named R0
%&5;<4,:=5>
"%5=+;?=4,:=5>
%&=:=4=4,:=5>
%45@*4=4,:=5>
%&5;<4,:=5>
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
)A/row in a
relaonal"0
%8"#
"%4#!
%B
%5
"%4#!
A A7A2.5 , * &%/
trivial0
%3C,
"%3C3C,
%3C,*&
%3C3C,*&
%3C3C,*&
 7A7):5,*&"#
!
D3C,
*3C,
,3C&E
/key for R
%,
"%*
%&
%,&
"%*
 7A(#!!58"# 
)  6%
4F5D )E%( super-keys do
5.0
%6
"%
%)
%
%6
) )7AA*#
!
 "3C   3C G
 3C" ! H3C
  3C 3C
3CGH3C#
 3C
/best describes
R(e,f,g,h,i,j0
%5BB
"%5(B
%5BB
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
%54B
%5,*B
 7A745,*&B&I
D3C,>,3C>3C&>&3C,E
%5B
"%5B
%5)B
%
6 67A72.5 , * &B&I
,3C&
,*3C
&3C,
*&3C,
&3C*
*"#5I
%4B&55,*B
"%4B&55,*B
%4B&55,*B
9 97AAA/J")B
B0
%)B!#! B
.#!
"%)B.#! 
B!#!
 7AA/"de-normalizaon"?
%&3K#"
"%&3K#!#
!!"
%&3K".
#
%&3K".
)6#
7 76/benet of "de-normalizaonL0
%L3KL"$
"%4"$3K!.
!!$."
##"G
!
%4"$3K
#"K
##"
 ))4key for a weak enty set=%%%%%%%%%
%M8"#=
"%48"##!!!=
%48"##!!
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
%M8"#=F8"#
#!!
A AAA class in UML is similar%%%%%%%%%%%
%=N5
"%8"#=N5
%5!=N5
%
) )!.K
"#H#KK
."# "## #H#
H#
%=5!&
"%5(&
%
%
) ))associaon class in UML is similar
=5
%8"#!
"%8"#
%=
%
%8"#!
)) ))A'@+: di&erence between an
aggregaon and a composion0
%'! "G 
"G%' 
#%
"%' "G 
"G%'! 
#%
%
%4J"
!
%'! 
"G 
"G%'
 
#
) ))))/NOT a standard
aggregaon operator0
%25;@<
"%(@+
%*;@4
%?2
%25;@<
)6 )6)* 
I
45#(45#4(
"%B
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
4"."0
%4#
"%B
)9 )9)*correct statementI
%#!#
.##.#
"%#!#
.##.#
%#!#
.##
%#!#
.##
%#!
#.#
#.#
) )97(#!!(, * &#!I
,*&
6

99
AA
B
7A
*!##H#I
(=:=*4(@+&
B5;+(
/1=5=&O&&C9
*!!!##%
%
"%7
%
%A
%
)7 )79(#!!(, * &#!I
,*&
6

99
AA

7A
*!##H#I
(=:=*4& (@+*
%A 
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
B5;+(
25;@<,P&
*!!!##
%A )
"%A 6
%A 
%A 
) )9AColumn A
.#six rows"I
@:: @::   ) 
'(:(. .#
AVG(DISTINCT A)0
%9
"%@::
%)
%
%)
)A )A94"- #
#!#!I ) 
 ) )   6  6 6  6  6  6 )%*!#
#H#I
(=:=*4%- )% *;@4Q
B5;+ )
/1=5=%)%-
25;@<,P%- )%>
/#!#0
%  )
"%  6
%) 6 
% ) 
%  )
 971can understand"#
I
"All aggregate funcons are determinisc"?
%4##same value
any me"using a specic set!#
.#
"%4##di&erent
values each"#!$
!#.#
%4##same value
any me"using any set!#.#
%
%4#
#.#
"#!$
!#.#
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
 9)/!!!@'; 
'4=5(=*4 =R*=<45( 
5(#"$0
%5(#.
8"#!8"#
#"5(
"%,!#3# 
 J#! #
5(#"8"#
"
%
%
) )9)How many JOIN condions
"ve tables"8"#0
%
"%)
%
%6
%6
 9)(#!!5 ,#!I
,
-

9K
7
(, * &#!I
,*&
-6
K
K99
K7A
*!##G5( 
I5%,(%,%4)#!5
not appear!##%
% -
"% 
%9 K
%7 
"% 
%7 
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
6 69AB.#-  K #
@:: ,-!
-O6;5;4C)&K
.the truth value FALSE0'.#
"
%-9  K
"%-  K%
%-@:: ) K%
%-@::  K%
%-9  K
9 9967/!tests column
"0
%'(,:S!
"%'(M=5;!
%'(@::!
%'(@::!
%'(@::!
 96)/NULL mean0
%4.#@::@S;/
"%4.#@::TT!
%4.#@::TT!
%4.#@::M=5;
%4.#@::
@S;/
7 799/.#H#I
(=:=*4TTU@::UT(T
.#+V(:(.0
%T(T
"%TT
%T(T
%@::
%@::
 997/(:F#sort the
result-set0
%;5&=5,P
"%(;54,P
%;5&=5
%(;54
%;5&=5,P
A A994!!F&,+(I
2#IKF
"2#I!F
+I!F
&#I&,+(
F"
%#
"%"#
%"#
%"#
%#
6 69" "$ # %L&#"LI
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
"*'&  #"%/
does "Durable" mean0
%L&#"LI4!.L33
L!! F3#
!"#!
.J.
"%L&#"LI4#.
#-#
%L&#"LI4have
commi6ed#..!
%
4.8
#..!
6 69A(#!!5 ,%
*(:H#.
5-!I
W$I9A%G!X
%(=:=*4Q
B5;+5
"%(=:=*4U,(*
B5;+5
/1=5=U,C
%(=:=*4U,(*
B5;+5
%4
"%(=:=*4U,(*
B5;+5
/1=5=U,C
6) 6)979/J"the WHERE
and HAVING SQL#0
%4/1=5=1?'2#
"%41?'2(:#!!
#"/1=5=#!!
!%4/1=5=##(=:=*4
(:!$
#!
%4WHERE SQL #!!
#"1?'2#!!
!%41?'2##(=:=*4(:
!$
#!
%
%4/1=5=(:#
!!
#"
1?'2#!!
!%41?'2#
#(=:=*4(:
!$

#!
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
6 69AA*%
%P#."!!"!!
"%
"%4-.I&5;<45'22=5
OC
%@:4=545'22=5$
%%
%%
66 6699(#!!5()%5
!(%
!"5(
"ON DELETE CASCADE".
4I
%/5(
 ".#!

"%/5#
( "

"%/5
#(
 
"
69 699A)4DEFAULT
L*L#"<=5(;
 #(:I
%:4=54,:=<
:4=5*;:@+*(=4&=B@:4T(&=(T
"%:4=54,:=<
=&'4*;:@+*(=4&=B@:4T(&=(T
%:4=54,:=<
@<&4=*;:@+*(=4&=B@:4T(&=(T
%:4=54,:=<
+;&'BP*;:@+*(=4&=B@:4T(&=(T
%:4=54,:=<
:4=5*;:@+*(=4&=B@:4
T(&=(T
6 69)Three basic types"
I
=
"&
5
<F
%"#
"%"#
%#
%"#
%"#
67 67A.#!!
one relaon mustappearprimary-key
!
%@H#F
"%<F
%BF
%BF
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
%*F
6 6/di&erence"<5'+5PS=P
@'@=S=P0
%".@'@=S=P
"#<5'+5PS=P
"%".<5'+5PS=P
"#@'@=S=P
%@'@=S=P<5'+5PS=P
%
%".
@'@=S=P"#
<5'+5PS=P
6A 6A7N##F
Ynd tuples.$-.#
8"#
%'-
"%4
%3!#
%?
%'-
9 9)(most correct
%-###!
#! ..#8"#
"%4F-"8"#
8"# "F
%/F-"F
!F
#!
%%
%%
9 9"!!to nd
data fastwithout reading"
%'-
"%?
%4
%(3!#
%'-
9) 9)/drawbacks of indexes0
'-H#F!
"'-F@<&4= '(=54 &=:=4=

'-."F
'-F(=:=*4
%"#
"%#
%"#
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
%"#
%"#
9 9)6/3#F'N;
!##
!.H#!
%4
"%'-
%?
%(<#
"%'-
96 96A7/
0
%@(!##FY
"%@(!#!.#
%@(!#!.!
%
%
99 99A4benets of stored proceduresI
4!.#"Z:'+'4
#
"4.!
4"#
4!"
.H#F
%#
"%"#
%#
%"#
%#
9 9A(
+.("#!!
(4!%I(4!#3$!
$I
*5=4=4P<=(4!(
*15
*15
>
%*5=4=4,:=+.((4!>
"%*5=4=4,:=+.((4!<5'+5P
S=P>
%*5=4=4,:=+.(;B(4!>
%
%*5=4=4,:=+.(;B
(4!>
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
97 97A7""embedded
within another table
%
"%<.
%<
%*
%
9 9AA9"
 each nodeis either a leaf or interior
%3##
"%
%F
%"G3
%3##
9A 9AAA(3R+:%
%O0-.L%L0C
O+.&C
O+.L(/LCOPCAA7ONPCON+.C
ON+.&C
"%O0-.L%L0C
O+.&C
O+.L(/LCOPCAA7ONPCON+.C
ON+.C
%O0-.L%L0C
O+.&C
O+.L(/LCOPCAA7ON+.CONPC
ON+.&C
% %%
%O0-.L%L0C
O+.&C
O+.
L(/LCOPCAA7ONP
CON+.C
ON+.&C
 A)!$are "less
than"
%&
"%*
%*
%(!#
%*
 7A7!#creang and
managing#e:ciently and allowing
!.! 
%&,+(
"%&"
%=-
%
%&,+(
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
) /hierarchical data model0
%
K3F##
"%
K"3F##
%
K!3F##
%
%

Ktree-like
structure
 67A9'Data Model 
"K"
%5
"%F
%B3$
%;"G3
%43"
%5
6 9/!not called a
primive relaonal algebra!0
%,#!"-!
##!J!
"%,#!"-!
#!!G
!
%,#!"-!
#!#!!G!
%,#!"-!
#!!#!
%,#
!"-!
#the union operator
J!
9 6'(: N#
add an a6ribute%%%%%%%
%'
"%@!
%
%
%
 7)4update a relaon's schema 
"#0
%:4=54,:=
"%(=:=*4
%'(=54
%@<&4=
%:4=54,:=
7 )Schema-altering commandsF
%
%&&$:#
"%&+!#:#
%&*:#
%
%&&$:#
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
 /NOT a DML
command0
%&=:=4=
"%:4=54,:=
%'(=54
%@<&4=
"%:4=54,:=
A )7A)/funconal dependency0
%#!3C,#
8"##H#,
"%#!3C,#
8"#,#H#
%#!3C,
#8"#
#H#,
7 67A7/key a6ribute0
%F8"#8"#"
F
"%F8"#8"#"
#!F
%F8"#8"#
"F

7 97A6/Boyce-
Codd Normal Form (BCNF)0
%5,*&B&TI,&3C*>,3C&>*3C,>,&3C
"%5,*&B&TI,*3C>&3C*>*&3C,>,&3C*
%5,*&B&TI3C*>,3C>3C&>&3C*
%5,*&B&TI3C&>*3C>&3C,>*3C,
%5,*&B&TI,&3C*>,
3C&>*3C,>,&3C
7) 7AA3NF!
I
%$
"%B#!$
%4.!$
%(#!S$
%
%
7 77A7A45,*&B&I
DACD -> B ;
*3C&>
&3C*>
*3C,E
*"#5I
%5B
"%5)B 
%5B 
%
%5B
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
76 7A79:5 , * &B&ID,3
C* *3C, &3C*E
*"#5I
%5,*B
"%5B
%5)B
%
%5)B
79 A)/
0
%B,*B
"%B !3
!.!B
%)B,*B
"%B 
!3!.
!B
7 )9/true0
%,*B#-
%
"%',*B V..B&
#"#!F%
%38"#,*B%
%%
%%
77 )7AA91eliminate anomalies
"0
%/#!
"%/#G
%/##
%
%/#decompose 

7 ))7AA6/!
"0
%4!!"
.-"
"%4!!
"
%4!#
"
%
%4!
replace".
-"

7A )6)A*I
"Enty Sets and their a6ributes should re@ect the
reality"
4"."!!0
%.5#<!
"%(!*#<!
%B#!!
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
%:#F!!
%B#!!
 )9:FI
/#!FF
"/3!F8"# 
#.8"#
@F3.!"
F#
%"
"%
%
%"
%"
 )74=5&#three principle
!I
%= 8"#*
"%= 8"# 5!
%8"# * 5!
%= * 5!
"%= 8"# 
5!
) )74binary relaonship between classes
@+:%%%
%
"%*!
%
%5
%
 ))*&#1- O3(- 
&-C)&O%5(- #!)   
9 6 %/about H0
%1#! 9
"%1#!) 
%1)#!)  9
%1#!)  96 
%1#! 9
6 ))(#!!#!!! !.
-  KR P M. Let t appear w
mesI
X union (Y intersect Z).
/H#is true0
%O-U
"%OUK
%CK
%O-- 
%O-U
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
9 9))4"- #
#!#!I
(!#
*!##H#I
(=:=*4- *;@4
B5;+
25;@<,P->
/#!#0
W$I9))%G!X
%6 6
"%6 9
%6 
%6 7
%6 
%6 6
 69(#!!(, * &#!I
,*&
333333333333333333333333333333333333
6

99
AA
B
7A
/!!#
H#I
(=:=*4, (@+*
B5;+(
25;@<,P,
% 
"% 
% )
% 
% 
7 992.=!(( B+= 
:+= (:5P &!%(H#
"count the number of employees
!%
%(=:=*4*;@4QB5;+=!
"%(=:=*4&!
*;@4QB5;+=!
25;@<,P&!
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
"%(=:=*4&! *;@4QB5;+=!
25;@<,P&!
%(=:=*4&! *;@4QB5;+=!
%
 99(#!!(, * &#!I
,*&
333333333333333333333333333333333333
6

99
AA

7A
/!!#
H#I
(=:=*4(@+* (@+&
B5;+(
/1=5=&OA&&C9
% 
"% )
% 
% 6
% 6
A 9)1 5 , (* &%4
#.#I
5
,
3333333333333333333
6
)9

67
(
*&
3333333333333333333


)
9
*!##H#I
(=:=*4 , * &
%# #  
"%# # 9 
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
B5;+55'214;@4=5[;'(
;5%(%*
' " )!!#%
%# #  
"%# # 9 
%  # #
%6 7 # #
A A91 5 , (* &%
4#.#I
5
,
3333333333333333333
6
)9

67
(
*&
3333333333333333333


)
*!##H#I
(=:=*4 , * &
B5;+5:=B4;@4=5[;'(
;5%(%*
' " !!
#%
%6 7 # #
"%6 7  
%6 7  
%6 7 ) 
%6 7 # #
A 696#!fails!!a join
I
%#!
"%#!
%!#!
%"#!
%#!
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
A) 6945@=;5@::#I
%45@=
"%B:(=
%@::
%
%45@=
A 6)99)*I
%4#.#H#
"%*!"#.# "
@::.# ##F
%*!"#.# "
@::.# #B:(=
"%*!"#
.# "@::
.#, return unknown
A6 6996B.#-  K #
@:: ,-!
-O&;4C9;5K9
.#.#UNKNOWN0'
.#"%
%-@::  K6%
"%-3) 3) K3)%
%-  K7%
%-) 3 K%
%-@::  K6%
A9 6699*I
%#.#H#
"%4#.#H#
%*!"#.# "
@::.# #B:(=
%#.#H#
A 699A" "$ #
"*'&  #"%/
"Isolated" 0
%L'LI4!.L33
L!! F3#
!"#!
.J.
"%L'LI4#.
#-#
%L'LI4.
8#..!
%L'LIN"
!"."
#!
%L'LI
how/when"
!
"."
#!

Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
A7 6797/a wildcard used for pa6ern
matching?
%L\L#3#"#
"%L0L#"#
%L0L#3#"#
%L\L#3
#"#
A 697(#!!.
5 , *I
5
,*
3333333333333333333333333333333333
)
69
7A
/#H#I
(=:=*4(@+,
B5;+5
/1=5=*C
%
"%@::
%
%
"%@::
AA 6A9A*"#
PRIMARY KEYI
%4<5'+5PS=P#H#$
""
"%<F##H#.#
%!F#@::.#
%="#.!F "
.;=!F
%
%
 996Foreign key constraints"#
LLF!F
"
%5=B=5=*=(
"%<;'44;
%5=B=5
%
%5=B=5=*=(
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
9)4most useful index
-F%4"#I
%4-F8"##
"%4!"!F
#%
%4-F8"#F#!
!!-3
#
%
"%4!"
!F#%
) 9A74(:!!
.
%(
"%*
%+#
%
%(
96A7'PSM di&erence between a stored
procedure and a funconI
%##%
"%/."#%
%:!#%
%%
%##
%
6 99A)4;"G3"
"!"!#
H##=3!(ERD
"G3!!(ORM),V#
 " not
directly support
%4#
"%B
a. True
9 9AA*I
%@3&$4!@&4(:"!
"
"%@&4"!8"#"
"
%4@&4$I*5=4=4P<=4(
O!.!]8"#C
%
%
97AA)F#!
$#!(2+:3F#!
languages (SGML, XML, HTML)
%&#4!&$
"%&#&$:#
%&#+!#:#
%&#4!&$
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
%&#*:#
7 9AA#$XML
document structure
8"#
%R+:
"%&4&
%R(:4
%(2+:
"%&4&
A)7F#
may exist and SQL!"-#
%(:=.
"%(:(
%(:<
%(:;!K
%(:=.
A 7/graph database0
%!""###
!
"%!""#"
##!
%!""#!
## !!!

%
%!""
uses graph##
 !!
!
 )/database0
%"
K"  
#!
"%"$
%"
%"#!
%"
K
" 
 #!
 67A!
"#"%'
 3!#!V!.
#!$ #
!#".#!!
%+((:
"%&,+(
%&,(
%&,)
"%&,+(
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
) 94 two important data modelsI
%43###R+:
F
"%4#"G3
-3###
R+:
%4F^$
%4^$3##
#R+:
"%4
#"G3
-3
###
R+:
 7A4 modern DBMS queries are
parsed and opmized"
%
"%-#
%"#J
%H#!
%H#!
6 AA person who !"##
"I
%#
"%"
%"
%
"%"
9 AA database administrator(DBA)!
F"I
%&"
"%&"4#
%&"*&"<
%&"+
%&"*
&"<
 )Data Denion language (DDL)#
%%%%%%
%H#""
"%"H#"
%"
%
%"
7 9/#"(:#
manipulate Database structures #"0
%&&:&&$:#
"%&+:&+!#:#
%&*:&*:#
%
%&&:&&$:#
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
 6/!
0
%(##
"%;!
%*
%
%
A 9)L5 , * &L-!I
%
"%
%
%
%
) /#remove a
column named D50
%:4=54,:=5&5;<*;:@+&>
"%:4=54,:=5&5;<*;:@+&W&4!X>
%:4=54,:=5&=:=4=*;:@+&>
%:4=54,:=5&=:=4=*;:@+&W&4!X>
%:4=54,:=5&5;<*;:@+
&>
) 7/primary key0
%!F$"#H#
$""
"%!F$"#
"!""
%!F$"#H#
$"
%!F$"#
"!""
%!F$
"#H#$
row "
)) A))/#add a column
named D50
%:4=54,:=5&&&W&4!X>
"%:4=54,:=5&&445',@4=&W&4!X>
%:4=54,:=5&&<5;<=54P&W&4!X>
%:4=54,:=5&&&
W&4!X>
) ))/NOT a DML
command0
%&=:=4=
"%254
%'(=54
%@<&4=
"%254
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
)6 ))4!that adds all
possible pairs of rows from two tables F%%%%
!%
%#
"%!#
%G
%
"%!#
)9 )7A9:5,*&=B21$
#!I
3C,
*13C
,3C=
,&3C*
=23C1
&=3CB%
/B&#"
$"50
%*213C,B
"%*23C&1
%&23C*1
%,*&3CB1
%&23C*1
) )97AA*5 , * 
&B&T,*3C& &3C 3C,%/
the key of R?
%,&
"%,*
%&
%,
"%,*
)7 )7A2.5 , *
#!
BD,3C* ,3C *3C,E%
/8"#Nprime0
%
"%,
%,
%,*
%,*
) )77A72.5,*&=
B&TI
&3C*
*=3C
&3C 
=3C&
/a6ribute set is a key0
%,*&=
%,=
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
"%*&=
%,=
%,&
)A )A7A78"#
do not allow 2-tuples
..#8"#
%S
"%BS
%'-S
%4S
%S
 )7A(#!!.5,*&
B&TI
,*3C>
&3C*>
*&3C,>
,&3C*
%5,*B
"%5,*B
%
%
"%5,*B
 7A7745,*&B&I
D,3C*>,&3C*>,*3C&>*3C&E
*"#50
%5B
"%5B
%5,*B
"%5B
) 67AA)Normalizaon !K
."B#
&!B&!F.
I
%+K#
"%+K
%
%+K#!
%
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
 6:FI
B !3
!.!B
"B !3
!.!B
B !3
!.!,*B
B !3
!.!,*B
%#
"%"#
%#
%"#
%#
6 667:FI
B)B
")BB
B,*B
BB
%"#
"%#
%#
%"#
%"#
9 69/"normalizaon"0
%K#
"K
##"
"%KK#
"K##
""H#F
%K.#"
K##"
"H#F
%K#
"K##
""H#F
%K
eliminang redundant
"
organizing the data##
"
 67AA7/guidelines for
designing 0
%5##.##!
"%5#@::.##!
%FB
%
%
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
7 Regardless of whatever any other transacon 
#""#-
%
4"."!!0
%
"%'
%*
%&#"
"%'
 Pay a6enonH#I
(=:=*4QB5;+5
/1=5=:'S=T\\T>
( ". \!0
%\!!K  
"%\!!-
%\!!
K  
A /(: #"
L<L.##
LBLLL0
%(=:=*4QB5;+</1=5=BTT
"%(=:=*4QB5;+</1=5=B:'S=T\T
%(=:=*4QB5;+</1=5=BT\\T
%(=:=*4QB5;+</1=5=B:'S=T\T
%(=:=*4QB5;+</1=5=
B:'S=T\T
6 /the keyword ESCAPE mean0
%4F=(*<=#
L\LLL
"%4F=(*<=
%4F=(*<=#
L0LLQL
%4F=(*<=#
L_LL`L
%4F=(*<=#

L\LLL
6 4SQL BETWEEN !I
%(!$%
"%(!$"%
%(!$#!F%
%
%(!$%
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
6) Referenal integrity Constraints!
"%%%%
%8"#"
"%!"G
%"
%""
%""
6 Database integrity ensuresI
%"# . 

"%"# 

%". 
%"# .
%"
# . 
66 /0
%<-F-
!#"!!"8F%
"%&Y-!#.
"!!!
%4-"
F!-""H#!
#!
%
%
69 / view0
%."
"%.!!#-#
.#
%..#"#-#!3
!H#%.!!
" #"%
%
%..#"
#-#!3
!H#%.
!!"
 #"
%
6 /###!"
speed up table reads0
%-
"%
%3!#
%
%-
67 ;V &,+(#build a single index
8"#

%
"%
%
%#!
%
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
6 (#!!updatable view ParamountMovies
+.%*%
%&!+..
<#+.
"%&!<#+.+.
%#!<#+.
+.
%
%#!<#+.
+.
6A /##stored procedures0
%4-#
"%4#FY
%4#!
%4"##
%
%
9 '@+: "an associaon
%"!
"%#3!
%
%"!
9 /"weak"?
/#!F"G #
! 
"/8"#can not
/'needs support
/'=5&
%"
"%"
%
%
"%"
9) *I
L/=5& no non-key a6ribute
'one' in many-one relaonship 
#8"#L
4"."!!0
%.5#<!
,%<FF!!
*%:#F!!
&%B#!!
,%Picking the rightF
!!
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
9 /drawing an ERDI
=8"##^
"5#not important 
.#
"#
*!
%"
,%
*%"
&%"
,%
96 weak enty
%!
,%.#F8"#
*%F38"#
&%
,%.#F
8"#
99 1 5 , (* & 4= B%4
#.#I
5
,
3333333333333333333



(
*&
3333333333333333333



4
=B
3333333333333333333



*!##H#I
(=:=*4 B (@+* (@+&
B5;+5 ( 4
/1=5=,*&&=
25;@<,P B
1?'2*;@4QC
,%  ) )
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
' " !!
#%
%  ) 
,%  ) )
*%   
&%
9 *
%=-!*;@4 ##.#
,%=-!(@+ ##.#
*%=-!?2 ##.#
&%=-!+' ##.#
=%=-!+R ##.#
%=-!*;@4 
##.#
97 /di&erence between Where and Having
Clause0
%/1=5=51?'22#!
,%/1=5=2#!1?'25
*%/1=5=1?'2
&%/##/1=5=#
%/1=5=51?'2
2#!
9 (#!!5 " #!I
,*
33333333333333333333333333333333333

)
)6
)9
)6
)6

/#!#
H#I
(=:=*4 *;@4&'(4'*4,B5;+5
25;@<,P
1?'2(@+,C>
%) 
,% 7
*%) 
&% )
*%) 
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
9A /(:I
(=:=*4*# *;@4;
B5;+(
25;@<,P*#
1?'2*;@4;C9
%(#"(" 
#"9
,%(*#("
*%(#"(.
9%
&%
*%(#"
(.9
%
 45 ,.#!#!%*
H#create non-duplicated results 
#!50
%(=:=*4 ,B5;+5
,%(=:=*4 ,B5;+525;@<,P ,
*%(=:=*4B5;+5/1=5=;4'(=:=*4,B5;+5
&%(=:=*44;< ,B5;+5
,%(=:=*4 ,B5;+525;@<,P
 ,
 4"5R P##!
#!%4( , *
#!I
(!#
/#-#H#I
(=:=*4QB5;+5
@';
(=:=*4QB5;+(
W$I9)6%G!X
%4
"%4#!#9
%4#!#
%4#!#7
%4
) 97/"join"?
%TGT#"
#$
"%TGT#"
$
%TGT#"
%TGT#
"or
without$
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
#$
%TGT#"

 /G5( display all the records5
##I
%:=B4;@4=5[;'
"%5'214;@4=5[;'
%'=5[;'
%
%:=B4;@4=5[;'
6 2.5 ,(, * &%4 resultnatural
join5(
%;8"#,
"%;8"#5%,(%,
%8"# , * &
%
%8"# , * &
9 55- ##!@:: 
@::%/H#!#
!#!#04 #!"
!# ##!.@::T%
%(=:=*4QB5;+5/1=5=-'(@::
"%(=:=*4QB5;+5/1=5=-@::
%(=:=*4QB5;+5/1=5=-
%(=:=*4QB5;+5/1=5=-OC
%(=:=*4QB5;+5/1=5=-'(
@::

7

A
7
7
7)
7
76
79
7
77
7
7A

Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223

)

6
9

7

A
A
A
A)
A
A6
A9
A
A7
A
AA

)
6
9
7
A


)

6
9
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223

7

A
)
)
))
)
)6
)9
)
)7
)
)A


)

6
9

7

A
6
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)
lOMoARcPSD|35919223
| 1/39

Preview text:

lOMoARcPSD|35919223 1
QN=1 (6803) A ____ is a logically coherent collec琀椀on of a. Database
data with some inherent meaning, represen琀椀ng some
aspect of real world and being designed, built and
populated with data for a speci昀椀c purpose a. Database b. Database Instance c. Schema d. Schema Instance 2
QN=2 (6801) Choose the most correct statement. b. All of the others
a. Database is created and maintained by a DMBS b. All of the others
c. Database is a collec琀椀on of data that is managed by a DBMS
d. Database is a collec琀椀on of informa琀椀on that exists over a long period of 琀椀me 3
QN=3 (6802) Which of following is never used as a data c. Graph-based data model model? a. Hierarchical data model b. None of the others c. Graph-based data model d. Tree-based data model e. Rela琀椀onal data model 4
QN=4 (6817) A ____ is a rela琀椀on name, together with the a. schema
a琀琀ributes of that rela琀椀on. a. schema b. database c. database instance d. schema instance 5
QN=5 (6824) A ___ is a nota琀椀on for describing the a. data model
structure of the data in a database, along with the constraints on that data a. data model b. database management system c. data opera琀椀on d. data manipula琀椀on 6
QN=6 (6827) A _____ is a language for de昀椀ning data a. DDL structures a. DDL b. DML c. DCL d. None of the others 7
QN=7 (6834) Which statement is used to remove a a. DROP TABLE R; rela琀椀on named R? a. DROP TABLE R; b. REMOVE TABLE R; c. DELETE TABLE R; d. TRUNCATE TABLE R;
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 8
QN=8 (6829) What is another term for a row in a b. Tuple rela琀椀onal table? a. A琀琀ribute b. Tuple c. Field d. Rela琀椀on 9
QN=9 (7961) Given a rela琀椀on R(A,B,C,D). Which of the d. A->->BCD followings is trivial? a. A->AB b. A->->AB c. A->BCD d. A->->BCD 10
QN=10 (7972) Let R(ABCD) be a rela琀椀on with func琀椀onal b. AC dependencies {A -> B, C -> B, B -> D}
What is the key for R (choose one) a. AB b. AC c. AD d. BD 11
QN=11 (7966) Suppose R is a rela琀椀on with a琀琀ributes A1, a. 4 A2, A3, A4.
The only key of R is {A1, A2}. So, how many super-keys do R have? a. 4 b. 8 c. 12 d. 16 12
QN=12 (7990) Consider the following func琀椀onal a. R is in First Normal Form dependencies a,b -> c,d e,g,h -> f,j a,c -> b,d p,q -> r,s e,f,g -> h,i s -> t f,g -> j q -> u g,h -> i
Which of the following best describes the rela琀椀on R(e,f,g,h,i,j)? a. R is in First Normal Form b. R is in Second Normal Form
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 c. R is in Third Normal Form
d. R is in Boyce Codd Normal Form 13
QN=13 (7978) The rela琀椀on R(ABCD) has following FDs:
{ A -> B ; B -> A ; A -> D ; D -> B } a. R is in 3NF b. R is not in 3NF c. R is not in 2NF d. None of the others 14
QN=14 (7976) Given a R(A,B,C,D) with the following FDs: AB->D BC->A AD->B CD->B AD->C
Choose a correct statement about R:
a. The FD set of R is not canonical and R is in BCNF
b. The FD set of R is canonical and R is not in BCNF
c. The FD set of R is not canonical and R is not in BCNF 15
QN=15 (7999) What is the di昀昀erence between the 2NF and the 3NF?
a. 2NF deals with par琀椀al func琀椀onal dependency, while 3NF
deals with transi琀椀ve func琀椀onal dependency
b. 2NF deals with transi琀椀ve func琀椀onal dependency, while
3NF deals with par琀椀al func琀椀onal dependency 16
QN=16 (7993) What is "de-normaliza琀椀on"?
a. De-normaliza琀椀on means allowing redundancy in a table
b. De-normaliza琀椀on means allowing duplicate columns appeared in a table
c. De-normaliza琀椀on means allowing a table to have more than 3 columns
d. De-normaliza琀椀on means allowing a table to have more than 1024 columns 17
QN=17 (8004) What is the bene昀椀t of "de-normaliza琀椀on"?
a. "de-normaliza琀椀on" has no bene昀椀t
b. The main bene昀椀t of de-normaliza琀椀on is improved
performance with simpli昀椀ed data retrieval (this is done by
reduc琀椀on in the number of joins needed for data processing)
c. The main bene昀椀t of de-normaliza琀椀on is elimina琀椀ng
redundant informa琀椀on from a table and organizing the
data so that future changes to the table are easier 18
QN=18 (8022) The key for a weak en琀椀ty set E is .........
a. Zero or more a琀琀ributes of E
b. The set of a琀琀ributes of suppor琀椀ng rela琀椀onships for E
c. The set of a琀琀ributes of suppor琀椀ng en琀椀ty sets
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
d. Zero or more a琀琀ributes of E and key a琀琀ributes from suppor琀椀ng en琀椀ty sets 19
QN=19 (8019) A class in UML is similar to...........
a. An en琀椀ty set in E/R model
b. An a琀琀ribute in E/R model
c. A Rela琀椀onship in E/R model d. None of the others 20
QN=20 (8013) A(n) _____ provides a means to analyze
business requirements so as to standardize organiza琀椀onal
vocabulary, enforce business rules, and ensure adequate data quality
a. En琀椀ty Rela琀椀onship Diagram b. Rela琀椀on Schema Design c. All of the others d. None of the others 21
QN=21 (8032) An associa琀椀on class in UML is similar to
a. a琀琀ributes on a rela琀椀onship ______ in the ER model
a. a琀琀ributes on a rela琀椀onship b. A琀琀ributes c. En琀椀琀椀es d. en琀椀ty sets 22
QN=22 (8009) In UML, what is the di昀昀erence between an
a. In composi琀椀on, when the
aggrega琀椀on and a composi琀椀on?
owning object is destroyed, so are
a. In composi琀椀on, when the owning object is destroyed, so the contained objects. In
are the contained objects. In aggrega琀椀on, this is not
aggrega琀椀on, this is not necessarily necessarily true. true
b. In aggrega琀椀on, when the owning object is destroyed, so
are the contained objects. In composi琀椀on, this is not necessarily true. c. All of the others
d. There is no di昀昀erence between an aggrega琀椀on and a composi琀椀on 23
QN=23 (8222) Which of the following is NOT a standard a. GROUP
aggrega琀椀on operator? a. GROUP b. SUM c. COUNT d. AVG 24
QN=24 (8238) Consider the law, that holds for set b. False rela琀椀ons:
T intersect(R union S) = (T intersect R) union (T intersect S)
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
The above law s琀椀ll hold for bag rela琀椀ons? a. True b. False 25
QN=25 (8236) Choose the correct statement:
a. Aggregate func琀椀ons perform a
a. Aggregate func琀椀ons perform a calcula琀椀on on a set of
calcula琀椀on on a set of values and
values and return a single value return a single value
b. Aggregate func琀椀ons perform a calcula琀椀on on a single
value and return a single value
c. Aggregate func琀椀ons perform a calcula琀椀on on a set of
values and return a rela琀椀on
d. Aggregate func琀椀ons perform a calcula琀椀on on a set of values and return a row 26
QN=26 (8507) Suppose the rela琀椀on S(B,C,D) has tuples: a. 6 B C D a 4 6 c 6 8 c 5 5 e 9 9 F 10 10 c 7 9
Compute the result of the following query: SELECT SUM(D) FROM S WHERE D < 8 AND D > 5
Choose the row that appears in the computed result. a. 6 b. 7 c. 8 d. 9 27
QN=27 (8500) Suppose the rela琀椀on S(B,C,D) has tuples: c. (9,16) B C D a 4 6 c 6 8 c 5 5 e 9 9 f 10 10 c 7 9
Compute the result of the following query: SELECT D, SUM(C)
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 FROM S GROUP BY D
Choose rows that are appear in the computed result a. (9,12) b. (9,14) c. (9,16) d. (9,18) 28
QN=28 (8509) Column A of a rela琀椀on has the following list c. 20
of values in the six rows of the table: NULL, NULL, 10, 10, 20, 30
In SQL Server, which of the following is the correct value of AVG(DISTINCT A)? a. 15 b. NULL c. 20 d. 10 29
QN=29 (8513) The table Arc(x,y) currently has the a. (3,1,2)
following tuples (note that there are duplicates): (1,2),
(1,2), (2,3), (3,4), (3,4), (4,1), (4,1), (4,1), (4,2). Compute the result of the query: SELECT a1.x, a2.y, COUNT(*) FROM Arc a1, Arc a2 WHERE a1.y = a2.x GROUP BY a1.x, a2.y;
Which of the following tuples is in the result? a. (3,1,2) b. (1,3,4) c. (2,4,6) d. (3,2,6) 30
QN=30 (8517) How we can understand about this
a. This means aggregate func琀椀ons statement:
return the same value any 琀椀me
"All aggregate func琀椀ons are determinis琀椀c"?
they are called by using a speci昀椀c
a. This means aggregate func琀椀ons return the same value set of input values
any 琀椀me they are called by using a speci昀椀c set of input values
b. This means aggregate func琀椀ons return the di昀昀erent
values each
琀椀me they are called by using a speci昀椀c set of input values
c. This means aggregate func琀椀ons return the same value
any 琀椀me
they are called by using any set of input values d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 31
QN=31 (8523) When we apply set operators (UNION, c. All of the others
INTERSECT, EXCEPT) to two rela琀椀ons R and S, which
condi琀椀ons on R and S must be sa琀椀s昀椀ed?
a. R and S must have schemas with iden琀椀cal sets of
a琀琀ributes and the types (domains) for each a琀琀ributes must be the same in R and S
b. Before we compute the set-theore琀椀c union,
intersec琀椀on, or di昀昀erence of sets of tuples, the columns of
R and S must be ordered so that the order of a琀琀ributes is
the same for both rela琀椀ons c. All of the others 32
QN=32 (8526) How many JOIN condi琀椀ons are necessary d. 4
to combine 昀椀ve tables based on common a琀琀ributes? a. 1 b. 2 c. 3 d. 4 33
QN=33 (8528) Suppose rela琀椀on R(A,B) has the tuples: b. (30,y) d. (70,t) A B 10 x 30 y 50 z 70 t
and the rela琀椀on S(B,C,D) has tuples: B C D x 40 60 z 60 80 z 50 50 z 70 90
Compute the right outer join of R and S, where the
condi琀椀on is: R.B = S.B. Then iden琀椀fy 2 tuples of R that do
not appear in the computed result. a. (10,x) b. (30,y) c. (50,z) d. (70,t)
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 34
QN=34 (8539) For what values of x, y, and z, including a. x = 5, y = 3, z = 10
NULL, does the Boolean expression
x <= 4 OR NOT(y >= 2 AND z = 10)
have the truth value FALSE? Iden琀椀fy one of those values from the list below a. x = 5, y = 3, z = 10 b. x = 3, y = 1, z = 10. c. x = NULL, y = 2, z = 10. d. x = NULL, y = 3, z = 10. 35
QN=35 (8547) What operator tests column for the c. IS NULL operator absence of data? a. IS BLANK operator b. IS ZERO operator c. IS NULL operator d. ISNULL operator 36
QN=36 (8542) What does NULL mean? a. The value NULL means
a. The value NULL means UNKNOWN UNKNOWN
b. The value NULL means '' (empty string)
c. The value NULL means ' ' (space character) d. The value NULL means ZERO 37
QN=37 (8550) What is the value of the query: d. NULL
SELECT 'Nancy' + NULL + 'Smith'
when evaluated on Microso昀琀 SQL Server? a. 'Nancy Smith' b. 'Nancy' c. 'NancySmith' d. NULL 38
QN=38 (8557) Which SQL keyword is used to sort the a. ORDER BY result-set? a. ORDER BY b. SORT BY c. ORDER d. SORT 39
QN=39 (8558) Three proper琀椀es of a lock in DBMS are:
a. (a) and (c) and (d) are true
a)Granularity: the size of the lock
b) Granularity: the type of the lock c) Mode: the type of the lock
d) Dura琀椀on: the 琀椀me in seconds that the DBMS waits for a lock to be released
a. (a) and (c) and (d) are true
b. (a) and (b) and (d) are true
c. (b) and (c) and (d) are true
d. (a) and (b) and (c) are true 40
QN=40 (8560) A database transac琀椀on, by de昀椀ni琀椀on, must c. "Durable" means that:
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
be ACID (atomic, consistent, isolated and durable). What
Transac琀椀ons that have commi琀琀ed does "Durable" mean? will survive permanently
a. "Durable" means that: Transac琀椀ons provide an "all-or-
nothing" proposi琀椀on, sta琀椀ng that each work-unit
performed in a database must either complete in its
en琀椀rety or have no e昀昀ect whatsoever
b. "Durable" means that: Transac琀椀ons must not violate any
integrity constraints during its execu琀椀on
c. "Durable" means that: Transac琀椀ons that have
commi琀琀ed
will survive permanently d. All of the others 41
QN=41 (8569) Suppose rela琀椀on R(A,B). b. SELECT (A+B) AS C
Choose the SQL statement that is equivalent to the FROM R following RA expression: WHERE (A+B) > 10 [昀椀le:8569.jpg] a. SELECT * FROM R b. SELECT (A+B) AS C FROM R WHERE (A+B) > 10 c. SELECT (A+B) AS C FROM R d. There is not any choice 42
QN=42 (8575) What is the di昀昀erence between the WHERE c. The WHERE SQL clause and HAVING SQL clauses?
condi琀椀on(s) is applied to all rows
a. The WHERE and the HAVING clauses are iden琀椀cal in the result set before the
b. The HAVING SQL clause condi琀椀on(s) is applied to all HAVING clause is applied (if
rows in the result set before the WHERE clause is applied
present). The HAVING clause is
(if present). The WHERE clause is used only with SELECT used only with SELECT SQL
SQL statements and speci昀椀es a search condi琀椀on for an
statements and speci昀椀es a search aggregate or a group
condi琀椀on for an aggregate or a
c. The WHERE SQL clause condi琀椀on(s) is applied to all rows group
in the result set before the HAVING clause is applied (if
present). The HAVING clause is used only with SELECT SQL
statements and speci昀椀es a search condi琀椀on for an aggregate or a group d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 43
QN=43 (8599) Choose the correct statement. d. All of the others.
a. You can remove a trigger by dropping it or by dropping the trigger table.
b. The syntax to remove a trigger is: DROP TRIGGER
c. Use ALTER TRIGGER to change the de昀椀ni琀椀on of a trigger d. All of the others. 44
QN=44 (8585) Suppose R and S are 2 rela琀椀ons. R is the b. We can delete a row from R parent of S.
although that row has children in S
And the rela琀椀onship between R and S is set to
(and in this case, all the children "ON DELETE CASCADE". will be deleted too) This means that:
a. We can delete a row from R if that row has children in S
(and in this case, the database server will raise up an error)
b. We can delete a row from R although that row has
children in S (and in this case, all the children will be deleted too) 45
QN=45 (8592) To create a DEFAULT constraint on the a. ALTER TABLE Person
"City" column of the table PERSON which is already ALTER COLUMN City SET DEFAULT
created, use the following SQL: 'SANDNES' a. ALTER TABLE Person
ALTER COLUMN City SET DEFAULT 'SANDNES' b. ALTER TABLE Person
EDIT COLUMN City SET DEFAULT 'SANDNES' c. ALTER TABLE Person
UPDATE COLUMN City SET DEFAULT 'SANDNES' d. ALTER TABLE Person
MODIFY COLUMN City SET DEFAULT 'SANDNES' 46
QN=46 (8582) Three basic types of database integrity
a. (a) and (b) and (c) are true constraints are: (a)En琀椀ty integrity (b) Domain integrity (c) Referen琀椀al integrity (d) Primary key integrity
a. (a) and (b) and (c) are true
b. (a) and (b) and (d) are true
c. (a) and (c) and (d) are true
d. (b) and (c) and (d) are true 47
QN=47 (8609) A(an) _____ asserts that a value appearing c. Foreign key constraint
in one rela琀椀on must also appear in the primary-key
component(s) of another rela琀椀on a. Unique key constraint b. Primary key constraint c. Foreign key constraint
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 d. Candidate key constraint 48
QN=48 (8600) What is di昀昀erence between PRIMARY KEY
a. A table can have more than one and UNIQUE KEY ?
UNIQUE KEY constraint but only
a. A table can have more than one UNIQUE KEY constraint one PRIMARY KEY but only one PRIMARY KEY
b. A table can have more than one PRIMARY KEY
constraint but only one UNIQUE KEY
c. UNIQUE KEY and PRIMARY KEY are the same d. None of the others 49
QN=49 (8637) A/An _____ is a data structure that makes it a. Index
e昀케cient to 昀椀nd those tuples that have a 昀椀xed value for an a琀琀ribute a. Index b. Trigger c. stored-procedure d. View 50
QN=50 (8620) Select the most correct answer d. All of the others.
a. An index is a data structure used to speed access to
tuples of a rela琀椀on, given values of one or more a琀琀ributes
b. The key for index can be any a琀琀ribute or set of
a琀琀ributes, and need not be the key of the rela琀椀on
c. We can think of the index as a binary search tree of (key,
loca琀椀ons) pairs in which a key a is associated with a set of loca琀椀ons of the tuples d. All of the others. 51
QN=51 (8633) ___ allow the database applica琀椀on to 昀椀nd a. Indexes
data fast, without reading the whole table a. Indexes b. Views c. Triggers d. Store-procedures 52
QN=52 (8630) What are the drawbacks of indexes? a. (a) and (b) are true
(a)Indexes require more disk space
(b) Indexes make UPDATE, INSERT, DELETE statement slower
(c)Indexes have no any drawback
(d) Indexes make SELECT statement slower a. (a) and (b) are true b. (a) and (c) are true
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 c. (b) and (c) are true d. (b) and (d) are true 53
QN=53 (8624) Well-designed ____ can reduce disk I/O b. Indexes
opera琀椀ons and consume fewer system resources therefore improving query performance a. Triggers b. Indexes c. Views d. Stored Procedures 54
QN=54 (9178) Which of the following statements is the d. All of the others most correct?
a. Using Stored procedures reduces network tra昀케c
b. Using Stored procedures improves security
c. Using Stored procedures improves performance d. All of the others 55
QN=55 (9168) The bene昀椀ts of stored procedures are: a. (a) and (c) are true
(a)They improve the security by le琀�ng the admin to LIMIT the access rights of users
(b) They can save a lot of storage space
(c) They can be reused many 琀椀mes
(d) They can store a part of the database in order to retrieve the data more quickly a. (a) and (c) are true b. (a) and (b) are true c. (a) and (d) are true d. (b) and (d) are true 56
QN=56 (9186) Select the right statement to declare c. CREATE TABLE MovieStar OF
MovieStar to be a rela琀椀on whose tuples are of type StarType ();
StarType. Note: StarType is a user-de昀椀ned type that has its de昀椀ni琀椀on as follows: CREATE TYPE StarType AS ( name CHAR(30), address CHAR(100) );
a. CREATE TABLE MovieStar (name StarType );
b. CREATE TABLE MovieStar (name StarType PRIMARY KEY );
c. CREATE TABLE MovieStar OF StarType (); d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 57
QN=57 (9187) A ____ table is a table that is embedded a. Nested within another table a. Nested b. Primi琀椀ve c. Parent d. Child 58
QN=58 (9195) A database of _____ data model is a a. semi-structured
collec琀椀on of nodes, each node is either a leaf or interior a. semi-structured b. rela琀椀onal c. network d. object-rela琀椀onal 59
QN=59 (9196) Select the well-formed XML.
a. <? xml version = "1.0" ?>
a. <? xml version = "1.0" ?> 1997 琀椀tle="StarWar">1997 >
b. <? xml version = "1.0" ?> 1997
c. <? xml version = "1.0" ?> 1997 a. d. All of the others. 60
QN=60 (9211) A _____ speci昀椀es which characters are "less c. Colla琀椀on
than" which other characters a. Domains b. Character set c. Colla琀椀on d. Stored procedure 61
QN=1 (6797) A ____ is a powerful tool for crea琀椀ng and a. DBMS
managing large amounts of data e昀케ciently and allowing it
to persist over long periods of 琀椀me, safely a. DBMS b. Database c. Excel d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 62
QN=3 (6800) What is the hierarchical data model?
a. A hierarchical data model is a
a. A hierarchical data model is a data model in which the
data model in which the data is
data is organized into a tree-like structure
organized into a tree-like
b. A hierarchical data model is a data model in which the structure
data is organized into a table-like structure
c. A hierarchical data model is a data model in which the
data is organized into a graph-like structure d. None of the others 63
QN=4 (6795) In _____ Data Model, the data and rela琀椀ons a. Rela琀椀onal
between them are organized in tables a. Rela琀椀onal b. Network c. Flat-昀椀le d. Object-oriented e. Tree-based 64
QN=5 (6833) Why the intersec琀椀on operator is not called a
a. Because the intersec琀椀on
primi琀椀ve rela琀椀onal algebra operator? operator can be expressed
a. Because the intersec琀椀on operator can be expressed
through the union operator and
through the union operator and the di昀昀erence operator the di昀昀erence operator
b. Because the intersec琀椀on operator can be expressed
through the selec琀椀on operator and the projec琀椀on operator
c. Because the intersec琀椀on operator can be expressed
through the product operator and the projec琀椀on operator
d. Because the intersec琀椀on operator can be expressed
through the selec琀椀on operator and the product operator 65
QN=6 (6814) In SQL , the command/statement that let you c. Alter
add an a琀琀ribute to a rela琀椀on schema is ....... a. Insert b. Update c. Alter d. None of the others 66
QN=7 (6826) To update a rela琀椀on's schema, which one of a. ALTER TABLE
the following statements can be used? a. ALTER TABLE b. SELECT c. INSERT d. UPDATE 67
QN=8 (6832) Schema-altering commands are known as
a. Data De昀椀ni琀椀on Language _________ commands.
a. Data De昀椀ni琀椀on Language
b. Data Manipula琀椀on Language c. Data Controlling Language d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 68
QN=10 (6830) Which one of the following is NOT a DML b. ALTER TABLE command? a. DELETE b. ALTER TABLE c. INSERT d. UPDATE 69
QN=12 (7962) What is a func琀椀onal dependency?
a. A func琀椀onal dependency (A->B)
a. A func琀椀onal dependency (A->B) occurs when the
occurs when the a琀琀ribute A
a琀琀ribute A uniquely determines B uniquely determines B
b. A func琀椀onal dependency (A->B) occurs when the
a琀琀ribute B uniquely determines A 70
QN=14 (7970) What is a key a琀琀ribute in a rela琀椀on?
a. A key a琀琀ribute is an a琀琀ribute
a. A key a琀琀ribute is an a琀琀ribute that belongs to one of the
that belongs to one of the keys of keys of the rela琀椀on the rela琀椀on
b. A key a琀琀ribute is an a琀琀ribute that belongs to one of the super keys of the rela琀椀on 71
QN=15 (7984) Which of the following rela琀椀ons is in Boyce-
a. R(ABCD) with FD's: BD -> C ; AB
Codd Normal Form (BCNF)?
-> D ; AC -> B ; BD -> A
a. R(ABCD) with FD's: BD -> C ; AB -> D ; AC -> B ; BD -> A
b. R(ABCD) with FD's: BC -> A ; AD -> C ; CD -> B ; BD -> C
c. R(ABCD) with FD's: A -> C ; B -> A ; A -> D ; AD -> C
d. R(ABCD) with FD's: A -> D ; C -> A ; D -> B ; AC -> B 72
QN=16 (7991) 3NF concept is related to (choose 1 answer e. All of the others only): a. Atomic de昀椀ni琀椀on
b. Full dependency de昀椀ni琀椀on
c. Transi琀椀ve dependency de昀椀ni琀椀on
d. Super Key de昀椀ni琀椀on e. All of the others 73
QN=17 (7979) The rela琀椀on R(ABCD) has following FDs: a. R is in 3NF {ACD -> B ; AC -> D ; D -> C ; AC -> B}
Choose the correct statement about R: a. R is in 3NF
b. R is in 2NF only, not higher
c. R is in 1NF only, not higher d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 74
QN=18 (7975) Let R(A,B,C,D) with the following FDs: {AB- c. R is in 2NF >C, AC->B, AD->C}
Choose a correct statement about R: a. R is in BCNF b. R is in 3NF c. R is in 2NF d. None of the others 75
QN=19 (8002) Which of the following statements is
b. For any rela琀椀on schema, there correct? is a dependency-preserving
a. All rela琀椀ons in 3NF are also in BCNF decomposi琀椀on into 3NF
b. For any rela琀椀on schema, there is a dependency-
preserving decomposi琀椀on into 3NF
c. All rela琀椀ons in 2NF are also in BCNF 76
QN=20 (8005) Which of the following statements is true? d. All of the others.
a. BCNF condi琀椀on guarantees the non existence of the anomalies.
b. In BCNF condi琀椀on, the le昀琀 side of every non trivial FD must be a super key.
c. Any two-a琀琀ribute rela琀椀on is in BCNF. d. All of the others. 77
QN=21 (7995) How to eliminate anomalies when we
a. We should decompose rela琀椀on design a database? to eliminate anomalies
a. We should decompose rela琀椀on to eliminate anomalies
b. We should join rela琀椀ons to eliminate anomalies
c. We should union rela琀椀ons to eliminate anomalies d. None of the others 78
QN=22 (7994) What is the goal of decomposi琀椀on when
a. The goal of decomposi琀椀on is to designing a database?
replace a rela琀椀on by several
a. The goal of decomposi琀椀on is to replace a rela琀椀on by
rela琀椀ons that do not exhibit
several rela琀椀ons that do not exhibit anomalies anomalies
b. The goal of decomposi琀椀on is to increase the speed of the database
c. The goal of decomposi琀椀on is to increase the security of the database d. None of the others 79
QN=24 (8029) Consider the following statement: d. Faithfulness principle
"En琀椀ty Sets and their a琀琀ributes should re昀氀ect the reality"
That above statement describes which principle? a. Avoid Redundancy Principle b. Simplicity Count Principle
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
c. Limit the use of weak en琀椀ty sets principle d. Faithfulness principle 80
QN=25 (8010) Look at the following statements: a. (a) and (b) are correct
(a)We should pick the right kind of elements
(b) When an en琀椀ty has no non-primary key a琀琀ribute, we
should convert that en琀椀ty to an a琀琀ribute
(c) Use weak en琀椀琀椀es when-ever possible (d) Always make redundancies a. (a) and (b) are correct b. (a) and (c) are correct c. (a) and (d) are correct d. (b) and (c) are correct 81
QN=26 (8017) The ER Diagram uses three principle
b. En琀椀ty sets, A琀琀ributes, and element types: Rela琀椀onships
a. En琀椀ty sets, A琀琀ributes and Constraints
b. En琀椀ty sets, A琀琀ributes, and Rela琀椀onships
c. A琀琀ributes, Constraints, and Rela琀椀onships
d. En琀椀ty sets, Constraints, and Rela琀椀onships 82
QN=27 (8030) The binary rela琀椀onship between classes in c. Associa琀椀on UML is called ... a. Aggrega琀椀on b. Composi琀椀on c. Associa琀椀on d. Rela琀椀on 83
QN=28 (8231) Consider the Datalog rule H(x,y) <- S(x, y) a. H has a tuple (3, 5)
AND x > 2 AND y < 6. Rela琀椀on S(x, y) has 3 tuples (2, 3), (3,
5), and (4, 6). What is about H? a. H has a tuple (3, 5) b. H has a tuple (2, 3)
c. H has 2 tuples (2, 3) and (3, 5)
d. H has 3 tuples (2, 3) and (3, 5) and (4, 6) 84
QN=30 (8232) Suppose that tuple t appears, respec琀椀vely, a. w <= x+y
x, y, and z 琀椀mes in the rela琀椀ons X, Y, and Z. Let t appear w
琀椀mes
in the rela琀椀on: X union (Y intersect Z).
Which of the following inequali琀椀es is true ? a. w <= x+y b. w <= y+z c. w >= z d. w <= max(x,y)
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 85
QN=33 (8522) The table Arc(x,y) currently has the a. (4,4)
following tuples (note there are duplicates): (See picture)
Compute the result of the query: SELECT x, COUNT(y) FROM Arc GROUP BY x;
Which of the following tuples is in the result? [昀椀le:8522.jpg] a. (4,4) b. (4,5) c. (4,6) d. (4,7) e. (4,8) 86
QN=34 (8501) Suppose the rela琀椀on S(B,C,D) has tuples: d. (c,18) B C D
------------------------------------ a 4 6 c 6 8 c 5 5 e 9 9 F 10 10 c 7 9
Which one of the followings will appear in the result of the following query: SELECT B, SUM(C) FROM S GROUP BY B a. (c,11) b. (c,13) c. (c,12) d. (c,18) 87
QN=35 (8503) Given the rela琀椀on Employee(SSN, FNAME, b. SELECT DepartmentNo,
LNAME, SALARY, DepartmentNo). Select the right query COUNT(*) FROM Employee
below to count the number of employees in each GROUP BY DepartmentNo department.
a. SELECT COUNT(*) FROM Employee
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
b. SELECT DepartmentNo, COUNT(*) FROM Employee GROUP BY DepartmentNo
c. SELECT DepartmentNo, COUNT(*) FROM Employee d. None of the others 88
QN=36 (8505) Suppose the rela琀椀on S(B,C,D) has tuples: d. (10,14) B C D
------------------------------------ a 4 6 c 6 8 c 5 5 e 9 9 f 10 10 c 7 9
What row that appears in the result of the following query: SELECT SUM(C), SUM(D) FROM S WHERE D < 9 AND D > 5 a. (10,11) b. (10,12) c. (10,13) d. (10,14) 89
QN=38 (8532) Here are two rela琀椀ons, R(A,B), S(C,D). Their a. (null, null, 0, 1) current values are: b. (null, null, 5, 8) R A B ------------------- 1 4 2 5 8 6 4 7 S C D ------------------- 0 1 1 0 2 1 5 8
Compute the result of the query: SELECT A, B, C, D
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 FROM R RIGHT OUTER JOIN S ON R.A = S.C
Iden琀椀fy, in the list below, 2 rows that appears in the result. a. (null, null, 0, 1) b. (null, null, 5, 8) c. (8, 6, null, null) d. (4, 7, null, null) 90
QN=39 (8531) Here are three rela琀椀ons, R(A,B), S(C,D). a. (4, 7, null, null) Their current values are: R A B ------------------- 1 4 2 5 3 6 4 7 S C D ------------------- 0 1 1 0 2 1
Compute the result of the query: SELECT A, B, C, D FROM R LEFT OUTER JOIN S ON R.A = S.C
Iden琀椀fy, in the list below, the row that appears in the result. a. (4, 7, null, null) b. (4, 7, 0, 1) c. (4, 7, 1, 0) d. (4, 7, 2, 1) 91
QN=40 (8534) A tuple which fails to par琀椀cipate in a join is a. dangling tuple called: a. dangling tuple b. child tuple c. parent tuple d. neighbor tuple
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 92
QN=41 (8538) (TRUE OR NULL) return: a. TRUE a. TRUE b. FALSE c. NULL d. None of the others 93
QN=42 (8552) Choose one correct statement:
b. Comparisons between two null a. Two null values are equal values, or between a NULL and
b. Comparisons between two null values, or between a
any other value, return unknown
NULL and any other value, return unknown
c. Comparisons between two null values, or between a
NULL and any other value, return FALSE 94
QN=43 (8554) For what values of x, y, and z, including a. x = NULL, y = 0, z = 4.
NULL, does the Boolean expression
x <= 100 AND NOT(y >= 15 OR z = 35)
have the truth value UNKNOWN? Iden琀椀fy one of those values from the list below. a. x = NULL, y = 0, z = 4. b. x = -2, y = -2, z = -2. c. x = 3, y = 0, z = 7. d. x = 2, y = -1, z = 6. 95
QN=44 (8551) Choose one correct statement:
a. No two null values are equal
a. No two null values are equal b. Two null values are equal
c. Comparisons between two null values, or between a
NULL and any other value, return FALSE 96
QN=46 (8559) A database transac琀椀on, by de昀椀ni琀椀on, must d. "Isolated" means that:
be ACID (atomic, consistent, isolated and durable). What
how/when the changes made by does "Isolated" mean?
one opera琀椀on in one transac琀椀on
a. "Isolated" means that: Transac琀椀ons provide an "all-or- become visible to other
nothing" proposi琀椀on, sta琀椀ng that each work-unit
concurrent opera琀椀ons in other
performed in a database must either complete in its transac琀椀ons
en琀椀rety or have no e昀昀ect whatsoever
b. "Isolated" means that: Transac琀椀ons must not violate
any integrity constraints during its execu琀椀on
c. "Isolated" means that: Transac琀椀ons that have
commi琀琀ed will survive permanently
d. "Isolated" means that: how/when the changes made by
one opera琀椀on in one transac琀椀on become visible to other
concurrent opera琀椀ons in other transac琀椀ons
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 97
QN=47 (8578) What one is a wildcard used for pa琀琀ern
a. "%" (for mul琀椀-character matching? subs琀椀tu琀椀on)
a. "%" (for mul琀椀-character subs琀椀tu琀椀on)
b. "?" (for single character subs琀椀tu琀椀on)
c. "?" (for mul琀椀-character subs琀椀tu琀椀on) 98
QN=48 (8573) Suppose we have a rela琀椀on instance b. NULL R(A,B,C) as following: R A B C
---------------------------------- 1 2 3 4 5 6 7 8 9
Which is the result of the query: SELECT SUM(B) FROM R WHERE C > 10 a. 0 b. NULL c. 3 d. 10 99
QN=49 (8589) Choose the most correct statement about e. All of the others PRIMARY KEY:
a. The PRIMARY KEY constraint uniquely iden琀椀昀椀es each record in a database table
b. Primary keys must contain unique values
c. A primary key column cannot contain NULL values
d. Each table should have a primary key, and each table can have only ONE primary key e. All of the others 100
QN=50 (8584) Foreign key constraints are created by using a. REFERENCES
"_____" keyword to refer to the primary key of another table a. REFERENCES b. POINT TO c. REFER d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 1
QN=52 (8616) The most useful index on a rela琀椀on is an
b. The search opera琀椀on based on
index on its key. This is because:
the primary key is commonly used.
a. The index on non key a琀琀ribute(s) runs slower
b. The search opera琀椀on based on the primary key is commonly used.
c. The index on non key a琀琀ribute(s) makes update
opera琀椀ons to the rela琀椀on more complex and 琀椀me- consuming d. All of the others 2
QN=53 (9176) The SQL opera琀椀ons that are performed a. Session
while a connec琀椀on is ac琀椀ve form a ____ a. Session b. Catalog c. Module d. None of the others 3
QN=54 (9171) In PSM, the di昀昀erence between a stored
a. A func琀椀on has the return
procedure and a func琀椀on is that: statement.
a. A func琀椀on has the return statement.
b. We can declare local variables in a func琀椀on.
c. Loops are not allowed in a func琀椀on. d. All of the others. 4
QN=55 (9182) The aim for the Object-rela琀椀onal database a. True
is to bridge the gap between conceptual data modelling
techniques such as En琀椀ty-rela琀椀onship diagram (ERD) and
object-rela琀椀onal mapping (ORM), which o昀琀en use classes
and inheritance, and rela琀椀onal databases, which do not directly support them a. True b. False 5
QN=56 (9189) Choose the correct statement: d. All of the others
a. A User-De昀椀ned Type (UDT) in SQL can be the type of a table
b. A UDT can be the type of an a琀琀ribute belonging to some table
c. The form of UDT de昀椀ni琀椀on is: CREATE TYPE T AS () d. All of the others 6
QN=57 (9192) ______ is a set of markup declara琀椀ons that
a. Document Type De昀椀ni琀椀on
de昀椀ne a document type for SGML-family markup languages (SGML, XML, HTML)
a. Document Type De昀椀ni琀椀on
b. Document De昀椀ni琀椀on Language
c. Document Manipula琀椀on Language
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 d. Document Control Language 7
QN=58 (9198) A ____ document de昀椀nes the XML b. DTD
document structure with a list of legal elements and a琀琀ributes a. XML b. DTD c. XSLT d. SGML 8
QN=60 (9207) A ____ is the framework under which data a. SQL Environment
may exist and SQL opera琀椀ons on data may be executed a. SQL Environment b. SQL Statement c. SQL Parser d. SQL Op琀椀mizer 9
QN=1 (6807) What is a graph database?
c. A graph database is a database
a. A graph database is a database that uses tree structures
that uses graph structures with
with nodes to represent and store informa琀椀on
nodes, edges and proper琀椀es to
b. A graph database is a database that uses table
represent and store informa琀椀on
structures to represent and store informa琀椀on
c. A graph database is a database that uses graph
structures with nodes, edges and proper琀椀es to represent and store informa琀椀on d. None of the others 10
QN=2 (6808) What is a database?
a. A database is a collec琀椀on of
a. A database is a collec琀椀on of informa琀椀on that is
informa琀椀on that is organized so
organized so that it can easily be accessed, managed, and
that it can easily be accessed, updated managed, and updated
b. A database is a collec琀椀on of data 昀椀les
c. A database is a collec琀椀on of records
d. A database is a collec琀椀on of tuples 11
QN=4 (6793) A ______ is a collec琀椀on of programs that b. DBMS
enables user to create and maintain databases. In other
words, it is general-purpose so昀琀ware that provides the
users with the processes of de昀椀ning, construc琀椀ng and
manipula琀椀ng the databases for various applica琀椀ons a. MSSQL b. DBMS c. DBS d. DB2
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 12
QN=5 (6810) Today, the two important data models are:
b. The rela琀椀onal data model
a. The semi-structured data model (including XML and
(including object-rela琀椀onal
related standards) and the network data model extensions) and the semi-
b. The rela琀椀onal data model (including object-rela琀椀onal
structured data model (including
extensions) and the semi-structured data model (including XML and related standards) XML and related standards)
c. The network data model and the 昀氀at 昀椀le data model
d. The 昀氀at 昀椀le data model and the semi-structured data
model (including XML and related standards) 13
QN=6 (6798) Today, in a modern DBMS, the queries are d. query compiler
parsed and op琀椀mized by a. all of the others b. execu琀椀on engine c. bu昀昀er manager d. query compiler 14
QN=9 (6806) A person who is responsible for the structure b. a database administrator
or schema of the database is called: a. an end user b. a database administrator c. a database analyst d. all of the others 15
QN=10 (6809) A database administrator (DBA) is a person c. Database Coordinator or
that is also known by the 琀椀tle: Database Programmer a. Database Analyst b. Database Tuner
c. Database Coordinator or Database Programmer d. Database Modeller 16
QN=12 (6816) Data De昀椀ni琀椀on language (DDL) is used c. declare database schemas to ......
a. query database and modify the database
b. connect to database and query database c. declare database schemas d. All of the others 17
QN=13 (6815) Which is the subset of SQL commands used
a. DDL (Data De昀椀ni琀椀on Language)
to manipulate Database structures, including tables?
a. DDL (Data De昀椀ni琀椀on Language)
b. DML (Data Manipula琀椀on Language) c. DCL (Data Control Language) d. All of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 18
QN=14 (6818) Which of the followings is part of data d. All of the others model? a. Structure of the data b. Opera琀椀ons on the data c. Constraints on the data d. All of the others 19
QN=15 (6823) "R(A,B,C,D)" is an example of: a. A schema a. A schema b. A rela琀椀on c. A rela琀椀on instance d. A schema instance 20
QN=16 (6813) Which statement is used to remove a a. ALTER TABLE R DROP COLUMN
column named D from the rela琀椀on R? D;
a. ALTER TABLE R DROP COLUMN D;
b. ALTER TABLE R DROP COLUMN D [DataType];
c. ALTER TABLE R DELETE COLUMN D;
d. ALTER TABLE R DELETE COLUMN D [DataType]; 21
QN=17 (6831) What is a primary key?
c. A primary key is the 昀椀eld(s) in a
a. A primary key is the 昀椀eld(s) in a table that uniquely
table that uniquely de昀椀nes the
de昀椀nes that table in a database row in the table
b. A primary key is the 昀椀eld(s) in a table that is used to
establishes a rela琀椀onship between two tables
c. A primary key is the 昀椀eld(s) in a table that uniquely
de昀椀nes the row in the table
d. A primary key is the 昀椀eld(s) in a table that is used to
establishes a rela琀椀onship between two databases 22
QN=19 (6822) Which statement is used to add a column a. ALTER TABLE R ADD D
named D into the rela琀椀on R? [DataType];
a. ALTER TABLE R ADD D [DataType];
b. ALTER TABLE R ADD ATTRIBUTE D [DataType];
c. ALTER TABLE R ADD PROPERTY D [DataType]; 23
QN=20 (6821) Which one of the following is NOT a DML b. GRANT command? a. DELETE b. GRANT c. INSERT d. UPDATE
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 24
QN=22 (6811) The rela琀椀onal operator that adds all b. product
possible pairs of rows from two tables is known as the .... operator. a. union b. product c. join d. selec琀椀on 25
QN=23 (7956) Let R(ABCDEFGH) sa琀椀s昀椀es the following c. ADG -> CH func琀椀onal dependencies: A -> B, CH -> A, B -> E, BD -> C, EG -> H, DE -> F.
Which of the following FDs is also guaranteed to be sa琀椀s昀椀ed by R? a. CGH -> BF b. ACG -> DH c. ADG -> CH d. BCD -> FH 26
QN=25 (7969) Consider a rela琀椀on with schema R(A, B, C, b. BC
D) and FD's BC -> D, D -> A, A -> B. Which of the following is the key of R? a. BD b. BC c. D d. AB 27
QN=26 (7963) Given the rela琀椀on schema R(A,B,C) and d. B and C func琀椀onal dependencies
F = {AB-> C, B->A, C->B}.
Which a琀琀ribute(s) is/are prime? a. only A b. only B c. A and B d. B and C 28
QN=27 (7971) Given the rela琀椀on R(ABCDE) with the c. ABE following FD's: D -> C, CE ->A, D ->A, and AE ->D
Which of the following a琀琀ribute set is a key? a. ABCDE
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 b. CDE c. ABE d. BD 29
QN=29 (7967) A set of a琀琀ributes forms a ____ for a a. Key
rela琀椀on if we do not allow 2-tuples in a rela琀椀on instance
to have the same values in all that a琀琀ributes a. Key b. Foreign Key c. Index Key d. Trigger Key 30
QN=32 (7981) Suppose we have a rela琀椀on R(ABCD) with b. R is not in BCNF FD's: BC -> A ; AD -> C ; CD -> B ; BD -> C a. R is in BCNF b. R is not in BCNF c. All of the others d. None of the others 31
QN=38 (7977) The rela琀椀on R(ABCD) has following FDs: b. R is not in 3NF
{ AB -> C ; ABD -> C ; ABC -> D ; AC -> D}
Choose a correct statement about R? a. R is in 3NF b. R is not in 3NF c. R is in BCNF 32
QN=40 (7992) Normaliza琀椀on is a process of analyzing the c. All of the others
given rela琀椀on schema based on their Func琀椀onal
Dependencies (FDs) and primary keys to achieve the following: a. Minimizing redundancy
b. Minimizing inser琀椀on anomalies c. All of the others
d. Minimizing dele琀椀on and update anomalies
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 33
QN=43 (8003) Look at the following statements: a. (a) and (d) are true
(a) For any rela琀椀on schema, there is a dependency-
preserving decomposi琀椀on into 3NF
(b) For any rela琀椀on schema, there is not dependency-
preserving decomposi琀椀on into 3NF
(c) For any rela琀椀on schema, there is dependency-
preserving decomposi琀椀on into BCNF
(d) For some rela琀椀on schema, there is not dependency-
preserving decomposi琀椀on into BCNF a. (a) and (d) are true b. (a) and (b) are true c. (a) and (c) are true d. (b) and (d) are true 34
QN=44 (8007) Look at the following statements: d. (a) and (b) are true
(a)All rela琀椀ons in 3NF are also in 2NF
(b)All rela琀椀ons in 2NF are also in 1NF
(c)All rela琀椀ons in 1NF are also in BCNF
(d)All rela琀椀ons in 1NF are also in 3NF a. (b) and (d) are true b. (a) and (c) are true c. (a) and (d) are true d. (a) and (b) are true 35
QN=45 (8006) What is "normaliza琀椀on"? a. Normalizing data means
a. Normalizing data means elimina琀椀ng redundant
elimina琀椀ng redundant
informa琀椀on from a table and organizing the data so that
informa琀椀on from a table and
future changes to the table are easier
organizing the data so that future
b. Normalizing data means minimizing columns from a
changes to the table are easier
table and organizing the data so that future changes to the
table will be made more quickly
c. Normalizing data means removing columns from a table
and organizing the data so that future changes to the table will be made more quickly
d. Normalizing data means adding more columns to a
table and organizing the data so that future changes to the
table will be made more quickly 36
QN=46 (7997) Which of the following are guidelines for d. All of the others
designing the rela琀椀onal schema ?
a. Reduce the redundant values in tuples
b. Reduce the NULL values in tuples
c. Always make rela琀椀ons 3NF d. All of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 37
Regardless of whatever any other transac琀椀on is doing, a b. Isola琀椀on
transac琀椀on must be able to con琀椀nue with the exact same data set it started with.
The above describes which property of a transac琀椀on? a. Atomic b. Isola琀椀on c. Consistency d. Durability 38
Pay a琀琀en琀椀on into the following query:
a. % (percent sign) represents zero, one, or more character SELECT * FROM R WHERE A LIKE '%a%';
So, in the above case, the wildcard % represents what?
a. % (percent sign) represents zero, one, or more character
b. % (percent sign) represents exactly 1 character 39
With SQL, how do you select all the records from a table d. SELECT * FROM Persons WHERE
named "Persons" where the value of the column FirstName LIKE 'a%'
"FirstName" starts with an "a"?
a. SELECT * FROM Persons WHERE FirstName='a'
b. SELECT * FROM Persons WHERE FirstName LIKE '%a'
c. SELECT * FROM Persons WHERE FirstName='%a%'
d. SELECT * FROM Persons WHERE FirstName LIKE 'a%' 40
What does the keyword ESCAPE mean?
a. The keyword ESCAPE is used to
a. The keyword ESCAPE is used to match any string that
match any string that contains the
contains the characters "%" or "_" characters "%" or "_"
b. There is no keyword named ESCAPE
c. The keyword ESCAPE is used to match any string that
contains the characters "?" or "*"
d. The keyword ESCAPE is used to match any string that
contains the characters "@" or "$" 41
The SQL BETWEEN operator:
a. Speci昀椀es a range to test.
a. Speci昀椀es a range to test.
b. Speci昀椀es which tables we are selec琀椀ng from.
c. Speci昀椀es that a column is a primary key. d. None of the others
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 42
Referen琀椀al integrity Constraints control rela琀椀onships d. tables in a database between .... a. a琀琀ributes in a table b. opera琀椀ons of an object c. database instances d. tables in a database 43
Database integrity ensures that:
a. data entered into the database
a. data entered into the database is accurate, valid, and
is accurate, valid, and consistent consistent
b. data entered into the database is accurate, and consistent
c. data entered into the database is valid, and consistent
d. data entered into the database is accurate, and valid 44
Which of the following statements is the most correct? d. All of the others
a. Poorly designed indexes and a lack of indexes are
primary sources of database applica琀椀on bo琀琀lenecks.
b. Designing e昀케cient indexes is paramount to achieve
good database and applica琀椀on performance
c. The selec琀椀on of the right indexes for a database and its
workload is a complex balancing act between query speed and update cost d. All of the others 45 What is a view?
c. A view is a virtual table which
a. A view is a database diagram
results of execu琀椀ng a pre-
b. A view is a special stored procedure executed when
compiled query. A view is not a certain event occurs part of the physical database
c. A view is a virtual table which results of execu琀椀ng a pre-
schema, while the regular tables
compiled query. A view is not a part of the physical are.
database schema, while the regular tables are. d. None of the others 46
What structure can you implement for the database to a. indexes speed up table reads? a. indexes b. triggers c. store-procedures d. synonyms 47
O昀琀en, a DBMS allows us to build a single index on ____ a. only one a琀琀ribute(s)
(choose the most correct answer) a. only one b. two c. three d. mul琀椀ple
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 48
Suppose an updatable view ParamountMovies is
c. An update on ParamountMovies
associated with Movies rela琀椀on. Choose a correct answer. is translated into Movies
a. Drop Movies rela琀椀on also delete the view ParamountMovies
b. Drop ParamountMovies also delete Movies
c. An update on ParamountMovies is translated into Movies d. None of the others 49
Why we should use stored procedures? e. All of the others
a. They allow faster execu琀椀on
b. They can reduce network tra昀케c
c. They allow modular programming
d. They can be used as a security mechanism e. All of the others 50
In UML, a _____ between classes is called an associa琀椀on a.binary rela琀椀onship a.binary rela琀椀onship
b.mul琀椀-way rela琀椀onship c.none of the others 51
When an en琀椀ty is called "weak"? b.(b) and (c) are correct
(a) When it is used to represent weak objects, such as pa琀椀ents, elders
(b) When all of its a琀琀ributes can not iden琀椀fy itself
(c) When It always needs support from other en琀椀ty
(d) When It is not really necessary in the ERD a.(a) and (b) are correct b.(b) and (c) are correct c.(c) and (d) are correct d.(d) and (a) are correct 52
Consider the following statement:
B.Picking the right kind of element principle
"When drawing ERD, if an en琀椀ty has no non-key a琀琀ribute
and it is the 'one' in many-one rela琀椀onship, then we
should set it to the a琀琀ribute of other en琀椀琀椀es"
That above statement describes which principle? A.Avoid Redundancy Principle
B.Picking the right kind of element principle
C.Limit the use of weak en琀椀ty sets principle D.Faithfulness principle
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 53 When drawing an ERD:
B.(a) and (c) and (d) are correct
(a)En琀椀ty sets and their a琀琀ributes should re昀氀ect reality
(b)Redundancy is not important, so we can ignore it
(c) Avoid introducing more elements into the design than is absolutely necessary
(d) Choosing the right rela琀椀onships
A.(a) and (b) and (c) are correct
B.(a) and (c) and (d) are correct
C.(a) and (b) and (d) are correct
D.(b) and (c) and (d) are correct 54 A weak en琀椀ty B.does not have enough key
A.does not depend on other en琀椀琀椀es a琀琀ribute(s)
B.does not have enough key a琀琀ribute(s)
C.is an en琀椀ty that has not any key-a琀琀ribute D.None of the others 55
Here are three rela琀椀ons, R(A,B), S(C,D), and T(E,F). Their B.(1,1,2,2) current values are: R A B ------------------- 0 1 1 0 1 1 S C D ------------------- 0 1 1 0 1 1 T E F ------------------- 0 1 1 0 1 1
Compute the result of the query: SELECT A, F, SUM(C), SUM(D) FROM R, S, T WHERE B = C AND D = E GROUP BY A, F HAVING COUNT(*) > 1
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
Iden琀椀fy, in the list below, the row that appears in the result. A.(1,1,2,1) B.(1,1,2,2) C.(1,1,1,1) D.None of the others 56 Choose the correct statement A.Except for COUNT, aggregate
A.Except for COUNT, aggregate func琀椀ons ignore null values
func琀椀ons ignore null values
B.Except for SUM, aggregate func琀椀ons ignore null values
C.Except for AVG, aggregate func琀椀ons ignore null values
D.Except for MIN, aggregate func琀椀ons ignore null values
E.Except for MAX, aggregate func琀椀ons ignore null values 57
What is the di昀昀erence between Where and Having
A.WHERE is for Rows and HAVING Clause? is for Groups
A.WHERE is for Rows and HAVING is for Groups
B.WHERE is for Groups and HAVING is for Rows
C.WHERE and HAVING are the same
D.We can use aggrega琀椀on func琀椀ons in WHERE clause 58
Suppose rela琀椀on R(a,b,c) has the following tuples: C.(2,3) A B C
----------------------------------- 1 1 3 1 2 3 2 1 4 2 3 5 2 4 1 3 2 4 3 3 6
Which tuple is contained in the result of the following query:
SELECT a, COUNT(DISTINCT B) FROM R GROUP BY a HAVING SUM(B) >3; A.(2,10) B.(3,7) C.(2,3) D.(3,12)
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 59
What does the following SQL statement do:
C.Selects all customers from table SELECT Customer, COUNT(Order)
Sales that have made more than 5 FROM Sales orders. GROUP BY Customer HAVING COUNT(Order) > 5
A.Selects the total number of orders from the Sales table,
if this number is greater than 5
B.Selects all Customers from the Sales table
C.Selects all customers from table Sales that have made more than 5 orders. D.None of the other three 60
The rela琀椀on R(A,B) may have duplicate tuples. Choose the B.SELECT A, B FROM R GROUP BY
query that create non-duplicated results, regardless of A, B what tuples R contains? A.SELECT A, B FROM R
B.SELECT A, B FROM R GROUP BY A, B
C.SELECT A FROM R WHERE A NOT IN (SELECT B FROM R) D.SELECT TOP 3 A, B FROM R 61
The table R(X,Y) currently has the following tuples (note a. There is an error a
there are duplicates).The rela琀椀on S(A,B,C) has the following tuples: (See picture)
Which is the result when we execute the following query: SELECT * FROM R UNION SELECT * FROM S [昀椀le:8524.jpg] a. There is an error a b. The output has 15 rows c. The output has 16 rows d. The output has 17 rows 62
QN=18 (8537) What is a "join"?
a. 'join' used to connect two or
a. 'join' used to connect two or more tables logically with
more tables logically with or
or without common 昀椀eld(s) a
without common 昀椀eld(s) a
b. 'join' used to connect two or more tables logically with common 昀椀eld(s)
c. 'join' used to connect two or more tables logically
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 without common 昀椀eld(s)
d. 'join' used to connect two or more tables logically with aliases 63
When join R and S, we want to display all the records in R a. LEFT OUTER JOIN a we must use: a. LEFT OUTER JOIN a b. RIGHT OUTER JOIN c. INNER JOIN d. None of the others 64
Given rela琀椀ons R(A,B) and S(B,C,D). The result of natural c. A琀琀ributes A, B, C, D
join of the rela琀椀ons R and S has a. Only a琀琀ribute B
b. Only two a琀琀ributes R.B and S.B c. A琀琀ributes A, B, C, D d. None of the others 65
Rela琀椀on R(x,y) currently consists of only one tuple (NULL, a. SELECT * FROM R WHERE x IS
NULL). Which of the following queries will produce a NULL
nonempty output? That is, at least one tuple will be
produced, although the tuple(s) may have NULL's.
a. SELECT * FROM R WHERE x IS NULL
b. SELECT * FROM R WHERE x = NULL c. SELECT * FROM R WHERE x = y
d. SELECT * FROM R WHERE x <> 10 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com) lOMoARcPSD|35919223
Downloaded by V?n Lê Ti?n (vanlehcp1152001@gmail.com)