0% found this document useful (0 votes)
8 views22 pages

Java and SQL Programming Exercises

Uploaded by

purisaroj24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views22 pages

Java and SQL Programming Exercises

Uploaded by

purisaroj24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JAVA

1) the number is odd or even

Programming Code:

Input:

Output:
2) count number of digit in a number

Programming Code:

Input:

Output:
3) factorial of a number
Code:

Input:

Output:

4) whether the number is Armstrong or not


code:
Input:

Output:

5) convert string into UPPERCASE, lowercase


code:

Input:

Output:

6) program count number of vowels, special symbol, no. of spaces


code:
Input:

Output:

7) to reverse a string
code:
Input:

Output:

8) check whether the string is palindrome or not


code:

Input:
Output:

9) number is prime or not


code:

Input:

Output:

10) Fibonacci series till 10th element


Code:

Output:

11) to add 2 numbers with the use of class and object method

code:
Input:

Output:

12) print age of a person using constructor and age should be


passed through argument
code:
Input:

Output:

13) to catch an expectation for dividing error


code:
Input:

Output:

14) create multiple threads


code:
Output:

15) find sum of the elements of an array


code:
Input:

Output:
SQL

Table used: STUDENT


1) Create Database

Output:

2) Create Table

Output:

3) Insert 10 records:
Output

4) Select With > and <

Output:
Query:
Output:

5) Display NULL Values

Output:

6) Update a Record
Output:

7) Between command

Output:

8) IN / NOT IN

Output:
Not in example:

Output:

9) Like command

Output:

10) ALTER TABLE

Output:
11) Order by

Output:

12) Group By:

Output:
13) GROUP BY With HAVING

Output:

14) Add Primary Key

15) Delete a Record Output

You might also like