Term Glossary (Topic 1.3) Flashcards

1
Q

Explain ‘Sequence Programming’ when referring to programming

A

The computer runs code in the order it is written.

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

Explain ‘Selection’ when referring to programming

A

The computer runs different pieces of code according to a condition being met (normally achieved using IF, CASE or SWITCH statements (depending on the programming language you are using))

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

Explain what the ‘CASE’ function achieves in SQL

A

Used to conditionally fill columns (used with WHEN and THEN).

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

Explain what the ‘DATETIME’ function achieves in SQL

A

A datatype used to store date and time data in standard format.

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

Explain what the ‘CAST’ function achieves in SQL

A

Similar to CONVERT – Changes the data type of a value. This is an example of EXPLICIT data type conversion.

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

Name the six types of JOINS in SQL

A

1) Inner
2) Outer
3) Left
4) Right
5) Anti
6) Cross

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

Describe an Inner Join

A

Tables A and B joined with matching rows (according to their key fields). Only rows with key values present in both tables are shown.

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

Describe an Outer Join

A

Tables A and B joined with matching rows (according to their key fields). Rows with key values present in either one of or both tables are shown.

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

Describe a Left Join

A

Tables A and B joined with matching rows (according to their key fields). Rows with key values present in the Left table are shown with any matching rows from the right table.

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

Describe a Right Join

A

Tables A and B joined with matching rows (according to their key fields). Rows with key values present in the Right table are shown with any matching rows from the left table.

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

Describe an Anti Join

A

Rows are shown that are present (according to a key value) in one table but not in another. In SQL, there is no ‘ANTI’ statement for this join. Instead you must perform a standard join and filter the resulting table using ISNULL.

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

Describe a Cross Join

A

All combinations of key values from both tables are shown, regardless of whether those combinations occurred in the database.

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

What will occur if a Join is performed on tables with duplicate rows

A

If there are duplicate values, a join will replicate them in the resulting table – providing these values match with the other table.

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

How would a Join need to be adjusted if the tables have multiple fields?

A

You can join tables using more than one key field with the ON statement.

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

State the four types of ‘Unions’ in SQL

A

1) Union
2) Union All
3) Except
4) Intercept

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

Describe ‘TABA UNION TABB’ in SQL

A

Merge tables and remove duplicate rows.

17
Q

Describe ‘TABA UNION ALL TABB’ in SQL

A

Merge tables and include duplicates.

18
Q

Describe ‘TABA INTERCEPT TABB’ in SQL

A

Merge tables and only include rows that match from both tables.

19
Q

Describe ‘TABA EXCEPT TABB’ in SQL

A

Merge tables include rows present in TableA but not present in TableB.

20
Q

Describe ‘SELECT INTO’ in SQL

A

Take columns from a query and add them to a new table. The INTO statement would be used: (SELECT cols INTO Tab2 FROM Tab1 WHERE conditions).

21
Q

Describe ‘Implicit Data Conversion’

A

Where the computer changes the data type without you telling it to do so. Often, this is done to allow a calculation to be completed correctly.

22
Q

Describe ‘Explicit Data Conversion’

A

This is where you tell the computer explicitly to change data format (using functions such as CAST and CONVERT).

23
Q

Define ‘Iteration’ when referring to programming

A

The computer runs the code repeatedly while a condition is met (this is done using FOR or WHILE loops).

24
Q

What does “ += “ achieve in relation to compound expressions?

A

Add to original value

25
Q

What does “ -= “ achieve in relation to compound expressions?

A

Subtract from original value

26
Q

What does “ *= “ achieve in relation to compound expressions?

A

Multiple original value by some amount

27
Q

What does “ /= “ achieve in relation to compound expressions?

A

Divide original value by some amount

28
Q

What does “ %= “ achieve in relation to compound expressions?

A

Replace original value with division remainder