hi welcome to Vishnus world
Classes and Objects in Java with examples
A class is a blueprint or model based on which object is defined. A class cannot exists in real world but object can. A class is a physical idea where as object is an instance of the class.
An object is an entity that is having state and behavior or simply we can say object is anything that exists in the real world. An object will have properties and actions. Properties are represented by variables and Actions are represented by methods.
![]() |
| Objects in Java |
- If you take a dog it will have properties like name, height, weight, age and actions like barking, running, biting etc.
- We can't create a object without a class.
- However we can create a class without a object for example Dinosaur
- A class is a physical idea where as object is instance of class
- Class code is stored in method area in JVM where as
- Objects are created in heap in JVM
Core Java Concepts
Hi folks,I would like to inform that who are working as a test enginners or going to start their career in testing or quality assurance or QA perspective be careful and you should remember things are getting changed rapidly and don't expect that you will be asked what is regression testing, what is quality assurance or what is retesting bla bla.. The trend is now getting changed and you will be asked to write the code also for any language that you are keeping in your resume. Incase of Java be prepare for Java coding, Java Naming Conventions, Java OOPS concepts like Inheritance, Polymorphism, Abstraction, Encapusulation, Exception handling, Multithreading, Swings
JDBC or any such type of things you might be asked.
And if you are an automation experrise then you will be asked for system test also, where you need to sit and solve the given task or write code for that one.
Here is the list of Java Concepts I would like explain in detail which is useful for especially for test engineers.
1) Classes and Objects
2) Inheritance
3) Polymorphism
4) Abstraction
5) Encapsulation
6) Exceptional Handling
7) Multi threading
Index in SQL with examples
Data Storage:
- The data in SQL Server is stored in the form of data pages.
- The size of each data page is 8kb.
- The data page contains the page header which is 96 bytes.
- The header will have previous pointer (PP), object id, next pointer (NP).
- The previous pointer pointing to the previous page, this value is NULL for first page.
- The next pointer pointing to the next page, it’s value is NULL for the last page.
Data Access:
In SQL Server Data will be accessed in two ways.
Table Scan : It starts from beginning of the table and scan each and every page for required data, it extracts the rows to meet the query criteria.
Using Index: When index is created for a table, it travels through index tree structure to determine the required rows and extracts the rows which will meets the query criteria.
User Defined Functions in SQL Server
The functions created by the user are called user defined functions.
Types of user defined functions:
1. Scalar Valued Functions
2. Table Valued Functions
Syntax:
Types of user defined functions:
1. Scalar Valued Functions
2. Table Valued Functions
1. Scalar Valued Functions:
The functions which return scalar (single value) to the calling environment are called scalar valued functions.Syntax:
create function (function_name) (@para1 datatype(size), ……@para n datatype (size)) retrun datatype as begin function body return ( variable) end
Declare @ var (datatype) Set @var= owner.funciton_name ( para1, para2..) print@var
Create function add_sum ( @a int, @b int) Return int As Begin Declare @c int, Set @c = @a+@b; return(@c); endExecuting the function
Declare @z int Set @z= dbo.add_sum(3,5) print@z
Aggregate and Group Functions in SQL and Oracle with examples
- Aggregate functions will acts group of values at a time and returns a single value. It is also called Group functions.
- Aggregate functions will ignore NULL values while calculating.
- Here is the sample emp table using for solving examples.
![]() |
| Emp Sample Table |
Sum is used to find the sum of values in a column.
Example:Write a query for find the total salary of emp table.
select sum(sal) from emp2. Avg: Avg is used to find average values for given values.
Example:Write a query for find the average salary of emp table.
select avg(sal) from emp
Database (DB)Testing - Strategy, Concepts, Checklist with sample test cases
In software testing there will be so many types of testings we will be carried out to deliver the product as per the client needs or as per the requirements. In which database testing or db testing is the one which requires thorough knowledge on sql commands, stored procedures, functions and triggers. There will be so many database software available in the market like SQL Server, Oracle, MySQL, PostgreSQL, Hadoop (Hadoop distributed file system) etc., What ever may be the database software we are using there will be slight difference in SQL query syntax, however most of the things will be same in all software. Database testing or DB testing is a technique of validating the database in which data is getting inserted/updated/deleted in various tables on various databases. Database testing is will differ based on the type of the data you are going to verify. I mean based on the OLTP or OLAP (Online Analytical Processing) the method of database testing will differ. For OLTP (Online Transaction Processing) we are verifying the stored procedures and validating the data is inserted/deleted/modified properly or not. And for OLAP lot of scripts or DW jobs will comes into picture. Having extensive knowledge on database testing I can say database testing should be carried out manually, why because I didn't find any automation testing tool which fulfills the db tsting requirements. Whenever the project started and ready for testing initially we will get the packages, stored procedures, functions etc for QA. In the sense the Database testing concept is divided into two phases.
- Backend Database Testing
- Frontend Database Testing
Functions in SQL - Scalar - Mathematical, String, Date and Time functions
A function is a predefined programming segment specially used for specific and well defined task.
Functions in SQL Server:
1. Scalar functions
2. Aggregate or group functions
Functions in SQL Server:
1. Scalar functions
2. Aggregate or group functions
1. Scalar functions:
These scalar functions will take single value as input and returns a single value.- Mathematical Functions
- String functions
- Date time functions
- System functions
- Security functions
- Confirmation functions
- Cursor functions
- System statistic functions
- Text and image functions
We will concentrate on first three functions now.
Transactions in SQL
Transaction is a logical unit of work in a database.
Types of transactions:
1. Auto commit transactions
2. Explicit transactions
3. Implicit transactions.
Every individual DML statement is an auto commit transaction.
Ex:
Types of transactions:
1. Auto commit transactions
2. Explicit transactions
3. Implicit transactions.
1. Auto Commit Transactions:
Every individual DML statement is an auto commit transaction.
Ex:
insert into dept values (50,'export','hyd')
Constraints in Database
- Constraint in a database is a mechanism used by Oracle (or) SQL Server to control the unwanted or invalid data flow into a table. (or)
- Enforcing the rules to maintain the data integrity.
- This mechanism automatically activates when user performance a DML operation.
Types of Constraints:
- NOT NULL: It will not allows the NULL values, but allow the duplicate values.
- UNIQUE: It will now allows the duplicate values, but allows NULL values.
- Primary Key:
- It is a combination of unique, not null and clustered index.
- It will not allow NULL values and duplicated values.
4. Default: It is used to insert default values into the column when user skips the column from insert statement.
5. Check: It is used to impose a condition rule.
6. Foreign Key:
- It is used to establish parent/child or Master/Detailed relationships between the tables.
- It always linked to primary key column or unique key column of master table.
- It will not allow NULL values.
Joins in SQL and Oracle
Joins:
Join is a query that combines the rows from two or more queries.
Types of joins:
1. Cross Join
2. Inner join or equi join or simple join
3. Outer join
4. Self join
1. Cross join:
Join is a query that combines the rows from two or more queries.
Types of joins:
1. Cross Join
2. Inner join or equi join or simple join
3. Outer join
4. Self join
1. Cross join:
- In cross join every row in the first table joins with the every row in the second table.
- The output of cross join is called Cartesian product.
Ex: select ename,dname
from emp, dept
or
select ename,dname
from emp cross join deptData Integrity in DBMS
The Reliability and accuracy of data is called the data integrity.
Types of Data Integrity in DBMS:
- Entity integrity
- Domain integrity
- Referential integrity
- User defined integrity
1. Entity Integrity:
The basic idea of entity integrity is that each should have acolumn that uniquely identifies the remaining columns in the table.
2. Domain Integrity:
It refers to the range of values that are allowed for the column.
3. Referential Integrity:
It refers to the relationships between the columns of a table.
4. User Defined Integrity:
It allows the user or administrator to enforce the new business rules which does not falls under above integrity.
Sub Queries and Correlated SubQueries in SQL and Oracle
Sub Query: It is an select statement in another select statement.
Syntax:
select <column_list> from <table_name> where column operator in (select <column_list> from <table_name>)
Based on the result of sub query or inner query outer query is executed. i.e., outer query depends on inner query.
Q. Write a query to display all employees in king department .
A.select *
from emp
where deptno=(select deptno
from emp
where ename='KING')
Datatypes in SQL Server
There are two types of data types in SQL Server
- Simple data types
- User defined data types
1. Simple data types:
- The data types provided by software are called simple data types.
a. Character Data types:
- Char(n):
- It is a fixed length data type used to store the character data.
- Default size is 1 byte
- Memory wastage if not used
- Maxi size is allowed for n is 800 bytes.
Dependencies In DBMS
Before discussing about the dependencies let us know what is meant by Entity and Attribute.
Three type of dependencies in DBMS
Entity: It is a person, place, event or thing about which the information is mentioned. For example employee, customer, student are called entities.
Attribute:The characteristic property that describes an entity is called attribute. For example emp number of employee or customer id of customer entity.
Three type of dependencies in DBMS
- Functional Dependency
- Partial Functional Dependency
- Transitive Dependency.
Database Models in DBMS
DBMS: Database Management System
![]() |
| DBMS |
- It is a collection of interrelated data and set of programs to access the data from database.
- It is a suit of software programs for creating maintaining the data in the database.
- Users are connected with DBMS not with the data.
- It allows the organisation to store data in one location from which multiple users can access the data.
- user can insert, update, delete the data by using tools provided by DBMS.
INTERSECT clause in Oracle, SQL Server and MySQL
INTERSECT clause is used in oracle and SQL Server to retrieve the data which are exists in both the tables.i.e we can say common records present in both the tables.
Syntax:
select column1, column2,....
from table 1 [where clause]
from table 1 [where clause]
intersect
select column1, column2 ...
from table2 [where clause]
from table2 [where clause]
For example Table1 and table2 as below
MINUS clause in Oracle, SQL Server and MySQL
Minus clause in oracle used to query the records which are exists in table1 but not in table2.
select * from table1
minus
select * from table 2
or
select column1, column2... from table1
minus
select column1, column2... from table2
Make sure the data types for the columns should be compatible.
select * from table1
minus
select * from table 2
or
select column1, column2... from table1
minus
select column1, column2... from table2
Make sure the data types for the columns should be compatible.
Normalization in Database
Normalization is the process of decomposing the relations (Tables) into smaller and well structured relations, to avoid the data redundancy. (or)
Normalization is the process of deciding which attributes should be grouped in a table to avoid the data redundancy in database.
There are some rules in the normalization each rule is called a normal form.
1. First Normal form (1NF)
2. Second Normal form (2NF)
1. First Normal form (1NF)
2. Second Normal form (2NF)
3. Third Normal form (3NF)
4. Fourth Normal form (4NF)
5. Fifth Normal form (5NF).
4. Fourth Normal form (4NF)
5. Fifth Normal form (5NF).
Data Modelling in Dataware house
In Data warehouse dimension modelling is used. Dimension model is designed using fact and dimensions.
There are 3 types of schemas used in dimension modelling.
1. Star schema
2. Snowflake schema
3. Galaxy schema
2. Snowflake schema
3. Galaxy schema
1. Star schema:
In star schema center of the star is fact table and corners are dimension tables. In star schema dimension tables don't have parent tables. In star schema dimension tables are denormalized. It is efficient in query processing.
![]() |
| Star Schema |
2. Snowflake schema:
In snowflake schema dimension tables have one or more parent tables. Snowflake schema efficient in transaction processing.
![]() |
| Snoflake Schema |
Multiple facts tables connected with multiple dimension tables. Also referred as multi star schema.
![]() |
| Galaxy Schema |
Subscribe to:
Posts (Atom)





