1/19
Looks like no tags are added yet.
What are limitations of pure relational databases?
limited support for real word data entities
limited installed/base types & complex type support (no complex structure: array/lists/queues, no generalisation/specialisation)
operations are set & tuple-based
only predefined operators & functions for base type
mismatch w/ other software/programming lang.(basic SQL lacks computational completeness)
no general purpose rule system
What is a collection type array?
attributes of type ARRAY allow column to store multi-valued data
columns can be defined as 1/multi dimensional arrays
arrays can be fixed/variable length
breaks relational model (which requires single valued data)
a query can access the entire array/individual elements using array indices

What are binary large objects (BLOBs) used for?
used to store large values + binary data
e.g. image,PDF,large text files
e.g. storing image in Postgres
link into file system/web
binary data type: bytea
Postgres Large Objects lo_import() and lo_export() functions can be used to read/write large objects
What is a more efficient way to use images only for visualisation rather than storing it in a database?
consider using links to external file system
danger of external data being deleted/moved
In inheritance what do child tables inherit?
all the attributes & constraints of its parent table(s)
(may have own attributes)

How would you query the parent class & child classes?
SELECT * FROM parent_table;

How would you query only the child table?
SELECT * FROM child_table;

How would you query only parent table (no child table data)?
SELECT * FROM ONLY parent_table;

How are user defined functions (UDFs) created in PostgreSQL?
CREATE FUNCTION func_name
Where are user defined function stored?
stored as database objects
often called server side functions
When are user defined functions useful?
if used repeatedly
when doing computation close to the data
What are event-condition-action (ECA) rules?
rules/triggers that enable actions to be triggered automatically by certain events in an active database systems
What is the general form of event-condition-action (ECA) rules?
when event takes place
e.g insert/update/delete value
and if optinal condition is met
then specfied action is performed

How are rules created in PostgreSQL?

When may the action be performed when executing an ECA rule?
before, after or instead of the initiating event
What is a trigger used for?
inititates a trigger function to be automatically executed whenever a certain type of operation is performed in a database
What are triggers useful for?
non-trivial constraints
consistency checking/enforcement
What type of procedures are trigger functions?
server side procedures ( can be written in languages such as C or PL/PgSQL or SQL)
How do you create a trigger in PostgreSQL?
CREATE TRIGGER trigger_name

What are desirable properties of an ECA rule system?
lack of conflicts
conflicts possible when more than 1 rule fires
guarenteed termination
cycles, nesting/recursion
confluence
when more than 1 rule fires, order may be significant
rule confluent if outcome indpendent of order
observable determinism
results from confluence, otherwise must be ensured