Category Archives: Databases

Contains all Database related posts

Basic Concepts of Database

In this post we will know some basic concepts  of database which includes different types of databases, schema, SQL , queries and table expressions. What is a Database? A database is any collection of related data. The database stores all data in tables that are related to one another. Relationships are established between tables such… Read More »

MySQL – Load data from csv

The LOAD DATA INFILE statement will reads rows from a text/csv file and insert the data into a table at high speed. We need to pass the complete path/location of the file in the query. LOAD DATA INFILE is similar to that of SELECT … INTO OUTFILE. To write data from a table to a… Read More »

MySQL : Find databases size

In this post we will know how to find out the databases size in the MySQL server. MySQL Select Query to find database sizes :- SELECT table_schema “Data Base Name”, sum( data_length + index_length ) / 1024 / 1024 “Data Base Size in MB”FROM information_schema.TABLES GROUP BY table_schema ; The above query will list out… Read More »

MySQL Insert Query

In this post we will know about MySQL Insert Query by using select query. There are multiple ways to insert data in a table as shown below. INSERT INTO table_name (col1,col2) VALUES(val1,val2); OR INSERT INTO table_name (col1,col2) VALUES(row1_val1,row1_val2),(row2_val1,row2_val2),(row3_val1,row3_val2); In the same way we can use the select the query to insert the data from one… Read More »

LIMIT and TOP in select query

In this post we will learn the usage of LIMIT and TOP in select query. In order to limit the records from the select query each database provides different syntax. For example : MySQL has LIMIT – which will be used to limit the records from the select query. In the same way SQL Server provides… Read More »

Mysql Storage Engines

MySQL supports multiple storage engines. Storage Engines are MySQL components that handle the SQL operations for different table types and helps us to increase the database performance. So it is necessary to know about the MySQL storage engines so that we can use the right storage engines for our tables in the database. MySQL storage engines… Read More »

Find database names in Oracle

Below select queries help us to find database names in Oracle, and also we can find the  SID, service name and server host. Oracle query command to  find the database name is: select * from global_name; select ora_database_name from dual; Oracle query command to check the SID (or instance name): select sys_context(‘userenv’,’instance_name’) from dual; Oracle query… Read More »