0% found this document useful (0 votes)
14 views1 page

Java and Mysql

The document contains a series of programming tasks in Java, including printing squares of numbers from 1 to 5, determining if a number is even or odd, and sorting an array of strings alphabetically. It also outlines the creation of a 'Teacher' table with specified fields and sample data, along with queries to display the table contents, update a teacher's salary, and delete a column from the table. These tasks cover basic programming and database manipulation concepts.

Uploaded by

maxpuhan
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)
14 views1 page

Java and Mysql

The document contains a series of programming tasks in Java, including printing squares of numbers from 1 to 5, determining if a number is even or odd, and sorting an array of strings alphabetically. It also outlines the creation of a 'Teacher' table with specified fields and sample data, along with queries to display the table contents, update a teacher's salary, and delete a column from the table. These tasks cover basic programming and database manipulation concepts.

Uploaded by

maxpuhan
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
You are on page 1/ 1

a) Write a program in java to print the squares of numbers from 1 to 5

b) Write a program in java to show a number is even or odd.


c) Write a program in java to sort an array of string in alphabetic order.
d) Create a table “Teacher” having the following fields.

TID Name Gender Salary

101 P F 45000

102 Q M 52000

103 R M 49000

104 S F 51500

e) Show the contents inside the above table .


f) Write a query to update salary of the teacher to 48000 whose TID is 101.
g) Write a query to delete the column “Gender”.

You might also like