Syntax - Mabel Flashcards

1
Q

Name some common character encodings

A

ASCII
ISO Latin 1
(a.k.a. ISO-8859-1)
UTF-8
UTF-16

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

What constraints are dropped when we denormalise data?

A
  • Relational integrity - identical support
  • Atomic integrity/first normal form - flat rows (atomic integrity, which is also the first normal form),
  • Domain integrity - homogeneous data types within a column
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give examples of structured, semi-structured and unstructured data

A
  • Structured - Relational Tables
  • Semi-Structured - XML/JSON
  • Unstructured - Text
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the concept of well-formedness using an example

A

A well-formed XML, it means that it can be successfully opened by an editor as XML, and recognised as being that language

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

Which 6 building blocks make up JSON?

A
  • String: Delimited with , backslash escaping syntax is supported. Unicode characters are represented by \u and the unicode code point.
  • Number: There are no size limits, numbers can be written as floating point numbers, integers and in scientific notation, e.g. -1.23E+5.
  • Boolean: true and false
  • Null: null
  • Array: An ordered list of zero or more values that can be any type, denoted by square brackets with comma-separated elements
  • Object: A collection of name-value pairs where the names (keys) are strings, denoted by cury braces. Trailing commas are not allowed as well, duplicate keys should not be used.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Is a leading + allowed for numbers in JSON?

A

a leading + is not allowed. Also, a leading 0 is not allowed except if the integer part is exactly 0 (in which case it is even mandatory, i.e., .23 is not a well-formed JSON number literal)

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

Is [] a valid array in JSON?

A

Yes

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

What types can JSON keys be?

A

Only strings

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

Is {} a valid object in JSON?

A

Yes

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

Must keys be unique within an object?

A

Technically no
The JSON standard recommends for keys to be unique within an object, as some parsers may reject this

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

What does an XML element look like?

A

In XML, an element consists of an opening tag and a closing tag and contains potentially more XML: < foo>[more XML]< / foo>

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

How can empty XML elements be shortened?

A

< bar/> can be used which is equivalent to < bar>< /bar>

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

Attributes

A

Attributes are key value pairs, duplicate keys are not allowed. The quotes are always needed, but single and double quotes can be used: < a attr=”value”/>

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