Posts

Showing posts with the label database

Database Interview Questions for Java Developers Part 2

Here are more DB interview question for java developer.  Mostly I have been asked question preliminary on DB Index, Query optimisation, Standard query and DB functions.  Q 1- How to Enable/Disable Indexes? A - Disable Index    ALTER INDEX [IndexName] ON TableName DISABLE GO Enable Index    ALTER INDEX [IndexName] ON TableName REBUILD  Q 2- What is max number of columns in index?  A-  32  Q 3- How many maximum columns in partitions can be used?  A -  16 Q  4- How to replace specific values from query result? i.e. how query return 'M' and 'F' can be converted into 'Male' and Female'.  A - This can be done using Oracle Decode function the syntax will be like SELECT employee_name, DECODE(type,'M', 'Male',                    'F', 'Female')type FROM employee; Q 5 - If the column of the table is having case sensitive data like 'Abc' and 'ABC'  and we want to do case sens...

Database Interview Questions for Java Developers

Describe Oracle database's physical and logical structure ?   Physical : Data files, Redo Log files, Control file.    Logical : Tables, Views, Tablespaces, etc. Can a view be updated/inserted/deleted? If Yes - under what conditions ?   A View can be updated/deleted/inserted if it has only one base table if the view is based on columns from one or more tables then insert, update and delete is not possible. What is explain plan and how is it used ?  The EXPLAIN PLAN command is a tool to tune SQL statements. To use it you must have an explain_table generated in the user you are running the explain plan for. This is created using the utlxplan.sql script. Once the explain plan table exists you run the explain plan command giving as its argument the SQL statement to be explained. The explain_plan table is then queried to see the execution plan of the statement. Explain plans can also be run using tkprof. What is a mutating table error and how can you get around i...

php database connection example

php connect to mysql database, oracle database <?php  @$dbcnnct = mysql_connect("localhost", "username", "password"); if(!$dbcnnct) { echo "could not connect"; } @$db=mysql_select_db("project"); if(!$db) { echo "could not select"; } $sql = mysql_query("SELECT * FROM country "); if(!$sql) echo "error==".mysql_error($sql);         while($row = mysql_fetch_array($sql))         {              echo ("$row[table column name]");         } @$dbcls = mysql_close($dbcnnct); ?>

Software development

Object oriented analysis (OOA) Object oriented design (OOD) 1. Start with the simple object which can be abstracted into individual classes. 2. Identify all the classes in the requirement specification. 3. Identify the commonalities between all or small groups of classes. Do not force fit generalization where it doesn’t make sense. 4. Keep all the data members private or protected 5. Identify all the member variables and methods the class should have 6. Ensure that the class is fully independent of other classes and contains all the necessary attributes and methods. 7. The methods in the class should be abstract. 8. Don't use the procedural code into a class for the methods in the class. 9. Inherit and extend classes from the base classes when require. 10. Define the "Has-A" or "Uses-A" relationships among the classes Object oriented programming (OOP) Software development life cycles Entity relationship model (ER model / ER diagrams)...