Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website 😊
Still working on it 😊
Download Telegram
The INNER JOIN keyword selects all rows from both the tables as
long as the condition satisfies. This keyword will create the
result-set by combining all rows from both the tables where the
condition satisfies i.e value of the common field will be the same
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
[9/27, 12:19] ENTREPRENEUR: What is Left Join in SQL?
The Left Join is used to fetch all rows from the left-hand table and
common records between the specified tables.
It returns all the rows from the left-hand side table even though there
are no matches on the right-hand side table.
If it does not find any matching record from the right side table, then it
returns null. This join can also be called a Left Outer Join.
What is the Right JOIN in SQL?
The Right join is used to retrieve all rows from the right-hand table and
only those rows from the other table that fulfill the join condition.
It returns all the rows from the right-hand side table even though there are
no matches in the left-hand side table.
If it finds unmatched records from the left side table, it returns a Null
value. This join is also known as Right Outer Join.
What is self-join and what is the requirement of
self-joining?
A SELF JOIN is used to join a table with self. This join can be performed
using table aliases, which allow us to avoid repeating the same table name
in a single sentence. It will throw an error if we use the same table name
more than once in a single query without using table aliases.
A SELF JOIN is required when we want to combine data with other data in
the same table itself. It is often very useful to convert a hierarchical
structure to a flat structure
[9/27, 12:19] ENTREPRENEUR: The following syntax illustrates the SELF JOIN:
SELECT column_lists
FROM table1 AS T1, table1 AS T2
WHERE join_conditions;
Highest Salary
SELECT name, MAX(salary) as salary
FROM employee
Second highest Salary
Using nested
SELECT name, MAX(salary) AS salary
FROM employee
WHERE salary < (SELECT MAX(salary)
FROM employee);
SELECT salary
FROM employee
ORDER BY salary desc limit 1,1
Third Highest Salary:
SELECT name, MAX(salary) AS salary
FROM employee
WHERE salary < (SELECT MAX(salary)
[9/27, 12:20] ENTREPRENEUR: FROM employee
WHERE salary < (SELECT MAX(salary)
FROM employee) );
● SELECT salary
FROM employee
ORDER BY salary desc limit 2,1
Find Nth highest element
● SELECT salary
FROM employee
ORDER BY salary desc limit n-1,1
JOIN K CODES
i)
SELECT IF(GRADE < 8, NULL, NAME), GRADE, MARKS
FROM STUDENTS JOIN GRADES
WHERE MARKS BETWEEN MIN_MARK AND MAX_MARK
ORDER BY GRADE DESC, NAME
[9/27, 15:38] ENTREPRENEUR: import java.util.*;


class Employee extends Main {

int id;
String name;
Double salary ;
Employee (int id, String name, double salary)
{
this.id=id;
this.name=name;
this.salary=salary;
}

}
public class Main {

public static void main(String[] args)
{
Scanner sc=new Scanner (System.in);
List<Employee>List =new ArrayList<Employee>();

System.out.println("Enter 5 Details : ");

for (int i=1; i<=5; i++) {
System.out.println("Emp-"+ i + " : ");
int id =sc.nextInt();
String name=sc.next();
double salary=sc.nextDouble();

Employee e=new Employee (id,name,salary);
List.add(e);
}
System.out.println("Details are : ");
Iterator <Employee>itr= List.iterator();
while (itr.hasNext()) {
Employee e=itr.next();
System.out.println(e.id+ " : " +e.name + " : " + e.salary);

}
}

}
[9/29, 16:55] ENTREPRENEUR: //Find sum of n numbers through threading ...


import java.util.*;
public class Defaults {
static int n ;
public static void main(String[] args) {
Scanner x = new Scanner(System.in);
System.out.print("Sum of N numbers ");
System.out.print("Enter N number ");
n = x.nextInt();
Calculation Thread = new Calculation();
Thread.start();
try{
Thread.join();}
catch(Exception e ){}
System.out.print("Sum "+Calculation.sum);
}
}
class Calculation extends Thread{
static int sum =0;
public void run(){
System.out.print("Calc Started ");
for(int i = 1 ; i<= Defaults.n ; i++){
Calculation.sum= Calculation.sum+i;
}
System.out.print("Calc ends ");
}
}
[9/30, 14:43] ENTREPRENEUR: // Thread synchronization


import java.util.*;
import java.lang.*;

public class Number{

static int x;
synchronized static void increment(){
x++;
}
}
class First extends Thread {
public void run(){
for(int i= 1 ; i<= 100000 ; i++){
Number.increment();
}
}
}
class Second extends Thread{
public void run(){
for(int i= 1 ; i<= 100000 ; i++){
Number.increment();
}
}
}
class Synchronization{
public static void main(String[] args) {
First f = new First();
Second s = new Second();
f.start ();
s.start();
try{
f.join();
s.join();
} catch (Exception e ){
}
System.out.println("Final x value " + Number.x);
}
}
[9/30, 14:52] ENTREPRENEUR: // creating threads using runnable interface

//runnable interface has only one specification called run()
// we can't start runnable object directly
// we can create the thread object by passing runnable object as parameter
// we can execute the thread logic by starting thread '

public class Main {
public static void main(String[] args) {
First f = new First ();
// f.start (); error
Thread t = new Thread (f);
t.start();
}
}
class First implements Runnable {
public void run(){
System.out.print("thread logic ");
}
}
New code starts after enterpreneur message just copy paste
70codes almost here
😊😊
Some db questions also mentioned
Get ready for tomorrow's drive make it super 😊 good luck
You can share this link with your friends so that they can also get almost all basics codes n everything depending upon their requirement
Photo from ENTREPRENEUR
Starting at the methods static and default methods starting at

Functionalities
Lambda expressions
ForEach method
Method references
Stream API

Using Java using Java technology application development pickup easy millions of millions of applications developed security reasons applications application development process that is increasing traffic YouTube Uploading Facebook So that's why Everyone is not looking for the application development technology is looking for find technology that process the data much faster So that's who thinks one is what So whenever processing that you consider data processing Can you everyone minds only two technologies language and to avoid of uses weekly and easily This is the only reason Just processing Stacking methods
85 minut

What's the how to learn on the concepts
Introduction of Paris metronome very very important reco Is it the only matter expressions Why all basic concepts what they are using in jdk8

Interfaces
Some of the points about the interface Can you define Can we define the method with the body on variables
variables are bydefault public static final.
Collections of abstract methods
And final Whenever you are writing the variable by the time only you should assign the value See that's equals to expected equals to expected Whenever you assign value easy Everyone is thinking that it's intense variable no is public static val how to access How can you prove his final final you cannot quantify the value See if you're trying to quantify the value first A equals to 20 I'm trying to assign the value is 20 cannot assign a value to final variable a is variables are aflix static final how to access a static variables using interface And this is final only one time value is allowed second How can we define another methods

Any class implements Can implements the interface

Implemented class implemented class implemented class overwrite all abstract methods Okay inside I'm trying to write the method
The methodr with body not allowed methods are bydefault Don't need to mention public publico I'm taking one class expect means update name I'm taking second Update means presently modif will be present everything you have to implement That's implements interface what is the class public What's the default access modifier what is access What is the use of access modifier Is used to accessing
Can we apply Access modifiers to blocks
It is public When If you don't represent anything It will take one different package level it is public means it must be publicly So whenever you are trying to compile you will get addressed first So that's must as a public Here it is not visible publicly
And then you create object for interface You cannot read off object or interface directly create option for one class second Whenever you are creating objects for implemented class What is the method namem one is a method
Whenever you create objects for implemented class the ncall
Since JDK 8, It is allowed to define Next static and default methods We access the static methods using the identity of interface an extract method default through object reference
Static
The body definition
Default What is a static method
The second one is
Abstract methods
So in the child class
I can how to access only one type of variable is allowed

Of variable method last name Next I want to access default methods object reference how to create d object Tell me
First obj = new. second()

What type of methods

Static methods
As it is automated some spelling mistakes possible