Posts

Print Prime Numbers Hackerrank Solution - PL/SQL

Image
 Print Prime Numbers Hackerrank Solution - PL/SQL For Explanation watch video: Code:: set serveroutput on; declare output clob := ''; co number; begin  for i in 2..1000 loop      co := 0;      for j in 2..(i/2) loop        if mod(i,j)=0          then            co := 1;            exit;         end if;     end loop;     if co = 0      then        output :=  output || i ||'&';     end if;     end loop;     dbms_output.put_line(substr(output,1,length(output)-1)); end; /

Java BitSet Hackerrank Solution

Image
 Java BitSet Hackerrank Solution For Explanation Watch video:: Sample Input 5 4 AND 1 2 SET 1 4 FLIP 2 2 OR 2 1 Sample Output 0 0 1 0 1 1 1 2 Code: import  java.io.*; import  java.util.*; public   class  Solution {      public   static   void  main(String[] args) {         Scanner s =  new  Scanner(System.in);          int  n = s.nextInt();          int  m = s.nextInt();         BitSet b1 =  new  BitSet(n);         BitSet b2 =  new  BitSet(n);          for ( int  i= 0 ;i<m;i++){             String ip = s.nex...

Draw The Triangle 2 Hackerrank Solution - SQL

Image
 Draw The Triangle 2 Hackerrank Solution - SQL  for explanation watch video: Code:: set serveroutput on; declare res clob; begin  for i in 1..20 loop      res := '';      for j in 1..i loop        res := res || '*' || ' ';      end loop;      dbms_output.put_line(res);  end loop; end; /

Draw The Triangle 1 Hackerrank Solution - SQL

Image
 Draw The Triangle 1 Hackerrank Solution - SQL For Explanation Watch video: Code:: set serveroutput on; declare res clob; begin for i in reverse 1..20 loop res := ''; for j in 1..i loop res := res || '*' || ' '; end loop; dbms_output.put_line(res); end loop; end; /

Dispaly top n rows in SQL | Display last n rows in SQL | Display nth Row in SQL

Image
  For Explanation watch video:: * rownum ======= fetching top 1,2,5 rows fetching the 2nd row from table Fetch last two roes

Hibernate – save image into database | save files into database using hibernate

Image
 Hibernate – save image into database  For Explanation watch video:: Directory Structure:: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>ImgFile</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>ImgFile</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.9</maven.compiler.source> <maven.compiler.target>1.9</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> ...

Java Dequeue Hackerrank Solution

Image
 Java Dequeue Hackerrank Solution For Explanation watch video: Sample Input 6 3 5 3 5 2 3 2 Sample Output 3 Code:      import  java.util.*;      public   class  test {          public   static   void  main(String[] args) {             Scanner in =  new  Scanner(System.in);             Deque deque =  new  ArrayDeque<>();              int  n = in.nextInt();              int  m = in.nextInt();              int  max = - 1 ;          ...