Category Archives: SQL

Transpose Rows to Columns and Columns to Rows in Oracle

transpose rows to columns

This is the most popular question asked in an interview as well as over the internet. How to transpose rows to columns in SQL? How to transpose columns to rows in SQL? How to create PIVOT table in SQL? How to Create a Matrix in SQL? We can Transpose Rows to Columns and Columns to

Difference Between DDL, DML and DCL Commands


This is the most important question asked in an interview. How to differentiate DDL, DML and DCL commands? What are DDL commands? DDL – Data Definition Language commands are used to define the structure or schema of a database. There are many DDL commands like below: CREATE: This command is used to create database objects

How to Delete Duplicate Rows from a Table

Delete Duplicate Rows from a Table

How to remove duplicate records from a Table? If you want to remove duplicate rows from a Table and want to leave only unique records in a Table then choose any one of the following method to delete duplicate rows. Method-1: SQL> DELETE FROM SAMPLE A WHERE ROWID > (SELECT MIN(ROWID) FROM SAMPLE B WHERE

What is the Difference between Truncate and Delete in Oracle

Difference Between Truncate and Delete

First create a Table using following command on SQL> prompt. CREATE TABLE SAMPLE (ID NUMBER, NAME VARCHAR2(20),CITY VARCHAR2(15), ADDRESS VARCHAR2(50)); Now insert three records into SAMPLE table using following command. INSERT INTO SAMPLE VALUES (1,’AMIT KUMAR’,’DELHI’,’MAIN MARKET, DELHI’); INSERT INTO SAMPLE VALUES (2,’SUDHIR MALHOTRA’,’AGRA’,’ALIBAGH’); INSERT INTO SAMPLE VALUES (3,’DEVANG MEHRA’,’ALIGARH’,’NEAR RLY. ST.’); Don’t forget to

SQL Tutorial

Oracle SQL Tips

SQL (pronounced as “ess-que-el”) stands for Structured Query Language. SQL is used to modify and access data from a database and is used by most common relational database management systems like Oracle, Sybase, Microsoft SQL Server, Access, etc. <—– SQL Tutorial —–> SQL Interview Questions and Answers – 1 Difference Between DDL, DML and DCL

SQL Interview Questions and Answers – 1

In this article I have posted SQL interview questions and answers for my visitors to help them in learning basic SQL. How to connect with Oracle Database C:>sqlplus /nolog SQL*Plus: Release Production on Thu May 16 16:22:56 2013 Copyright (c) 1982, 2010, Oracle.  All rights reserved. SQL> conn sys/sys@test as sysdba Connected. How to

How to export data from Oracle Table to Excel sheet in Java Script

You have searched over the internet about how to export oracle table to excel using java script. I am posting this article to give you complete source code to export data from oracle to excel. Follow the below mentioned steps and use the below mentioned code. Step-1: In body section, first you have to define

How to connect Oracle Database in Java

Connect Oracle Database

If you want to access oracle 10g database via JDBC connection, you need to set CLASS PATH environment variable to find the ojdbc14.jar file provided by Oracle. The file is located in  “C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar ” This is sample JDBC Connection string to connect Oracle database in Java Connection conn = null; Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","user_name","Pass_word”"); conn.close();     

Transpose Rows into Columns

Transpose Rows in Oracle

You can use these best and easy tips to Transpose rows into columns. You can also Transpose columns into rows in Oracle.

Siteground SALE
60% OFF SiteGround WordPress Hosting – $3.95/month (Exclusive Offer !!!)