Showing posts with label Latest SQL Interview Questions. Show all posts
Showing posts with label Latest SQL Interview Questions. Show all posts

Monday, March 24, 2008

Unix SQL Data Mining Interview Questions asked latest

Unix sysadmin interview questions

1. How would you make the following SQL statement run faster? SELECT * FROM TABLEA WHERE COL1=’A’ AND COL2=’B';
A: Make sure that COL1 and COL2 have indexes.
Find out which condition will return less values and use that as the first conditonal.

2. What is Data Mining
A: Data Minig is the process of sifting through extremeley large amounts of Data to find trends or relevent information.

3. Name the Seven layers in the OSI Model.
A: Appication, Presentation, Session, Transport, Network, Data Link, Phyiscal

4. What is one way to view a unix network share on a Windows computer, within explorer
A: NFS, The Unix computer can be running a NFS Server Daemon.

5. How would you find all the processes running on your computer.
A: Unix, is ps -ef or ps -aux depending on version.

6. What is DHCP
A: DHCP is a way to dynamically assign IP address to computers. Dyanmic Host Configuration Protocol

7. What is HTTP Tunneling
A: HTTP Tunneling is a security method that encryptes packets traveling throught the internet. Only the intended reciepent should be able to decrypt the packets. Can be used to Create Virtual Private Networks. (VPN)

8. Scenario: You have 9 identical looking balls, however one ball is heavier than the others. You have two chances to use a balance. How do you find out which ball is the heaviest?
A: Split into groups of three, randomly choose two groups and use balance on them. If one group is heavier, then discard the other 6 balls. If the two groups are the same weight. The heavier ball must be in the group that was not on the scale. Now randomly choose two balls and test on balance. If they are the same weight, the heaviest ball is on one that was not tested. Else the heaviest ball is already known from the balance

Saturday, March 22, 2008

Oracle All Interview Questions and Answers

Free Latest and previous Oracle Interview Questions Resources:

Typical Oracle Questions - 7

Oracle PL, SQL, mysql interview questions - 6

Oracle Database Latest Interview Questions - 5

Oracle SQL Technical Interview Recent Questions - 4

Oracle DBA / DBMS post Interview Questions with Detailed Solutions - 3

Oracle Recent Database DBMS Interview 2008 Questions - 2

Oracle Interview Questions

Also See all Oracle All Recent and Previous Papers

Keep watching out for more Oracle Latest Interview Question Placement Papers for year 2007 and 2008 all months for leading companies infosys, wipro, ibm, microsoft, cisco, dell, ebay, sap, oracle, peoplesoft, hcl, quark, ramco, l.t, satyam computers, accenture, cognizant, T-Systems, IFlex, KPO, BPO companies, IT, ITES companies in India, uk, usa, us - phillipines, china, hungary Freshers Graduates Placement Jobs. See Previouspapers.blogspot.com

Typical Oracle Questions - 7

Typical Oracle questions

  1. Tell us about yourself, your background.

  2. What are the three major characteristics that you bring to this company?

  3. What version of Oracle were you running?

  4. How many databases did the organization have and what sizes?

  5. What motivates you to do a good job?

  6. What two or three things are most important to you at work?

  7. What qualities do you think are essential to be successful in this kind of work?

  8. What courses did you attend? What job certifications do you hold?

  9. What subjects/courses did you excel in? Why?

  10. What subjects/courses gave you trouble? Why?

  11. How does your previous work experience prepare you for this position?

  12. How do you define ’success’?

  13. What has been your most significant accomplishment to date?

  14. Describe a challenge you encountered and how you dealt with it.

  15. Describe a failure and how you dealt with it.

  16. Describe the ‘ideal’ job… the ‘ideal’ supervisor.

  17. What leadership roles have you held?

  18. What prejudices do you hold?

  19. What do you like to do in your spare time?

  20. What are your career goals (a) 3 years from now; (b) 10 years from now?

  21. How does this position match your career goals?

  22. What have you done in the past year to improve yourself?

  23. In what areas do you feel you need further education and training to be successful?

  24. What do you know about our company?

  25. Why do you want to work for this company. Why should we hire you?

  26. Where do you see yourself fitting in to this organization initially? How about in 5 years?

  27. Why are you looking for a new job?

  28. How do you feel about re-locating?

  29. Are you willing to travel?

  30. What are your salary requirements?

  31. When would you be available to start if you were selected?

  32. Did you use online or off-line backups?

  33. If you have to advise a backup strategy for a new application, how would you approach it and what questions will you ask?

  34. If a customer calls you about a hanging database session, what will you do to resolve it?

  35. Compare Oracle to any other database that you know. Why would you prefer to work on one and not on the other

Latest / Recent and Previous oracle interview questions with solutions and hr, tech interview topics and detailed explanation for your success in placement interview.. Good Luck! May u get placed in a reputed IT / ITES MNC. Keep watching out for more interview questions of different programming languages only on Previouspapers.blogspot.com

Oracle PL, SQL, mysql interview questions - 6

PL - SQL Questions

  1. Which of the following statements is true about implicit cursors?

    1. Implicit cursors are used for SQL statements that are not named.

    2. Developers should use implicit cursors with great care.

    3. Implicit cursors are used in cursor for loops to handle data processing.

    4. Implicit cursors are no longer a feature in Oracle.

  2. Which of the following is not a feature of a cursor FOR loop?

    1. Record type declaration.

    2. Opening and parsing of SQL statements.

    3. Fetches records from cursor.

    4. Requires exit condition to be defined.

  3. A developer would like to use referential datatype declaration on a variable. The variable name is EMPLOYEE_LASTNAME, and the corresponding table and column is EMPLOYEE, and LNAME, respectively. How would the developer define this variable using referential datatypes?

    1. Use employee.lname%type.

    2. Use employee.lname%rowtype.

    3. Look up datatype for EMPLOYEE column on LASTNAME table and use that.

    4. Declare it to be type LONG.

  4. Which three of the following are implicit cursor attributes?

    1. %found

    2. %too_many_rows

    3. %notfound

    4. %rowcount

    5. %rowtype

  5. If left out, which of the following would cause an infinite loop to occur in a simple loop?

    1. LOOP

    2. END LOOP

    3. IF-THEN

    4. EXIT

  6. Which line in the following statement will produce an error?

    1. cursor action_cursor is

    2. select name, rate, action

    3. into action_record

    4. from action_table;

    5. There are no errors in this statement.

  7. The command used to open a CURSOR FOR loop is

    1. open

    2. fetch

    3. parse

    4. None, cursor for loops handle cursor opening implicitly.

  8. What happens when rows are found using a FETCH statement

    1. It causes the cursor to close

    2. It causes the cursor to open

    3. It loads the current row values into variables

    4. It creates the variables to hold the current row values

  9. Read the following code:

    CREATE OR REPLACE PROCEDURE find_cpt
    (v_movie_id {Argument Mode} NUMBER, v_cost_per_ticket {argument mode} NUMBER)
    IS
    BEGIN
    IF v_cost_per_ticket > 8.5 THEN
    SELECT cost_per_ticket
    INTO v_cost_per_ticket
    FROM gross_receipt
    WHERE movie_id = v_movie_id;
    END IF;
    END;

    Which mode should be used for V_COST_PER_TICKET?

    1. IN

    2. OUT

    3. RETURN

    4. IN OUT

  10. Read the following code:

    CREATE OR REPLACE TRIGGER update_show_gross
    {trigger information}
    BEGIN
    {additional code}
    END;

    The trigger code should only execute when the column, COST_PER_TICKET, is greater than $3. Which trigger information will you add?

    1. WHEN (new.cost_per_ticket > 3.75)

    2. WHEN (:new.cost_per_ticket > 3.75

    3. WHERE (new.cost_per_ticket > 3.75)

    4. WHERE (:new.cost_per_ticket > 3.75)

  11. What is the maximum number of handlers processed before the PL/SQL block is exited when an exception occurs?

    1. Only one

    2. All that apply

    3. All referenced

    4. None

  12. For which trigger timing can you reference the NEW and OLD qualifiers?

    1. Statement and Row

    2. Statement only

    3. Row only

    4. Oracle Forms trigger

  13. Read the following code:

    CREATE OR REPLACE FUNCTION get_budget(v_studio_id IN NUMBER)
    RETURN number IS

    v_yearly_budget NUMBER;

    BEGIN
    SELECT yearly_budget
    INTO v_yearly_budget
    FROM studio
    WHERE id = v_studio_id;

    RETURN v_yearly_budget;
    END;

    Which set of statements will successfully invoke this function within SQL*Plus?

    1. VARIABLE g_yearly_budget NUMBER
      EXECUTE g_yearly_budget := GET_BUDGET(11);

    2. VARIABLE g_yearly_budget NUMBER
      EXECUTE :g_yearly_budget := GET_BUDGET(11);

    3. VARIABLE :g_yearly_budget NUMBER
      EXECUTE :g_yearly_budget := GET_BUDGET(11);

    4. VARIABLE g_yearly_budget NUMBER
      :g_yearly_budget := GET_BUDGET(11);

  14. CREATE OR REPLACE PROCEDURE update_theater
    (v_name IN VARCHAR v_theater_id IN NUMBER) IS
    BEGIN
    UPDATE theater
    SET name = v_name
    WHERE id = v_theater_id;
    END update_theater;

    When invoking this procedure, you encounter the error:

    ORA-000: Unique constraint(SCOTT.THEATER_NAME_UK) violated.

    How should you modify the function to handle this error?

    1. An user defined exception must be declared and associated with the error code and handled in the EXCEPTION section.

    2. Handle the error in EXCEPTION section by referencing the error code directly.

    3. Handle the error in the EXCEPTION section by referencing the UNIQUE_ERROR predefined exception.

    4. Check for success by checking the value of SQL%FOUND immediately after the UPDATE statement.

  15. Read the following code:

    CREATE OR REPLACE PROCEDURE calculate_budget IS
    v_budget studio.yearly_budget%TYPE;
    BEGIN
    v_budget := get_budget(11);
    IF v_budget <>

    You are about to add an argument to CALCULATE_BUDGET. What effect will this have?

    1. The GET_BUDGET function will be marked invalid and must be recompiled before the next execution.

    2. The SET_BUDGET function will be marked invalid and must be recompiled before the next execution.

    3. Only the CALCULATE_BUDGET procedure needs to be recompiled.

    4. All three procedures are marked invalid and must be recompiled.

  16. Which procedure can be used to create a customized error message?

    1. RAISE_ERROR

    2. SQLERRM

    3. RAISE_APPLICATION_ERROR

    4. RAISE_SERVER_ERROR

  17. The CHECK_THEATER trigger of the THEATER table has been disabled. Which command can you issue to enable this trigger?

    1. ALTER TRIGGER check_theater ENABLE;

    2. ENABLE TRIGGER check_theater;

    3. ALTER TABLE check_theater ENABLE check_theater;

    4. ENABLE check_theater;

  18. Examine this database trigger

    CREATE OR REPLACE TRIGGER prevent_gross_modification
    {additional trigger information}
    BEGIN
    IF TO_CHAR(sysdate, DY) = MON
    THEN
    RAISE_APPLICATION_ERROR(-20000,Gross receipts cannot be deleted on
     Monday);
    END IF;
    END;

    This trigger must fire before each DELETE of the GROSS_RECEIPT table. It should fire only once for the entire DELETE statement. What additional information must you add?

    1. BEFORE DELETE ON gross_receipt

    2. AFTER DELETE ON gross_receipt

    3. BEFORE (gross_receipt DELETE)

    4. FOR EACH ROW DELETED FROM gross_receipt

  19. Examine this function:

    CREATE OR REPLACE FUNCTION set_budget
    (v_studio_id IN NUMBER, v_new_budget IN NUMBER) IS
    BEGIN
    UPDATE studio
    SET yearly_budget = v_new_budget
    WHERE id = v_studio_id;

    IF SQL%FOUND THEN
    RETURN TRUEl;
    ELSE
    RETURN FALSE;
    END IF;

    COMMIT;
    END;

    Which code must be added to successfully compile this function?

    1. Add RETURN right before the IS keyword.

    2. Add RETURN number right before the IS keyword.

    3. Add RETURN boolean right after the IS keyword.

    4. Add RETURN boolean right before the IS keyword.

  20. Under which circumstance must you recompile the package body after recompiling the package specification?

    1. Altering the argument list of one of the package constructs

    2. Any change made to one of the package constructs

    3. Any SQL statement change made to one of the package constructs

    4. Removing a local variable from the DECLARE section of one of the package constructs

  21. Procedure and Functions are explicitly executed. This is different from a database trigger. When is a database trigger executed?

    1. When the transaction is committed

    2. During the data manipulation statement

    3. When an Oracle supplied package references the trigger

    4. During a data manipulation statement and when the transaction is committed

  22. Which Oracle supplied package can you use to output values and messages from database triggers, stored procedures and functions within SQL*Plus?

    1. DBMS_DISPLAY

    2. DBMS_OUTPUT

    3. DBMS_LIST

    4. DBMS_DESCRIBE

  23. What occurs if a procedure or function terminates with failure without being handled?

    1. Any DML statements issued by the construct are still pending and can be committed or rolled back.

    2. Any DML statements issued by the construct are committed

    3. Unless a GOTO statement is used to continue processing within the BEGIN section, the construct terminates.

    4. The construct rolls back any DML statements issued and returns the unhandled exception to the calling environment.

  24. Examine this code

    BEGIN
    theater_pck.v_total_seats_sold_overall := theater_pck.get_total_for_year;
    END;

    For this code to be successful, what must be true?

    1. Both the V_TOTAL_SEATS_SOLD_OVERALL variable and the GET_TOTAL_FOR_YEAR function must exist only in the body of the THEATER_PCK package.

    2. Only the GET_TOTAL_FOR_YEAR variable must exist in the specification of the THEATER_PCK package.

    3. Only the V_TOTAL_SEATS_SOLD_OVERALL variable must exist in the specification of the THEATER_PCK package.

    4. Both the V_TOTAL_SEATS_SOLD_OVERALL variable and the GET_TOTAL_FOR_YEAR function must exist in the specification of the THEATER_PCK package.

  25. A stored function must return a value based on conditions that are determined at runtime. Therefore, the SELECT statement cannot be hard-coded and must be created dynamically when the function is executed. Which Oracle supplied package will enable this feature?

    1. DBMS_DDL

    2. DBMS_DML

    3. DBMS_SYN

    4. DBMS_SQL

Oracle and Java Latest / Recent Placement Paper questions and answers for programming / technical paper for leading IT Companies Infosys, Wipro, IBM, CISCO, Oracle, SAP, TCS, Satyam Computers, HCL, Microsoft, Ramco, Cognizant, Verizon, Cingular, IFlex Solutions Landran Chandigarh, Mohali, Delhi, bangalore, chennai, hyderabad, pune, kolkata, latest interview question papers with complete solutions submitted by real candidates and answered by experts. Keep watching out for 2007, 2008 and recent papers for all months - january, februrary, march, april, may, june, july, august, september, october, november, december. Good luck for your papers!!


Oracle SQL Technical Interview Recent Questions - 4

Oracle interview questions

  1. What’s the command to see the current user name? Sql> show user;

  2. What’s the command to change the SQL prompt name?

    SQL> set sqlprompt “database-1 > ”
    database-1 >
    database-1 >

  3. How do I eliminate duplicate rows in an Oracle database?

    SQL> delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name);

    or

    SQL> delete duplicate_values_field_name dv from table_name ta where rowid < (select min(rowid) from table_name tb where ta.dv=tb.dv);

  4. How do I display row number with records? Use the row-num pseudocolumn with query, like

    SQL> select rownum, ename from emp;

  5. How do you display the records within a given range?

    select rownum, empno, ename from emp where rowid in
    (select rowid from emp where rownum < =&rangeend
    minus
    select rowid from emp where rownum<&rangebegin);

  6. The NVL function only allows the same data type. But here’s the task: if the commission field is null, then the text “Not Applicable” should be displayed, instead of blank space. How do you write the query?

    SQL> select nvl(to_char(comm.),’Not Applicable’) from emp;

  7. Explain explicit cursor attributes. There are four cursor attributes used in Oracle: cursor_name%Found, cursor_name%NOTFOUND, cursor_name%ROWCOUNT, cursor_name%ISOPEN

  8. Explain implicit cursor attributes. Same as explicit cursor but prefixed by the word SQL: SQL%Found, SQL%NOTFOUND, SQL%ROWCOUNT, SQL%ISOPEN

  9. How do you view version information in Oracle?

    SQL> select banner from $version;

10. How do you switch to DOS prompt from SQL prompt? SQL> host

See more latest Oracle Database, DBA, gaming database - graphics, GUI recent important questions mostly asked in common interview questions pre placement and GD topics. See Technical interview java questions commonly asked placement questions for top IT MNCs in India, USA, UK, Norway, China, UAE, Denmark, Hungary, etc.

Oracle Interview Questions 1

SQL Interview Questions

1.What is SQL?

SQL stands for 'Structured Query Language'.

2.What is SELECT statement?

The SELECT statement lets you select a set of values from a table in a database. The values selected from the database table would depend on the various conditions that are specified in the SQL query.

3.How can you compare a part of the name rather than the entire name?

SELECT * FROM people WHERE empname LIKE '%ab%'
Would return a recordset with records consisting empname the sequence 'ab' in empname .

4.What is the INSERT statement?

The INSERT statement lets you insert information into a database.

5.How do you delete a record from a database?

Use the DELETE statement to remove records or any particular column values from a database.

6.How could I get distinct entries from a table?

The SELECT statement in conjunction with DISTINCT lets you select a set of distinct values from a table in a database. The values selected from the database table would of course depend on the various conditions that are specified in the SQL query. Example
SELECT DISTINCT empname FROM emptable

7.How to get the results of a Query sorted in any order?

You can sort the results and return the sorted results to your program by using ORDER BY keyword thus saving you the pain of carrying out the sorting yourself. The ORDER BY keyword is used for sorting.

SELECT empname, age, city FROM emptable ORDER BY empname

8.How can I find the total number of records in a table?

You could use the COUNT keyword , example
SELECT COUNT(*) FROM emp WHERE age>40

9.What is GROUP BY?

The GROUP BY keywords have been added to SQL because aggregate functions (like SUM) return the aggregate of all column values every time they are called. Without the GROUP BY functionality, finding the sum for each individual group of column values was not possible.

10.What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a table.

Dropping : (Table structure + Data are deleted), Invalidates the dependent objects ,Drops the indexes

Truncating: (Data alone deleted), Performs an automatic commit, Faster than delete

Delete : (Data alone deleted), Doesn?t perform automatic commit

What are the Large object types suported by Oracle?

Blob and Clob.

11.Difference between a "where" clause and a "having" clause.

Having clause is used only with group functions whereas Where is not used with.

12.What's the difference between a primary key and a unique key?

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs, but unique key allows one NULL only.

13.What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?

Cursors allow row-by-row prcessing of the resultsets.

Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.

Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Furthere, there are restrictions on the SELECT statements that can be used with some types of cursors.

Most of the times, set based operations can be used instead of cursors.

14.What are triggers? How to invoke a trigger on demand?

Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table.

Triggers can't be invoked on demand. They get triggered only when an associated action (INSERT, UPDATE, DELETE) happens on the table on which they are defined.

Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.

15.What is a join and explain different types of joins.

Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.

Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.

16.What is a self join?

Self join is just like any other join, except that two instances of the same table will be joined in the query