Database Tutorials, Tips & Tricks


How To Reset MySQL Autoincrement Column

MySQL database provides a wonderful feature of Autoincrement Column index. Your database table can define its primary key as Autoincrement number and MySQL will take care of its unique value while inserting new rows.Each time you add a new row, MySQL increments the value automatically and persist it to table. But sometime you may want ...

Hibernate One To One Mapping Tutorial (XML Mapping)

Hibernate One To One Mapping Tutorial (XML Mapping)
Let us understand how One-to-one mapping works in Hibernate. Following is a simply yet concept building example where we will understand One-to-one mapping in Hibernate framework using XML Mappings. We will use two tables "employee" and "employeedetail" which exhibits one-to-one relationship. Using Hibernate we will implement this relationship.Tools and technologies used in this article:Java JDK 1.5 above MySQL 5 above Eclipse 3.2 above Hibernate 3 above Maven 3 ...

Hibernate Maven MySQL Hello World example (XML Mapping)

Hibernate Maven MySQL Hello World example (XML Mapping)
In this tutorial, we will try to write a small hello world program using Hibernate, MySQL and Maven. We will create a Java project using Maven and will then try to add Hibernate on it.Following are the tools and technologies used in this project.Java JDK 5 or above Eclipse IDE 3.2 or above Maven 3.0 or above Hibernate 3.0 or above MySQL 5.0 or above1. Database CreationFor this tutorial, ...

Oracle 11G new feature: Virtual Column

Oracle 11g introduced the concept of 'Virtual Column' within a table. Virtual Columns are similar to normal table's columns but with the following differences:They are defined by an expression. The result of evaluation of this expression becomes the value of the column. The values of the virtual column are not stored in the database. Rather, it's computed ...

Row Data Multiplication in Oracle

Row Data Multiplication in Oracle
Aggregate functions return a single result row based on a group of rows. This differentiates them from Single-Row functions which act on each row. These functions are extensively used with the GROUP BY clause in SQL statements. AVG (), COUNT (), SUM () ... are few aggregate functions which are quite commonly used. Today, one ...

Generating Random Data in Oracle

Most of the times, production data is not available in development environments. Here, I would like to share a single sql command which can generate random data. But before that, let's address another issue faced by a lot of new oracle users. We need to generate a sequence of numbers using a sql statement. This will generate a number sequence. ...

Deleting Duplicate Rows in Oracle

Deleting Duplicate Rows in Oracle
Deleting duplicate rows from tables is one of the common task oracle developers come across. The data might get duplicated because of missing primary/unique key on the table or batch file getting loaded multiple times. Here I have tried to summarize different ways of deleting this duplicated data. Please note that this is not an extensive list ...

Invisible Indexes in Oracle 11g

Invisible Indexes in Oracle 11g
The effective usage of an index is always a big question. There are instances in production environments, where an index may help the performance of just a single query, while it can degrade the performance of a number of queries. Always the Optimizer can’t guarantee the best suitable index required for the query in an environment ...

Oracle Data Compression

Oracle Data Compression
As the data grows in relational databases (new business requirements, managing audit data etc), the cost associated with the disk systems to store that data and the resources required to manage them becomes vital. Oracle understands this requirement and it is continuously implementing and improving on the compression techniques and algorithms while simultaneously meeting the application scalability ...

Understanding Primary Key(PK) Constraint in Oracle

Understanding Primary Key(PK) Constraint in Oracle
The Primary Key(PK) constraint is the most basic concept of any RDBMS (I am particularly interested in Oracle). Yet, I have noticed people getting confused when it comes to the practical usage and asking questions like:- I have disabled PK and now oracle is doing full table scan. - How PK constraints and indexes are related/different? - How ...
Page 1 of 3123
Copyright © 2012 ViralPatel.net. All rights reserved.