Skip to main content

Posts

Hackerrank Designer PDF Viewer Solution - Java

 Hackerrank Designer PDF Viewer Solution - Java For Explanation Watch Video:: Code:: import  java.io.*; import  java.math.*; import  java.security.*; import  java.text.*; import  java.util.*; import  java.util.concurrent.*; import  java.util.function.*; import  java.util.regex.*; import  java.util.stream.*; import   static  java.util.stream.Collectors.joining; import   static  java.util.stream.Collectors.toList; class  Result {      /*      * Complete the 'designerPdfViewer' function below.      *      * The function is expected to return an INTEGER.      * The function accepts following parameters:      *  1. INTEGER_ARRAY h      *...

Drop Command (DDL) in SQL Oracle With Implementation

 Drop Command (DDL) in SQL Oracle With Implementation For Explanation Watch Video:: Drop Command Used to delete  table (rows X columns) EX::: 1)Create table SQL> create table emp01(fname varchar2(15),sal Number(10)); Table created. 2)Describe table SQL> desc emp01;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  FNAME                                              VARCHAR2(15)  SAL                                                NUMBER(10) SQL> select * from emp01; no rows selected 3)Insert values into table SQL> insert into ...

Hackerrank Write a function Solution - Python

 Hackerrank Write a function Solution - Python For Explanation Watch Video:: Code:: def  is_leap(year):     leap =  False           if  year %  400  ==  0 :         leap =  True      elif  year% 4 == 0   and  year% 100 != 0 :         leap= True      return  leap year =  int ( input ()) print (is_leap(year))

Hackerrank Sales by Match Solution - Java

Hackerrank Sales by Match Solution - Java  For Explanation watch video : Code:: import  java.io.*; import  java.math.*; import  java.security.*; import  java.text.*; import  java.util.*; import  java.util.concurrent.*; import  java.util.function.*; import  java.util.regex.*; import  java.util.stream.*; import   static  java.util.stream.Collectors.joining; import   static  java.util.stream.Collectors.toList; class  Result {      /*      * Complete the 'sockMerchant' function below.      *      * The function is expected to return an INTEGER.      * The function accepts following parameters:      *  1. INTEGER n      *  2....

JDBC program for truncate table

 JDBC program for truncate table for explanation watch video:: Before Execution Of Program:: SQL> select * from test1;        EID ENAME ---------- ----------          1 raja          2 Jhon CODE:: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.*; public class College { public static void main(String[] args)throws Exception{ Connection con =  DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","tiger"); Statement st = con.createStatement(); //write query String query = "truncate table test1"; //execute  int count = st.executeUpdate(query); if(count==0){ System.out.println("Table is truncated"); }else{ System.out.println("Table is not truncated"); } con.close(); } } After Execution of Program:: ====================== SQL...

JDBC application For Dropping table

 JDBC application For Dropping table For Explanation Watch Video::: Before Execution Of code:: SQL> desc test2;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  EID                                                NUMBER(38)  ENAME                                              VARCHAR2(10) Code::: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.*; public class College { public static void main(String[] args)throws Exception{ ...

Creating table Using JDBC Application

 Creating table Using JDBC Application For Explanation Watch Video: EX1:: Code:: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.*; public class Test1 { public static void main(String[] args)throws Exception{ Connection con =  DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","tiger"); Statement st = con.createStatement(); //query String query = "create table test2(eid int,ename varchar2(10))"; //execute the query int count = st.executeUpdate(query); if(count==0){ System.out.println("Table is created"); }else{ System.out.println("Table is not created"); } con.close(); } } After Execution Of Program Table:: SQL> desc test2;  Name                                      Null?    Type ...