Monday, 28 May 2018
SQL CREATE TABLE COMMAND:
CREATE TABLE table_name(
>column is created the upper side of the table.
=see all data type in sql=DATA TYPE IN SQL
SQL CREATE TABLE COMMAND EXAMPLE:
id name mobile_no address position
CREATE TABLE USING ANOTHER EXCITING TABLE:
In new table contain all column they are already present in an exciting table.
SYNTAX:
CREATE TABLE COMMAND IS USE TO CREATE NEW TABLE IN PARTICULAR DATABASE.
TEH SQL CREATE COMMAND SYNTAX:
CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column1 datatype,
column2 datatype,
................)
>column is created the upper side of the table.=see all data type in sql=DATA TYPE IN SQL
SQL CREATE TABLE COMMAND EXAMPLE:
The following Example creates a table name employee are contained id,name, mobile, address, position.
- CREATE TABLE employee(id int,
name varchar(30),
mobile_no int,
address varchar(100),
position varchar(20)
);
Tabel look like this:-id name mobile_no address position
CREATE TABLE USING ANOTHER EXCITING TABLE:
In new table contain all column they are already present in an exciting table.
The table is created with the help of SELECT AND CREATE TABLE COMMAND
SYNTAX:CREATE TABLE new_table_name AS
SELECT column1,column2,column3,.....
FROM exiting_table_name
WHERE ......;
Saturday, 26 May 2018
BEST TWITTER TOOLS TO INCREASE FOLLOWERS
5-TWITTER TOOLS TO INCREASE FOLLOWER:
- Twitter is one of most used marketing platform.MILLION of the user are used Twitter are connecting to the latest technology and useful information they are running in worlds
- Here we can have a look at some of the best Twitter tools that help you increase the followers of your business that not only improve the engagement rate but also increase the productivity of your venture.
1. Twtpoll: This is an awesome tool to perform surveys of any social media audience including Twitter.
The Twtpoll app helps you get the feedback through several means such as questions, quizzes, photos and videos.
This is one of the best ways to empower your Twitter marketing by knowing the audience mindset.
2. TweetReach: This is a cool tool that helps you to quickly obtain an instant analytics report.
The TweetReach lets you do that by instant searching for a username, hashtag, or keyword.
You can figure out the top URLs and hashtags with reference to audience response.
With detailed competitive analysis, you are reported about what works and what doesn’t work in your Twitter marketing campaign.
These are just a few among the many advanced Twitter tools that can really transform your business to a whole new level.
With increase in demand, more and more tools are being designed by enthusiasts to help you get the best out of the Twitter campaign.
We can expect a lot more top tools in the New Year that will take the impact of Twitter presence to an amazing level.
Share this:
3. Twitonomy: This is a great tool exclusively for Twitter marketing that allows you to have a comprehensive visual analytics on mentions, replies, tweets, retweets, hashtags and more.
You may also back up these items with just one click to Excel & PDF.
The Twitonomy app also lets you search, filter, browse, and acquire insights on the accounts you follow and the accounts that follow you.
4. Crowdfire: This advanced Twitter tool lets you utilize your Twitter campaign time more productively by reaching the right people.
The Crowdfire lets you keep track of followers and helps you figure out if there are any inactive accounts in your list.
You may un-follow them and reach out to those who are interested in your tweets which is the prime step in being established on the social network.
5. Twiends: This amazing app lets you grow your Twitter followers absolutely free of cost.
The Twiends app is rich with a directory of users that is categorized by country and interests and there is no better way of growing your audience.
And it also helps you moderate the community to filter inappropriate and fake users. This feature enables to make lasting quality connections.
please like and subscribe
DATA TYPE IN SQL(TEXT DATA TYPES,NUMBER DATA AND DATE DATA TYPE)
MySQL Data Types:
In MySQL, there are three important data types: text, number, and date.
Text data types:
CHAR(size):-Holds a fixed length string (can contain letters, numbers, and special characters). The fixed size is specified in parenthesis. Can store up to 255 characters.
VARCHAR(size):-Holds a variable length string (can contain letters, numbers, and special characters). The maximum size is specified in parenthesis. Can store up to 255 characters.
Note: If you put a greater value than 255 its will be converted to a TEXT type
TINYTEXT:-Holds a string with a maximum length of 255 characters.
TEXT: Holds a string with a maximum length of 65,535 characters.
BLOB: For BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data.
MEDIUMTEXT: Holds a string with a maximum length of 16,777,215 characters.
MEDIUMBLOB: For BLOBs (Binary Large OBjects). Holds up to 16,777,215 bytes of data
LONGTEXT: Holds a string with a maximum length of 4,294,967,295 characters.
LONGBLOB: For BLOBs (Binary Large OBjects). Holds up to 4,294,967,295 bytes of data.
ENUM(x,y,z,etc.) Let you enter a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted...
Note: The values are sorted in the order you enter them.
You enter the possible values in this format: ENUM('X','Y','Z')
SET Similar to ENUM except that SET may contain up to 64 list items and can store more than one choice
Number data type:
TINYINT(size) -128 to 127 normal. 0 to 255 UNSIGNED*. The maximum number of digits may be specified in parenthesis.
SMALLINT(size) -32768 to 32767 normal. 0 to 65535 UNSIGNED*. The maximum number of digits may be specified in parenthesis.
MEDIUMINT(size) -8388608 to 8388607 normal. 0 to 16777215
UNSIGNED*. The maximum number of digits may be specified in parenthesis.
INT(size) -2147483648 to 2147483647 normal. 0 to 4294967295 UNSIGNED*. The maximum number of digits may be specified in parenthesis.
BIGINT(size) -9223372036854775808 to 9223372036854775807 normal. 0 to 18446744073709551615 UNSIGNED*. The maximum number of digits may be specified in parenthesis.
FLOAT(size,d): A small number with a floating decimal point. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter.
DOUBLE(size,d): A large number with a floating decimal point. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter.
DECIMAL(size,d): A DOUBLE stored as a string, allowing for a fixed decimal point. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter.
*The integer types have an extra option called UNSIGNED. Normally, the integer goes from an negative to positive value. Adding the UNSIGNED attribute will move that range up so it starts at zero instead of a negative number.
Date data types:
DATE(): A date. Format: YYYY-MM-DD
Note: The supported range is from '1000-01-01' to '9999-12-31'
DATETIME(): *A date and time combination. Format: YYYY-MM-DD HH:MI: SS
Note: The supported range is from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'
TIMESTAMP(): *A timestamp. TIMESTAMP values are stored as the number of seconds since the Unix epoch ('1970-01-01 00:00:00' UTC). Format: YYYY-MM-DD HH:MI: SS
Note: The supported range is from '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC
TIME() :A time. Format: HH:MI: SS
Note: The supported range is from '-838:59:59' to '838:59:59'
YEAR(): A year in two-digit or four-digit format.
Note Values allowed in the four-digit format: 1901 to 2155. Values allowed in the two-digit format: 70 to 69, representing years from 1970 to 2069
Friday, 25 May 2018
HOW TO RUN JAVA PROGRAM IN NETBEAN IDE
- FIRST DOWNLOAD NETBEAN IDE
WATH VIDEO
please like and subscribe thank you
Find index of element from ArrayList in java
ArrayList indexOf();
In ArrayList indexOf() is used to find the position of the element.if indexOf return -1 value then element is not found in ArrayList
import java.util.*;
public class Findindex {
public static void main(String[] args)
{ArrayList al=new ArrayList();
al.add("50");
al.add("100");
al.add("150");
al.add("200");
al.add("250");
int index=al.indexOf("200");
if(index==-1)
{System.out.println("Element is not found in the list");}
else
{System.out.println("Element found at index:"+index);}
}
}
run:
Element found at index:3
BUILD SUCCESSFUL (total time: 0 seconds)
please like and subscribe thank you
Array and ArrayList in java(difference between Array and ArrayList)
Array:
1): We can't increase or decrease size at runtime.(Array are fixed in size)
example:
class Array
{static public void main(String[] s)
{int []a=new int[10];
a={1};
System.out.println(a[0]);
}
}
output:
1
2) In the form of memory point of view arrays concept is not recommended to use (i.e. arrays size are fixed if we use memory for elements less than arrays size so memory will be wasted).
3) In the form of performance point of view arrays concept is recommended to use (i.e. we know the size of arrays in advance or at compile time so no overhead at runtime that why it takes less time).
4) Arrays can hold homogeneous data elements (i.e. Array elements are of the same type).
5) Arrays don’t provide readymade method support that’s why we can call as arrays are not underlying data structure.
6) Arrays are capable to hold both primitives (byte, short, int, long etc.) and Objects (Wrapper Classes, String, StringBuffer or Any user-defined classes).
example: object type
class Array
{
public static void main(String[] args){
Integer[] ar = new Integer[10];
System.out.println(ar[0]);
}
}
Example 2: For Primitives Type
class ArrayClass{ public static void main(String[] args){ int[] a = new int[10]; System.out.println(a[0]); }}
Output
0
ArrayList:The ArrayList class extends AbstractList and implements the List interface.ArrayList support dynamic that can grow as needed.
Array lists are created with an initial size.When this size is exceeded, the collection is automatically enlarged.When objects are removed, the arry may be shrunk
ArratList hold both primitive and object data type.
We can increase or decrease size of ArrayList at run time.
import java.util.*;
class List{
public static void main(String[] args){
ArrayList a = new ArrayList();
a.add(11);
a.add(22);
a.add(33);
System.out.println(a);
al.add(44);
System.out.println("Basic arraylist are :"+a);
}
}
output:
[11,22,33]
Basic ArrayList are :[11,22,33,44]
- In case of memory point of view ArrayList is recommended to use (i.e. ArrayList size are not fixed memory will be allocated according to ArrayList elements size).
- In case of performance point of view, ArrayList is not recommended to use.
- ArrayList can hold both homogeneous and heterogeneous data elements (i.e. ArrayList elements may be of a different type).
Example:
import java.util.*;
class ArrayListClass{
public static void main(String[] args){
ArrayList al = new ArrayList(10);
al.add("A");
al.add("true");
System.out.println(al);
}
}
- ArrayList provide readymade method support that’s why we can call as ArrayList is underlying data structure.
Example:
import java.util.*;
class ArrayListClass{
public static void main(String[] args){
ArrayList al = new ArrayList(10);
al.add("A");
al.add("true");
al.remove(1);
System.out.println(al.size());
}
}
Output
1
Redymade method:
add(), remove(), size() etc.
please like and subscribe the post thank you
Thursday, 24 May 2018
ARMSTRONG NUMBER PROGRAM IN JAVA
ARMSTRONG NUMBER:
A positive number is called armstrong number if it is equal to the sum of cubes of its digits for example 0, 1, 153, 370, 371, 407 etc.153 = (1*1*1)+(5*5*5)+(3*3*3) =153 The sum of square of given number is equal to that number then number is armstrong otherwise number is not armstrong.
- LETS UNDERSTAND 153 IS ARMSTRONG NUMBER OR NOT
153=(1*1*1)+(5*5*5)+(3*3*3)
(1*1*1)=1
(5*5*5)=125 (
3*3*3)=27
So: 1+125+27=153 (VALUE IS SAME THEN THE NUMBER IS ARMSTRONG)
371 = (3*3*3)+(7*7*7)+(1*1*1)
where: (3*3*3)=27 (7*7*7)=343 (1*1*1)=1 So: 27+343+1=371
PROGRAM TO CHECK WHETHER THE GIVEN NUMBER IS ARMSTRONG OR NOT:
import java.util.*;
Armstrong{
public static void main(String[] args) {
int c=0,a,temp;
System.out.println("enter the number to check number is armstrong");
int n=in.nextInt();//or int a=153;
temp=n; while(n>0) {
a=n%10;
n=n/10;
c=c+(a*a*a);
}
if(temp==c)
System.out.println("armstrong number");
else
System.out.println("Not armstrong number");
}
}
output;
enter the number to check number is armstrong 371
armstrong number
HOW TO DECLARE AND INITIALIZE AN ARRAY IN JAVA
JAVA ARRAY:
There is many way to declare and initialize array element in java programming.
1)when you initialize the array then your write-
a)Type 1:
a)Type 1:
Instantiation of and Array in java:
class Arraytest{
OUTPUT:
Output: 20
SIMPLE PROGRAM TO GET THE VALUE FROM THE USER:
import java.util.Scanner;
OUTPUT:
There is many way to declare and initialize array element in java programming.
There is two way to write array in java
1)when you initialize the array then your write-
a)Type 1:
int[] arr={30,40,50,60};
b)Type 2:
int []arr={30,40,50,60};
c)Type 3:
int arr[]={30,40,50,60};
2)when you declare the array and you want to set value from user then you can declare array in different format like this-(This is also known as Instantiation)
a)Type 1:
int arr2[]=new int[];
b)Type 2:
int arr2[]=new int[]={23,45,67,9};
c)Type 3:
int arr2;
arr2=new int[];
Instantiation of and Array in java:arrayRefVar=new datatype[size];
SIMPLE PROGRAM OF SINGLE DIMENSION ARRAY IN JAVA
class Arraytest{
public static void main(String args[]){
int a[]=new int[5];//declaration and instantiation
a[0]=20;//initialization
a[1]=45;
a[2]=34;
a[3]=46;
a[4]=5056;
//printing The array element
for(int i=0;i<a.length;i++)//length is the property of array
System.out.println(a[i]);
}}
OUTPUT:
Output: 20
45
34
46
5056
SIMPLE PROGRAM TO GET THE VALUE FROM THE USER:
import java.util.Scanner;
public class ArraySum
{
public static void main(String[] args)
{
int no, sum = 0;
Scanner in = new Scanner(System.in);
System.out.print("Enter no. of elements");
no = in.nextInt();
int a[] = new int[no];
System.out.println("Enter all the elements:");
for(int i = 0; i < n; i++)
{
a[i] = in.nextInt();
sum = sum + a[i];
}
System.out.println("Sum:"+sum);
}
OUTPUT:
Enter no. of elements:5
Enter all the elements:
1
2
4
6
7
Sum:20
Wednesday, 23 May 2018
How to run java program with the help of command promt
1.FIRST DOWNLOAD THE JAVA JDK AND JRE ON YOUR SYSTEM
CLICK TO DOWNLOAD :Java SE Downloads
CLICK TO DOWNLOAD :Java SE Downloads
2.INSTALL JDK ON YOUR SYSTEM
3.CREATE YOUR JAVA FILE USING .JAVA EXTENSION
4.OPEN YOUR C DRIVE
5.OPEN YOUR PROGRAM FILE
6.NOW OPEN YOUR JAVA FILE
7.AFTER OPEN YOUR JAVA FILE THEIR IS FOLDER OF JDK AND OPEN IT
8.NOW COPY THE ADDRESS OF THAT LOCATION AND WRITE SETPATH="PASTE YOUR ADDRESS HERE" THEN CLICK
9.AFTER CLICKING WRITE CD ADDRESS OF YOUR JAVA PROGRAM FOLDER AFTER CD
10.RUN THE PROGRAM USING COMMAND PROMPT
Why java is platform independent
Fist know about platform independent :
- java is platform independent because of Bytecode(i.e byte code is machine understandable code of jvm(java virtual machine)
- The process of java bytecode execution:
simple.java → javac(simple.class)→jvm(simple.obj)→display final output
- Source code is used by java compiler and converted that code in .class file and the class file code is in byte code form and that class file is used by jvm and again to convert into object file and then after display final output on the screen
- java is platform independent language because we can run .class file in any operating system like(MAC,LINUX AND WINDOWS)
- jAVA compiler converts source code to bytecode and bytecode is not designed for a specific operating system understandable.
- JVM reads bytecode and translate bytecode to specifc operating system understandable form.
- bytecode are also known as jvm understandable code or intermediate code .
- bytecode is remain same in all operating system it doesn't care about any operating system at all.
DATA TYPE IN JAVA
DATA TYPE:
Different data type allow you to select the type appropriate to the needs of the application Data type in java are classified into two types:Different type of Data types for different type of value
Different data type allow you to select the type appropriate to the needs of the application Data type in java are classified into two types:Different type of Data types for different type of value
PRIMITIVE DATA TYPES-
1)-Integer
Integer types can hold whole number such as 345 and -3435.The size of the values that values that can be stored depends on the integer type that we choose.
Type Size Default value Range of values that can be
stored
byte 1 byte 0 -128 to 127
stored
byte 1 byte 0 -128 to 127
short 2 byte 0 -32768 to 32767
int 4 bytes 0 -2,147,483,648 to
2,147,483,647
2,147,483,647
long 8 bytes 0L 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
2)-Floating point:
Floating point data types are used to represent numbers with a fractional part.Single precision floating point number occupy 4 bytes and Double precision floating point number occupy 8 bytes.There are two subtypes:
Type Size Default value Range of values that
can be stored
float 4 byte 0.0f -3.4e-038 to 3.4e+038
can be stored
float 4 byte 0.0f -3.4e-038 to 3.4e+038
double 8 byte 0.0d 1.7e-308 to 1.7e+038
3)Character
It stored character constants in the memory.It assumes a size of 2 bytes,but basically it can hold only a single character because char stores unicode character sets.It has a minimum value of 'u0000'
and a maximum value of 'uffff'
Type Size Default value
char 2 byte '\u00000'
String null 2147483647(2pow(31)-1)
4)-Boolean
Identifiers are name provided by you.These can be assigned
to variables,method,functions,classes etc.
BOOLEAN IN THE FORM OF TRUE AND FALSE
What is jdk,jre and jvm in java(difference between them)
1)jdk:
Java development kit is Kit which provides the environment to develop and execute(run) the java program.
JDK include two things :
- Development Tools to provide an environment to develop your java program
- JRE to execute your java program
- JDK=JRE(JVM + Libraries) +Developer Tools //jdk is the combination of jre and Development tools
- jdk Development tools like Compiler,debugger etc.
- jdk is a 3 step process
- Write java code
- Compile java code
- Execute java code
NOTE:JDK IS ONLY USED FOR JAVA DEVELOPERS.
2) JRE
Java Runtime Environment :is an installation package which provides environment to only run(not develop) the java program onto your machine.JRE is only used by them who only wants to run the java programs.
WHAT IS THE MINING OF THESE SENTENCE LET'S UNDERSTAND:
Ex:you run the software which is develop with the help of java ide you only run the software(execute) not edit the source code and not change in any feature you have only JRE to run and execute the software.
- JRE contains sets of libraries and JVM use tose libraries at Runtime.
- JRE=JRE(JVM+LIBRARIES) it means JRE is a combination of JVM AND LIBRARIES
- To run any code JRE is minimum required
3) JVM
JAVA VIRTUAL MACHINE :is an abstract machine.It is a specification that provides runtime environment in which java bytecode can be executed.
JVM are available for many hardware and platforms(i.e. JVM is platform dependent)
- whenever you write java command on the command prompt to run the java class, the java class,an instance of JVM is created.
- THE JVM PERFORMS FOLLOWING OPERATION:
- Load code
- Verifies code
- Executes code
- provides runtime environment
- JVM PROVIDES DEFINITIONS FOR THE:
Subscribe to:
Posts (Atom)
-
ArrayList indexOf(); In ArrayList indexOf() is used to find the position of the element.if indexOf return -1 value then element is not...







