0% found this document useful (0 votes)
127 views

SQL Answers

1. NULL in SQL represents a missing or unknown value. A primary key is a column whose values uniquely identify each row in a table. 2. The SELECT statement can contain duplicate rows. SELECT is used to select columns from a table. 3. The WHERE clause is used to filter rows by specifying conditions that a column must meet.

Uploaded by

Sarban Mihai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views

SQL Answers

1. NULL in SQL represents a missing or unknown value. A primary key is a column whose values uniquely identify each row in a table. 2. The SELECT statement can contain duplicate rows. SELECT is used to select columns from a table. 3. The WHERE clause is used to filter rows by specifying conditions that a column must meet.

Uploaded by

Sarban Mihai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SQL test

1 The NULL SQL keyword is used to ...


a represent a missing or unknown value. NULL in SQL represents nothing.
b represent the numeric value 0.
c represent an empty string !"#.
$ %hat is a primary key&
a ' column or combination o( columns whose values uni)uely identi(y each row in a table.
b ' column or combination o( columns whose values can be non*uni)ue.
c ' column that can have NULL values.
+ The result o( a S,L,-T statement can contain duplicate rows.
a True
b .alse
/ 0ow do you select a column named 1.irstName1 (rom a table named 12ersons1&
a ,3T4'-T .irstName .456 2ersons
b S,L,-T .irstName .456 2ersons
c S,L,-T 2ersons..irstName
7 0ow do you select all the records (rom a table named 12ersons1 where the value o( the column
1.irstName1 is 12eter1&
a S,L,-T 8all9 .456 2ersons %0,4, .irstName:;2eter;
b S,L,-T < .456 2ersons %0,4, .irstName L=>, ;2eter;
c S,L,-T 8all9 .456 2ersons %0,4, .irstName L=>, ;2eter;
d S,L,-T < .456 2ersons %0,4, .irstName:;2eter;
? 0ow do you select all the records (rom a table named 12ersons1 where the value o( the column
1.irstName1 starts with an 1a1&
a S,L,-T < .456 2ersons %0,4, .irstName:;@a@;
b S,L,-T < .456 2ersons %0,4, .irstName L=>, ;@a;
c S,L,-T < .456 2ersons %0,4, .irstName:;a;
d S,L,-T < .456 2ersons %0,4, .irstName L=>, ;a@;
A 0ow do you select all the records (rom a table named 12ersons1 where the 1.irstName1 is 12eter1 and
the 1LastName1 is 1Backson1&
a S,L,-T < .456 2ersons %0,4, .irstName L=>, ;2eter; 'NC LastName L=>, ;Backson;
b S,L,-T < .456 2ersons %0,4, .irstName:;2eter; 'NC LastName:;Backson;
c S,L,-T .irstName:;2eter;D LastName:;Backson; .456 2ersons
E 0ow do you select all the records (rom a table named 12ersons1 where the 1LastName1 is
alphabetically between and including# 10ansen1 and 12ettersen1&
a S,L,-T LastNameF;0ansen; 'NC LastNameG;2ettersen; .456 2ersons
b S,L,-T < .456 2ersons %0,4, LastName H,T%,,N ;0ansen; 'NC ;2ettersen;
c S,L,-T < .456 2ersons %0,4, LastNameF;0ansen; 'NC LastNameG;2ettersen;
I %hich SQL statement is used to return only di((erent values&
a S,L,-T UN=QU,
b S,L,-T =NC,NT=TJ
c S,L,-T C=..,4,NT
d S,L,-T C=ST=N-T
10 0ow can you return all the records (rom a table 12ersons1 sorted descending by 1.irstName1&
a S,L,-T < .456 2ersons S54T HJ ;.irstName; C,S-
b S,L,-T < .456 2ersons 54C,4 HJ .irstName C,S-
c S,L,-T < .456 2ersons 54C,4 .irstName C,S-
d S,L,-T < .456 2ersons S54T ;.irstName; C,S-
11 0ow can you insert a new record into the 12ersons1 table&
a =NS,4T =NT5 2ersons K'LU,S ;Bimmy;D ;Backson;#
b =NS,4T ;Bimmy;D ;Backson;# =NT5 2ersons
c =NS,4T K'LU,S ;Bimmy;D ;Backson;# =NT5 2ersons
1$ 0ow can you insert 15lsen1 as the 1LastName1 in the 12ersons1 table&
a =NS,4T =NT5 2ersons LastName# K'LU,S ;5lsen;#
b =NS,4T ;5lsen;# =NT5 2ersons LastName#
c =NS,4T =NT5 2ersons ;5lsen;# =NT5 LastName
1+ 0ow can you change 10ansen1 into 1Nilsen1 in the 1LastName1 column in the 2ersons table&
a U2C'T, 2ersons S,T LastName:;0ansen; =NT5 LastName:;Nilsen;
b U2C'T, 2ersons S,T LastName:;Nilsen; %0,4, LastName:;0ansen;
c 65C=.J 2ersons S,T LastName:;0ansen; =NT5 LastName:;Nilsen
d 65C=.J 2ersons S,T LastName:;Nilsen; %0,4, LastName:;0ansen;
1/ 0ow can you delete the records where the 1.irstName1 is 12eter1 in the 2ersons Table&
a C,L,T, .456 2ersons %0,4, .irstName : ;2eter;
b C,L,T, 45% .irstName:;2eter; .456 2ersons
c C,L,T, .irstName:;2eter; .456 2ersons
17 %hich o( the (ollowing is true&
a T4UN-'T, T'HL, has to be used along with a %0,4, clause
b T4UN-'T, T'HL, deletes table (rom a database
c T4UN-'T, T'HL, is identical to C,L,T, statement without %0,4, clause.
1? %ith SQLD how can you return the number o( records in the 12ersons1 table&
a S,L,-T -5LU6NS# .456 2ersons
b S,L,-T -5UNT<# .456 2ersons
c S,L,-T -5LU6NS<# .456 2ersons
d S,L,-T -5UNT# .456 2ersons
1A -an you use the U2C'T, and S,L,-T clauses in one SQL statement&
a Jou canLt.
b Jou can i( you use nested SQL statements.
c Jou can use both clauses togetherD even i( you donLt have nested SQL statements.
1E The L=>, SQL keyword is used along with ...
a 54C,4 HJ clause.
b B5=N clause.
c M45U2 HJ clause.
d %0,4, clause.
1I %hich o( the (ollowing SQL clauses is used to select data (rom $ or more tables&
a B5=N
b %0,4,
c 0'K=NM
$0 %hich o( the (ollowing is the correct SQL statement to use to remove rows (rom a table&
a C452
b 4,65K, 45%
c C,L,T,
d C,L,T, 45%

You might also like