Saturday, December 31, 2016

DBMS Interview Questions

In this session I am sharing  Basic DBMS Interview Questions which are commonly asked in interview. Mostly these Questions  will ask in campus interviews as well as for Beginners.

1) What is DATABASE?

Ans:  A database is a collection of related information that is organized. It is a collection of tables,quires, reports and views and other objects. It can be easily accessed ,managed and update the data.

2) What is DBMS?

Ans:Here DBMS stands for Database Management System. It is a collections programs that designed to define,manipulate,retrieve and manage data in a database.

3) What is Database System?

Ans: If it contains both Database and DBMS software  is called as Database System. 

4) What are the advantages of DBMS?

Ans: 
Redundancy is controlled.
Unauthorized access is restricted.
It provides multiple user interface.
Main advantage is providing back up and recovery
Enforcing Integrity Constraints
It allows the user to perform complex transactions.
It provides consistency,atomic,control concurrency
It provides security

5)  What are the Disadvantage in file processing system?

Ans: 
Data redundancy and inconsistency
In this very difficult to accessing data
Concurrent access is not possible
Data isolation
Data integrity
Security problems

6) Describe three levels of data Abstraction?

Ans: There are three levels of abstraction. They are

Physical Level:  This is the lowest level of abstraction describes how data are stored.

Logical Level:  The next higher level of abstraction, describes what data are stored in 
database and what relationship among those data.

View Level: The highest level in data  abstraction, at this level users see the data in the form of rows and columns.

7)  What is Integrity and their rules?

Data Integrity refers accuracy and consistence of data. There are two integrity rules:
Entity integrity: It states that "primary key can not have NULL values"
Referential Integrity: It states that "Foreign key can be either a NULL value or should be Primary Key value of other relation.

8)  What is Data Independence?

Ans: It means that the application is independent of the storage structure and access strategy of data. In other words, The ability to modify the scheme definition in one level should not effect the schema definition in the next higher level. 

Physical Data Independence: If modification is done in physical level should not effect the logical level.

Logical Data Independence: If modification is done in logical level should not effect the view level.

9) What is normalization?


Ans: It a process of organizing the data in database to avoid data redundancy. It can minimize insertion,update and delete anomalies.

10)  What is an entity?

Ans : An entity is a thing or object  in the world with an independent existence.



11) What is an Entity Type?

Ans:  It is a collection of entities that have same attributes.

12) What is an Attribute?

Ans: It is a particular property,which describes the entity.

13) What is Primary Key?

Ans: A Primary Key is a column whose values uniquely identify every row in a table. That means Primary Key values can never be reused.

14) What is Data model?

Ans:  A collections of conceptual tools for describing data,data relationships data semantics and constraints. 

15) What is E-R model?

 Ans:  The data model is based on real world that consists of basic objects called entities  and of relationship among these objects.Entities are described in a database by a set of attributes.

16) What is functional Dependency?

Ans: A functional dependency is a  relationship between two attributes. Typically between the PK and other non-key attributes within the table. 

17)  What is RDBMS?

Ans:  RDBMS stands for Relational Data Base Management System. It is type of Data Base Management System(DBMS) that stores the data in the form of related tables. It is used to create,update and administer a relational database. 

18) How many types of relationships exists in database design?

Ans:  There are three main relationships models. They are

a) one-to-one
b)one-to-many
c)many-to-many

19) What is transaction?

Ans:  A transaction is a logical unit of database processing that includes one or more database operations. It is a program unit whose execution may or may not change the contents of the databse

20) What is generalization?

Ans:  It is a process of extracting common characteristics from two or more classes and combining them into a generalized super class. So it is a bottom-up approach. 

Let me know your comments about on this post and keep follow me for latest updates and share this to your friends and social media to reach more people

Friday, December 30, 2016

SQL Query Interview Questions and Answers

In this post you will learn SQL Query interview Questions for freshers and Experienced candidates. These are Frequently asked basic and advanced SQL Queries Interview Questions and Answers with Examples for Business Analyst, Data Analyst, DBA, Freshers and Experienced Java, PHP, Dot Net programmers in Oracle, MySQL and MS SQL Database.

Consider this table to use in our queries:

Table Name :  Employee

create table employee
(
Emp_Id int,
First_Name varchar2(20),
Last_Name varchar2(20),
salary number,
joining_date date,
Department varchar2(20));


After inserting some data into employee table the following result will come.

Result:




Table Name : Incentives

create table Incentives
(
Emp_Id int,
Incentive_Date date,
Incenttive_amount number);


Result:

 






1) Get all employee details from the employee table

select * from employee;
 

2) Get First_Name,Last_Name from employee table

select first_name,last_name from employee;


3)Get First_Name from employee table in upper case

select upper(first_name)from employee;
 

4) Get First_Name from employee table in lower case

select lower(first_name) from employee;


5) Get unique DEPARTMENT from employee table
 

select distinct DEPARTMENT from Employee;
 

6) Get FIRST_NAME ,Joining year,Joining Month and Joining Date from employee table
 

Select FIRST_NAME, to_char(joining_date,'YYYY') Join_Year ,

to_char(joining_date,'Mon') join_Month,

to_char(joining_date,'dd') join_date from EMPLOYEE;
 

7) Get all employee details from the employee table order by First_Name Ascending     
Select * from employee order by FIRST_NAME asc;





8) Get all employee details from the employee table order by First_Name Ascending and Salary descending
 

Select * from employee order by FIRST_NAME asc,SALARY desc;

9)  Get employee details from employee table whose employee name is “John”

Select * from EMPLOYEE where FIRST_NAME='pavan';
 

10) Get employee details from employee table whose Salary greater than15000

Select * from EMPLOYEE where Salary >15000;
 

12) Get employee details from employee table whose Salary between 15000 and 25000
 

Select * from EMPLOYEE where Salary between 15000 and 25000;
 

13) Get employee details from employee table whose joining year is “2015”
Select * from EMPLOYEE where to_char(joining_date,'YYYY')='2015';
 

14) Get employee details from employee table whose joining month is “January”
 

Select * from EMPLOYEE where to_char(joining_date,'MM')='01' ;
 

(or)
Select * from EMPLOYEE where to_char(joining_date,'Mon')='Jan';

15) Get difference between JOINING_DATE and INCENTIVE_DATE from employee and incentives tableSelect FIRST_NAME,INCENTIVE_DATE ,JOINING_DATE from employee a inner join incentives B on A.EMP_ID=B.EMP_ID;


SQL Queries in Oracle:
select sysdate from dual;
 

SQL Queries in SQL Server:
select getdate();


SQL Query in MySQL:
select now();
 

16) Get department,total salary with respect to a department from employee table.
Select DEPARTMENT,sum(SALARY) Total_Salary from employee group by department;
 

17) Get department,total salary with respect to a department from employee table order by total salary descendingSelect DEPARTMENT,sum(SALARY) Total_Salary from employee group by DEPARTMENT order by Total_Salary desc;
 

18) Get department wise average salary from employee table order by salary ascending 
select DEPARTMENT,avg(SALARY) AvgSalary from employee group by DEPARTMENT order by AvgSalary asc;
 

19) select first_name, incentive amount from employee and incentives table for those employees who have incentives

Select FIRST_NAME,INCENTTIVE_AMOUNT from employee a inner join incentives B on A.EMP_ID=B.EMP_ID;
 

20) select first_name, incentive amount from employee and incentives table for those employees who have incentives and incentive amount greater than 5000
 

Select FIRST_NAME,INCENTTIVE_AMOUNT from employee a inner join incentives B on A.EMP_ID=B.EMP_ID and INCENTTIVE_AMOUNT >5000;




 




I hope you enjoy this post and share this to your friends and social media to reach more people.keep follow me for latest updates


 

Basic Java Interview Questions and answers

In this article, we will learn some Basic Java Definitions for freshers. In earlier post i have written Top 10 Job Portal websites in India. Here I am writing Introduction of java and Basic Java interview questions.

1) What is Programming Language?

Ans:  A programming Language is a formal Computer Language which is used to design instructions that are executed by a particular machine for performing some tasks
(computation evaluation etc).

2) What is POP?

Ans: POP means Procedure Oriented Programming language is which a list of instructions is given to the computer to follow, in order to perform  a task. These instructions are organized into groups which are known as functions(procedures). Examples: BASIC,BCPL,C,COBOL

3) What is OOP?

Ans: OOP means Object Oriented Programming Language is based on Objects,instead of just functions and procedures. These objects are organized into classes,which allow individual objects to be group together. Examples: C++,JAVA,C# etc..

4) What is Source Code?

Ans:  A source code is a code which is written by programmer in human readable form with proper programming syntax.

5) What is Byte Code?

Ans: Byte Code is the Intermediate code generated by the Java Compiler. Byte Code run by JVM instead of the original machine(computer processor).

6) What is Executable Code?

Ans:  It is the machine understandable code, which can be executed by a machine(OS).

7) What is API?

Ans:  API means Application Programming Interface,is an interface implemented by a software program that enables it to interact with the other software.

8) What is JDK?

ANS:  JDK means Java Development Kit, it is a set of tools which are used for developing java programs.

9) What  is JRE?

ANS: JRE means Java Runtime Environment is a collection of libraries and other components which are required to run code written in java language.



10) What is JVM?

Ans: JVM means Java Virtual Machine,is a traditional platform-independent execution environment that converts java byte code into machine code for execution.

11) What is JavaC?

Ans: JavaC means Java Compiler,which converts java source code(.java) into byte code(.class)

12) What is JCL?

Ans: Java Class Library is a set of libraries that java applications can call at run time.

13) What is Token?

Ans:  Token is a individual unit in a program. Basically they are the individual words,symbols and punctuation marks.

14) What is Constants?

Ans: Constants are the fixed values that do not changed during the execution of a program.

15) What is variable?

Ans: A variable is  a memory-location in the program's memory which is used to store data value or information. Value stored in a variable can be modified during program's execution.

16) What is Identifier?

Ans: Identifier is a tag name for a particular entity which uniquely identifies it. Example: variable,function etc..

17) What is Datatype?

Ans: Data type gives information about type-definitions that means type of data which is to be stored in a variable.

18) What are Keywords?

Ans: Keywords are the reserved words whose meaning is already known to the Compiler.

19) What are Operators?

Ans: Operators are the symbols which perform a predefined operation on operands.

20) What is Expression?

Ans: A statement having valid operators and operands sequence is known as expression.

21) What is Recursion?

Ans: When a function class itself, it is known as Recursion

22) What is class?

Ans: Class is a blue-print from which objects are created. Class contains data members to store information and member functions to operate upon data members.

23)  What is Object?

Ans: Object is an instance of a class. It is basically a real world implementation of the class having all those property values which are defined or structured in the class

24) What is Super class or Base class?

Ans:  Whose properties are inherited by another class

25)  What is derived class?

Ans:  One who inherit the properties of the base class

26) What is Inheritance?

Ans: When a class inherits or acquires the property of another class this is known as inheritance.

27) What is interface?

Ans:  Interface is a way of defining the behavior that's class can implement. It contains only abstract methods and final variables.

28) What is polymorphism?

Ans: Polymorphism means one name many forms that means one entity behaves differently in different situations.

29) What are Wrapper class?

Ans: Wrapper classes are used to convert any primitive data type into an object.

30) What is abstract class?

Ans: Abstract class is a class which can not be instantiated.