DBMS




1. What is a Cartesian product? What causes it?

    Ans: A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table Cartesian product will                      have x * y * z number of rows where x, y, z correspond to the number of rows in each table involved in the join. It is causes by                            specifying a table in the FROM clause without joining it to another table.

2. What is an advantage to using a stored procedure as opposed to passing an SQL query from an application.

    Ans: A stored procedure is pre-loaded in memory for faster execution. It allows the DBMS control of permissions for security purposes. It                  also eliminates the need to recompile components when minor changes occur to the database.

3. What is the difference of a LEFT JOIN and an INNER JOIN statement?

    Ans: A LEFT JOIN will take ALL values from the first declared table and matching values from the second declared table based on the                      column the join has been declared on. An INNER JOIN will take only matching values from both tables

4. When a query is sent to the database and an index is not being used, what type of execution is taking place?

    Ans: A table scan.

5. What are the pros and cons of using triggers?

    Ans: A trigger is one or more statements of SQL that are being executed in event of data modification in a table to which the trigger                            belongs.
            Triggers enhance the security, efficiency, and standardization of databases.
            Triggers can be beneficial when used:
            -- to check or modify values before they are actually updated or inserted in the database. This is useful if you need to transform data                    from the way the user sees it to some internal database format.
            -- to run other non-database operations coded in user-defined functions
            -- to update data in other tables. This is useful for maintaining relationships between data or in keeping audit trail information.
            -- to check against other data in the table or in other tables. This is useful to ensure data integrity when referential integrity constraints                aren't appropriate, or when table check constraints limit checking to the current table only.

6. What are the pros and cons of using stored procedures. When would you use them?

7. What are the pros and cons of using cursors? When would you use them?

  1. What are the different types of joins?

  2. Explain normalization with examples.

  3. What cursor type do you use to retrieve multiple recordsets?

  4. Diffrence between a "where" clause and a "having" clause

  5. What is the difference between "procedure" and "function"?

  6. How will you copy the structure of a table without copying the data?

  7. How to find out the database name from SQL*PLUS command prompt?

  8. Tadeoffs with having indexes

  9. Talk about "Exception Handling" in PL/SQL?

  10. What is the diference between "NULL in C" and "NULL in Oracle?"

  11. What is Pro*C? What is OCI?

  12. Give some examples of Analytical functions.

  13. What is the difference between "translate" and "replace"?

  14. Difference between "ORACLE" and "MICROSOFT ACCESS" databases.

  15. How to create a database link ?

  16. What is DYNAMIC SQL method 4?

  17. How to remove duplicate records from a table?

  18. What is the use of ANALYZing the tables?

  19. How to run SQL script from a Unix Shell?

  20. What is a "transaction"? Why are they necessary?

  21. Explain Normalizationa dn Denormalization with examples.

  22. When do you get contraint violtaion? What are the types of constraints?

  23. How to convert RAW datatype into TEXT?

  24. Difference - Primary Key and Aggregate Key

  25. How functional dependency is related to database table design?

  26. What is a "trigger"?

  27. Why can a "group by" or "order by" clause be expensive to process?

  28. What are "HINTS"? What is "index covering" of a query?

  29. What is a VIEW? How to get script for a view?

  30. What are the Large object types suported by Oracle?

  31. What is SQL*Loader?

  32. Difference between "VARCHAR" and "VARCHAR2" datatypes.

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