Explain how LINESIZE, PAGESIZE, and FEEDBACK affect the output of your script
LINESIZE - command determines the total number of characters SQL *Plus displays in on line before beginning a new line.
PAGESIZE - default is 14; when you use the default, you repeat the heading every 14 rows.
FEEDBACK - command returns the number of records returned by a query.
Explain how Substitution Variables are used when writing scripts.
When you want to run the same script repeatedly, but want to be able to change a variable you would use a substitution variable. During the execution of the script the user will be prompted to input the variable to use.
Explain how the SPOOL command is used and what program it can be used in.
The SPOOL command, together with a file name, spools any subsequently issued SQL Plus or SQL command to a file. Just as with other file names, you can add a path to store the file in a directory other than your SQL Plus default directory. SQL Developer does not allow for spooling.
Explain the steps needed to run a script in SQL Developer
Load the file into the SQL Statement Box, by opening the location the file is stored and inserting it into the statement Box. Next you can press the F5 key.
Explain what a static data dictionary view is and how it is used
The static data dictionary stores details about database objects, such as tables, indexes, and views. Whenever a new object is added or an object is changed, data about the object is recorded in the data dictionary.
Explain what is found in the All Objects report folder in SQL Developer
Lists all objects accessible for the chosen database connection. Also lists a helpful dependencies report for accessing change impact.
_________ and __________ functions are opposites of each other and provide a value in a group of rows.
Both MIN and MAX
___________ subqueries allow you to reference columns from the outer query and execute the inner query repeatedly
A _____ is a query definition stored in the database that looks just like a table, but does not have any physical rows
All SQL statements contained within a script must end with a semicolon or forward slash, even if they are done in SQL Developer.
An outer join includes the result rows returned by an __________ plus extra rows where no matches are found.
Another name for a data dictionary view is __________________ or _________________.
static or dynamic
Explain Flashback queries and how they are used. Give an example of a FLASHBACK_TRANSACTION query and explain what it does row by row.
Orable's flashback query feature allows you to look at values of a query at a specific time in the past, such as before specfic DML statements occured. This can be usefull in case a suer accidentally performs an unintended but committed DML change. It can also be useful if you want to compare previous data to current data.
Explain how Dynamic SQL is used and give an example of a Dynamic SQL statement.
Dynamic SQL is used to be continuously updated by the background processes in the Oracle instance but never by the user.
Explain how Oracle treats locks when a database is being updated and needs to be viewed by other users.
When you issue a INSERT, UPDATE, DELETE, or MERGE statement, Oracle automatically locks the modified rows. The lock prevents other sessions from making changes to these rows. The lock is released when the session initiating change commits or rollsback.
Explain how you can optimize your queries with subqueries and the main advantage of doing so.
Subqueries allow you to nest multiple queries into each other. This gives you the ability to use one statement to break down a problem into individual components. Without nesting queries, you would be required to have multiple queries which could be time consuming and difficult to accomplish. With the ability to nest queries you can breakdown results to get the results you were needing in one statement.
Explain in detail the impact of INDEXES and how they are used by Oracle.
To achieve good performance for data retrieval and data manipulation statements Oracle uses indexes. In the same way you would use an index in the back of a book to quickly find information, Oracle uses indexes to speed up data retrieval. If the appropriate index does not exist on a table, Oracle needs to examine every row (called a full table scan), which can be time consuming.
Explain the differences in how an ANSI Full Outer Join and a Full Outer Join using the UNION Operator work
Explain why constraints are used when building tables.
Constraints are used to enforce the business rules of a system. For instance, "The salary of an employee may not be a negative number" may be enforced with a check constraint on the salary column. Constraints also ensure integrity and data consistency among all applications, no matter which program and ease the burden of programming the business rules in individual applications because the database enforces the constraint.
If a graphical representation of a table's box has __________ it means that the relationship is identifying.
If you are running a version of Oracle that is prior to 9i, it is best to use the ANSI Outer join.
Information that is returned after you run your statement are found in the __________ tab in SQL Developer.
Instead of using the Oracle Outer Join Operator or the ANSI syntax, you can achieve the same result with two SQL statements: ____________ and a ____________
Equijoin and correlated subquery
It is always good practice to include the old values in the WHERE clause of UPDATE to ensure that another session or user has not changed the name in the meantime.
Joins involving multiple columns must always follow the primary key/foreign key relationship path.
List the steps performed by a correlated subquery.
**** Select a row from the outer query, Determine the value of the correlated column, Execute the inner query for each record of the outer query., Feed the results of the inner query to the outer query and evaluate it. It if satisfies the criteria, return the row for output.Select the next record of the outer query and repeat steps 2 through 4 until all the records of the outer query are evaluated.
Match each of the SQL commands on the left with a verb from the list.
Control - Revoke
Define - TRUNCATE
Manipulate - MERGE
Queries that are found in parentheses are done first, just as in the order of operations when doing mathematical equations.
SQL Developer provides an extensive list of useful reports and offers the capability to create your own user-defined reports
SQL Developer's ____________________ option allows you to selectively export certain rows and columns.
The ____________ icon allows you to execute multiple statements and emulates SQL *Plus as much as possible.
The ____________ keywords and the USING clause of the ANSI join syntax are mutually exclusive.
The ________________ is a type of statement whereby you retrieve data that exists in one table, but not in another.
The Data tab in SQL Developer allows you to perform all the major DML commands, using the SQL *Plus interface.
The key that most database designers prefer and is chosen by the system is the _____________ key.
The lack of a unique index key is frequently the reason for slow performance of updates and deletions
The NEXTVAL and CURRVAL pseudocolumns can be used in which of the following SQL constructs? Select all that apply.
VALUES clause of an INSERT statement
The Nonequijoin can use the ________________ operator to construct joins that are not based on equality of values.
The query retrieves more than 5 to 15 percent of the rows
The indexed column is part of an expression. In this case, consider creating a function-based index instead
The self join is different from other joins because it does not utilize a primary key or a foreign key.
The term ____________ ___________ is used to express a join that satisfies the join condition.
The using clause of the ANSI join syntax always assumes an equijoin and identical column names.
To place a line comment in your SQL statements, you first place a // at the beginning of the line.
To revert back to a state that happened before you ran your change statement, you issue a ____________ command.
What are the main components of a ROWID?
The main components of a ROWID are the data object number, the number of the data block, the numbers of rows within the data block, and the data file number.
What is the command you would type into SQL*Plus if you needed to know the definition for each column of a table?
What is the main difference between the NOT EXISTS and the NOT IN operators?
The way NULL values are treated
What is the name of the view where you can find the collection of static and data dictionary tables and views, along with their descriptions?
What is the Oracle data dictionary called that contains a set of tables and views containing the data about the database?
When disabling a unique or primary key, you can keep the index if you specify the __________________ clause in the ALTER TABLE statement.
When is it not a good idea to use an index?
When the table is small (unless your business rules require you too)
When returning multiple rows, a subquery must contain the _____, _____, _____, or ______ operator, otherwise Oracle will return an error
IN ANY ALL SOME
When using the following data: NUMBER(10,4) - the lowest number you can possibly have is __________.
When writing an ANSI outer join, the keywords _________ OUTER and _________ OUTER are added to the __________ keyword to indicate the rows from which table to use.
RIGHT LEFT JOIN
When writing the syntax for finding information on three or more tables, the parenthesis around the ON clause is optional.
When you create a report in SQL Developer all the column names must match identically the names of the columns found in the tables you are referencing.
When you have issued a DELETE command, you can still retrieve those rows and restore the information.
When you INSERT new information into a table, it is followed with a _______ keyword that contains the information that is going to be added to the table.
When you want to run a script in either SQL*Plus or SQL Developer, you can use a ______ or the _________ command.
@ or START
Write an SQL statement for SQL *Plus in which you want any unique menu items to be displayed from the restaurant table
SELECT DISTINCT menu
Write the syntax to rename index just_two_more_weeks_i to finally_i
RENAME just_two_more_weeks TO finally_i
You can simplify the writing of SQL statements by writing SQL _________ that generate and execute other SQL statements.