Essentials of Information and Technology File: Submittedto: Submittedby
Essentials of Information and Technology File: Submittedto: Submittedby
INFORMATION AND
TECHNOLOGY
FILE
SubmittedTo: SubmittedBy:
Mrs.SHIKHA CHAUDHARY BHAVESH KASHYAP
Asst. Prof (CSE) CSE ‘A’ (4TH SEM)
251702067
INDEX
Select Insert
Update Delete
1 Create Table Salesman and Customer
mysql> Select *from Customers where ID IN (Select ID from Customers where Salary>50000);
mysql> Insert into Customer Select *from Customers where ID IN(Select ID from Customers);
mysql> Update Customers set Salary=Salary*0.25 where Age IN (Select Age from Customer
where Age>20);
4 Sub-Query with the DELETE Statement
mysql>Delete from Customers where Age IN (Select Age from Customer where Age>20);
Set Operations
Union Intersection
OrderBy Minus
mysql> Select *from Salesman where Age=20 UNION Select * from Customer where Age=20;
mysql> Select *from Salesman where Age=20 UNION Select * from Customer where Age=20
ORDER BY 2;
PROGRAM NO. - 3
Aim : To study SQL Queries for Join operations in RDBMS
Join Operations
Create Drop
Update Delete
1 Create A view of table Salesman
OUTPUT:
PROGRAM NO. - 6
AIM: Implement bubble sort in raptor.
Z X Y
X Y
Z
C A
B
A
C B
OUTPUT:
PROGRAM NO. - 7
Aim: Implement swapping in raptor.
OUTPUT:
PROGRAM NO. - 8
AIM: Write a Program to implement Fibonacci series in java.
import java.util.Scanner;
public class NewClass {
public static void main(String[] args)
{ int ch=1;
while(ch==1){
int a=0,b=1;
Scanner in=new Scanner(System.in);
System.out.println("Enter the number of elements ");
int n=in.nextInt();
if(n==0)
System.out.println("Enetr a valid number (you entered 0)");
if(n==1)
{ System.out.print(a+" "); }
else {
System.out.print(a+" "+b); }
n=n-2;
for(int i=0;i<n;i++)
{ int c=a+b;
a=b;
b=c;
System.out.print(" "+c); }
System.out.println("\nEnetr 1 to repeat and anything else to exit");
ch=in.nextInt(); } } }
OUTPUT:
PROGRAM NO. - 9
AIM: Write a Program to implement inheritance in java.
package inheritance;
import java.util.Scanner;
class Box {
private double width;
private double height;
private double depth;
Box(double w, double h, double d) {
width = w;
height = h;
depth = d;}
Box() {
width = -1;
depth = -1;
height = -1; }
Box(double len) {
width = height = depth = len; }
double volume() {
return width * height * depth;
}}
class BoxWeight extends Box {
double weight;
BoxWeight(double w, double h, double d, double m) {
super(w, h, d);
weight = m;
}
BoxWeight() {
super();
weight = -1;
}
BoxWeight(double len, double m) {
super(len);
weight = m;
}
}
public class Inheritance {
public static void main(String[] args) {
double l,b,h,m;
Scanner sc = new Scanner(System.in);
System.out.println("Enter length , width and height:");
l = sc.nextDouble();
b = sc.nextDouble();
h = sc.nextDouble();
System.out.println("Enter weight of cuboid: ");
m = sc.nextDouble();
BoxWeight mybox1 = new BoxWeight(l,b,h,m);
double vol;
vol = mybox1.volume();
System.out.println("Volume of myBox1 is : " + vol);
System.out.println("Weight of myBox1 is : " + mybox1.weight);
System.out.println("");
vol = mycube.volume();
System.out.println("Volume of mycube is : " + vol);
System.out.println("Weight of mycube is : " + mycube.weight);
System.out.println("");
}
}
OUTPUT:
PROGRAM NO. - 10
AIM: Write a Program to implement overloading in java.
public class NewClass {
public static void main(String[] args)
{
System.out.println("5+6="+sum(5,6));
System.out.println("5+6+7="+sum(5,6,7));
System.out.println("5+6+7+8="+sum(5,6,7,8));
}
private static int sum(int i, int j) {
return i+j;
}
private static int sum(int i, int j, int k) {
return i+j+k;
}
}
OUTPUT:
PROGRAM NO. - 11
AIM: Write a Program to implement command line arguments in java.
OUTPUT:
PROGRAM NO. - 12
AIM: Write a Program to implement static methods in java.
public class NewClass {
public static void main(String[] args) {
display();
NewClass t = new NewClass ();
t.show();
}
static void display() {
System.out.println("This is static method.");
}
void show(){
System.out.println("This is non static method");
}
}
OUTPUT: