SQL and PL/SQL Fundamentals
Test your knowledge of SQL functions, PL/SQL programming, stored procedures, triggers, transactions, and Oracle database features
Questions
What part of a databse trigger determine the number of times the trigger body excutes?
- Trigger type
- Trigger body
- Trigger event
- Trigger timing
If the below block, when you execute then what will be the output? Begin Null; Exception When others then Dbms_output.put_line(‘ I am in Others Exception’); When no_data_found then Dbms_output.put_line(‘ I am in no data found Exception’); End;
- I am in Others Exception
- I am in no data found Exception
- Compilation Error
- None of the above
What are the different methods for passing parameters to Procedure?
- Positional & Named
- Positional alone
- Positional ,Name and Combination
- None of the above
How can you find within a PL/SQL block, if a cursor is open?
- %OPEN
- %ISOPEN
- 1 & 2
- None of the above
What is the use of %ROWTYPE in PL/SQL?
- %ROWTYPE allows you to associate a variable with an entire table row
- %ROWTYPE associates a variable with a single column type
- Both of the above
- None of the above
I have just now created sequence abc and If you immediately run the below select statement , what is the output? CREATE SEQUENCE abc MINVALUE 1 MAXVALUE 10 START WITH 1 INCREMENT BY 1 CACHE 20 Select abc.currval from dual;
- 1
- Null
- Error
- None of the above
What is the maximum number of columns in table or view in Oracle?
- 900
- 1000
- 1100
- 1050
What are the Sql Cursor Attributes in Pl/sql?
- SQL%ROWCOUNT, SQL%ISFOUND,SQL%NOTFOUND,SQL%ISOPEN
- SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%OPEN
- SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%ISOPEN
- All of the above
Raw types are used to store _________ data.
- binary
- Character
- ASCII
- All of the above
SQL has facility for programmed handling of errors that arise during the manipulation of data.
- True
- False
_________ data type stores unstructured binary data upto 4GB length.
- CLOB
- BLOB
- LONG
- All of the above
In a PL/SQL block structure, which parts are optional?
- DELCARE and BEGIN
- DECALRE and EXCEPTION
- EXCEPTION and END
- BEGIN and END
Under which two circumstances do you design database triggers? (Choose two)
- To duplicate the functionality of other triggers.
- To replicate built-in constraints in the Oracle server such as primary key and foreign key.
- To guarantee that when a specific operation is performed, related actions are performed.
- For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement.
Which of the following are not operators you can use in a math formula within a SQL statement?
- +
- (
- ]
- /
What is the proper syntax for assigning a column alias?
- SELECT column_name ALIAS alias_name FROM table_name;
- SELECT column_name alias_name FROM table_name;
- SELECT alias_name FROM table_name;
- ASSIGN alias_name TO column_name;
Which of the following are reasonable series of transaction-control commands?
- Insert some records, COMMIT, ROLLBACK
- SAVEPOINT, insert some records, ROLLBACK, ROLLBACK, COMMIT
- ROLLBACK, insert some records, COMMIT
- ROLLBACK, insert some records, COMMIT, COMMIT
Which of the following shows the wildcards for a single character and multiple characters, respectively?
- ?, *
- _, %
- ?, _
- *, %
Which statement below is true?
- ROUND(4.5, 0) < TRUNC(4.5, 0)
- ROUND(4.1, 0) < TRUNC(4.2, 0
- ROUND(8.9, 0) > TRUNC(8.9, 0)
- ROUND(8.9, 1) > TRUNC(8.95, 2)
A trigger is a special type of stored procedure that is executed by the SQL Server when an Insert, Modify or Delete operation is performed Against a given table.
- True
- False
Stored procedures are the way to create routines and procedures that are run on the server.
- True
- False