Oracle Sample Tables’ Script for SQL Server

I work primarily on SQL Server these days but I had originally started learning SQL on Oracle. I find the sample tables EMP, DEPT, BONUS, SALGRADE and DUMMY provided with Oracle to be useful for beginners to practice SQL commands. Oracle provides the script by the name of DEMOBLD.SQL to create these tables which can be found in the <OracleHome>sqlplusdemo folder of your Oracle installation or at this URL. Some more useful scripts for Oracle users can be found at this OraFAQ page.

I thought that few folks might like to have those tables on SQL Server so I made some changes to the script so that it can run on SQL Server too. It might prove useful if you don’t have access to an Oracle installation but want want to practice SQL commands with these tables. Of course, MS SQL Server does not support all the SQL syntax as supported by Oracle, but the tables can be handy in some cases.

The SQL Server compatible script is at the TechNet link below. The basic difference from the original script is in the datatypes and the datetime convert function. The script will drop any tables with the same names in the current database so be sure that existing tables do not have any critical data.

Download URL –
http://gallery.technet.microsoft.com/TSQL-Script-to-Create-6bc846bd

4 thoughts on “Oracle Sample Tables’ Script for SQL Server

  1. abodeqa May 14, 2012 / 10:11 am

    This post is really very helpful…great reading this post

  2. Desh September 5, 2012 / 7:31 am

    Nice…Very useful post…………

  3. Tarun September 27, 2012 / 1:24 pm

    Thanks a lot. Very useful.
    just one confusion : Doesn’t BONUS table have any values ????

  4. Aalam Rangi May 6, 2014 / 2:46 pm

    Correct. The original script from Oracle does not include any values for BONUS.

Leave a Reply

Your email address will not be published. Required fields are marked *