Chapter 5 - Market Segmenting, Targeting, and Positioning Flashcards

1
Q

What is the basic syntax of a block?

A

DECLARE

BEGIN

EXCEPTION

END

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are ‘Anonymous Blocks’?

A

When you click the run button you get ‘compile runs’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are ‘Named Block’?

A

When you click the run button you get ‘compiles’

P code is generated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How would you declare a variable v_foo and assign it the value of 7?

A

v_foo NUMBER := 7;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you assign the count of teachers in the COSC department from the teachers table?

A

SELECT COUNT(dept)
INTO v_count
FROM teachers
WHERE dept = ‘COSC’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Write this as a PL/SQL

If(grade>90) {
System.out.println(“A”);

} else if (grade>80) {
System.out.println(“B”);

} else {
System.out.println(“Fail”);

}

A

IF v_grade > 90 THEN
dbms_output.put_line(‘A’);

ELSIF v_grade > 80 THEN
dbms_output.put_line(‘B’);

ELSE
dbmd_output.put_line(‘Fail’);

END IF;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Write this as a PL/SQL

while (i < 5) {
System.out.println(i);
i++;
}

A

WHILE i < 5 LOOP
dbms_output.put_line(i);
i := i + 1;
END LOOP;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Declare variable v_name to be the same variable type as name from the WEEK4_Employees table

A

v_name WEEK4_Employees.name%TYPE;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Print out “Hello World”

Include line needed to print lines

A

SET SERVEROUTPUT ON;

dbms_output.put_line(‘Hello World’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly