Database Programming and Linux Scripting

Covers Java JDBC, PL/SQL stored procedures, database triggers, and Linux shell scripting fundamentals

20 Questions Published

Questions

Question 1 True/False

vi is the only text editor available in linux?

  1. True
  2. False
Question 2 True/False

It is possible to redirect the output of a process to more than one source

  1. True
  2. False
Question 3 True/False

tar can be used to write on to floppy disks

  1. True
  2. False
Question 4 True/False

if statement needs to end with end if

  1. True
  2. False
Question 5 True/False

du command displays the file system usage for the entire file system

  1. True
  2. False
Question 6 True/False

Normal users can kill init process

  1. True
  2. False
Question 7 True/False

top command can be used to control processes

  1. True
  2. False
Question 8 True/False

Shell functions are self-contained and cannot be accessed from outside the function

  1. True
  2. False
Question 9 Multiple Choice (Multiple Answers)

Under which two circumstances do you design database triggers? (Choose two)

  1. a) To duplicate the functionality of other triggers.
  2. b) To replicate built-in constraints in the Oracle server such as primary key and foreign key.
  3. c) To guarantee that when a specific operation is performed, related actions are performed.
  4. d) For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement.
Question 10 Multiple Choice (Multiple Answers)

Which two statements are true? (Choose two)

  1. a) A function must return a value.
  2. b) A procedure must return a value.
  3. c) A function executes a PL/SQL statement.
  4. d) A function is invoked as part of an expression.
  5. e) A procedure must have a return data type specify in its declaration.
Question 11 Multiple Choice (Multiple Answers)

All users currently have the INSERT privileges on the PLAYER table. You want only your users to insert into this table using the ADD_PLAYER procedure. Which two actions must you take? (Choose two)

  1. a) GRANT SELECT ON ADD_PLAYER TO PUBLIC;
  2. b) GRANT EXECUTE ON ADD_PLAYER TO PUBLIC;
  3. c) GRANT INSERT ON PLAYER TO PUBLIC;
  4. d) GRANT EXECUTE, INSERT ON ADD_PLAYER TO PUBLIC;
  5. e) REVOKE INSERT ON PLAYER FROM PUBLIC;
Question 12 Multiple Choice (Multiple Answers)

Which two statements about the overloading feature of packages are true? (Choose two)

  1. a) Only local or packaged sub programs can be overloaded.
  2. b) Overloading allows different functions with the same name that differ only in their return types.
  3. c) Overloading allows different subprograms with the same number, type and order of the parameter.
  4. d) Overloading allows different subprograms with the same name and same number or type of the parameters.
  5. e) Overloading allows different subprograms with the same name but different in either number or type or order of parameter.
Question 13 Multiple Choice (Multiple Answers)

Which two statements about packages are true?

  1. a) Packages can be nested.
  2. b) You can pass parameters to packages.
  3. c) A package is loaded into memory each time it is invoked.
  4. d) The contents of packages can be shared by many applications.
  5. e) You can achieve information hiding by making package constructs private.
Question 14 Multiple Choice (Multiple Answers)

Which two program declarations are correct for a stored program unit? (Choose two)

  1. a) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER
  2. b) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER) RETURN NUMBER
  3. c) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER)
  4. d) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER(10,2)
  5. e) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER(10, 2))
Question 15 Multiple Choice (Multiple Answers)

Examine this procedure: CREATE OR REPLACE PROCEDURE UPD_BAT_STAT (V_ID IN NUMBER DEFAULT 10, V_AB IN NUMBER DEFAULT 4) IS BEGIN UPDATE PLAYER_BAT_STAT SET AT_BATS = AT_BATS + V_AB WHERE PLAYER_ID = V_ID; COMMIT; END; Which two statements will successfully invoke this procedure in SQL *Plus? (Choose two)

  1. a) EXECUTE UPD_BAT_STAT;
  2. b) EXECUTE UPD_BAT_STAT(V_AB=>10, V_ID=>31);
  3. c) EXECUTE UPD_BAT_STAT(31, 'FOUR', 'TWO');
  4. d) UPD_BAT_STAT(V_AB=>10, V_ID=>31);
  5. e) RUN UPD_BAT_STAT;
Question 16 Multiple Choice (Multiple Answers)

Which three are true regarding error propagation? (Choose three)

  1. a) An exception cannot propagate across remote procedure calls.
  2. b) An exception raised inside a declaration immediately propagates to the current block.
  3. c) The use of the RAISE; statement in an exception handler reprises the current exception
  4. d) An exception raised inside an exception handler immediately propagates to the enclosing block.
Question 17 Multiple Choice (Multiple Answers)

Which statements about JDBC are true? (2 answers)

  1. [_] [a] JDBC is an API to connect to relational-, object- and XML data sources
  2. [_] [b] JDBC stands for Java DataBase Connectivity
  3. [_] [c] JDBC is an API to access relational databases, spreadsheets and flat files
  4. [_] [d] JDBC is an API to bridge the object-relational mismatch between OO programs and relational
Question 18 Multiple Choice (Multiple Answers)

Which packages contain the JDBC classes?

  1. O (a) java.jdbc and javax.jdbc
  2. O (b) java.jdbc and java.jdbc.sql
  3. O (c) java.sql and javax.sql
  4. O (d) java.rdb and javax.rdb
Question 19 Multiple Choice (Multiple Answers)

Which type of driver provides JDBC access via one or more ODBC drivers?

  1. O (a) Type 1 driver
  2. O (b) Type 2 driver
  3. O (c) Type 3 driver
  4. O (d) Type 4 driver
Question 20 Multiple Choice (Multiple Answers)

Which type of driver converts JDBC calls into the network protocol used by the database management system directly?

  1. O (a) Type 1 driver
  2. O (b) Type 2 driver
  3. O (c) Type 3 driver
  4. O (d) Type 4 driver