What is Hashmap & Hashtable with example?

Hashtabel is original collection classes in java which was introduced as version 1.2 that HashMap permits null values in it, while Hashtable doesn’t. In advanced Java, HashMap and Hashtable are both data structures that store key-value pairs, but they have some differences. HashMap: Introduced in Java 1.2 as part of the Java Collections Framework. It … Read more

Difference between javascript and program

Difference between script and program: 1. A program has well defined structure, which must be followed even execute a single file. A script is a set of instructions (may be a single statement), which are complete in it-self. And execute independently as rest of the instructions. 2. Script is loose-type. It means variable’s data-type is not must. … Read more

Interview Scenario on MySQL:

Interview Scenario on MySQL: There is a table named SAMPLE, and we want to delete all the data from the table. Which is better option? delete * from SAMPLE truncate table SAMPLE In delete cursor is on the current location, data is deleted from the table but memory is not released by the table, by which … Read more

Import data into MySQL from any file

How to Import data into MySQL from any file: Mysql –u root <db.sql (for database and tables) Mysql –u root <data.sql (for data into tables) To import data into MySQL from a file, you can use the LOAD DATA INFILE statement. Here’s a basic example of how to use it: sql LOAD DATA INFILE ‘path/to/your/file.csv’ … Read more

Syntax and Queries

MySQL Commands: Show databases; Create database db_name; Use dbname; Show tables; Create table tb_name(id int, name varchar(20)); Desc tb_name; Insert into tb_name values(101 , ‘name of person’); Insert into tb_name (id) values(102); Update tb_name set name=’person name’ where id=102; Select * from tb_name; Delete from tb_name where id=102; Drop table tb_name; Drop database db_name; Rename … Read more