Syntax - Mabel Flashcards
Name some common character encodings
ASCII
ISO Latin 1
(a.k.a. ISO-8859-1)
UTF-8
UTF-16
What constraints are dropped when we denormalise data?
- 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
Give examples of structured, semi-structured and unstructured data
- Structured - Relational Tables
- Semi-Structured - XML/JSON
- Unstructured - Text
Explain the concept of well-formedness using an example
A well-formed XML, it means that it can be successfully opened by an editor as XML, and recognised as being that language
Which 6 building blocks make up JSON?
- 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.
Is a leading + allowed for numbers in JSON?
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)
Is [] a valid array in JSON?
Yes
What types can JSON keys be?
Only strings
Is {} a valid object in JSON?
Yes
Must keys be unique within an object?
Technically no
The JSON standard recommends for keys to be unique within an object, as some parsers may reject this
What does an XML element look like?
In XML, an element consists of an opening tag and a closing tag and contains potentially more XML: < foo>[more XML]< / foo>
How can empty XML elements be shortened?
< bar/> can be used which is equivalent to < bar>< /bar>
Attributes
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”/>