Week 10/11 Flashcards
Physical vs Logical objects
Do physical objects grow in size/occupy disk space? How about logical objects? What are some examples of both?
Physical objects occupy diskspace and grow in size. Think tables, indexes, materialized views
Logical objects do not occupy disk space and do not grow in size. Think views, sequences, synonyms, procedures, functions, triggers.
How do indexes optimize the retrieval process?
They speed up select statements
Every primary key and unique key column constraint automatically has an
index
How can users create an index?
CREATE INDEX
What is the drawback of Indexes?
They slow down DML in order to maintain the index (Insert something, Index must be updated)
What are sequence generated values generally used for?
Primary key values in tables
Are sequences linked to tables?
No, but it’s good practice to create a dedicated sequence for a tables column
What sort of pseudo columns do sequences use to return values?
<sequenceName>.currvalue and <sequenceName>.nextval
</sequenceName></sequenceName>
What are synonyms used for?
To shorten complex table/view names. They do not replace the name.
PL/SQL can do programming other than DB programming
False, it’s restricted
PL/SQL can have any number of statements, which reduces network traffic. This means that DB operations can be sent to the server in one large unit, rather than many separate statements
True. This minimizes network traffic.
T/F – With PL/SQL, the program must reside at the front end
False, it can reside on the front end or within the Oracle DB server as a stored subprogram
What sort of PL/SQL subprograms can be stored in the database?
Procedures, Functions, Triggers, Packages
PL/SQL Sub-programs can be
Anonymous Blocks or Named Sub Programs
What do stored sub programs do?
They promote reusability, better performance, programmability