Sharon Christine has Published 433 Articles

HTML DOM Input Month form Property

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

73 Views

The HTML DOM input month form property returns the reference of the form that contains the month input field in the HTML document.SyntaxFollowing is the syntax −object.formExampleLet us see an example of HTML DOM input month form property − Live Demo    body{       text-align:center; ... Read More

HTML DOM Input Number form Property

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

60 Views

The HTML DOM input number form property returns the reference of the form that contains the number input field in the HTML document.SyntaxFollowing is the syntax −object.formExampleLet us see an example of HTML DOM input number form property − Live Demo body{ ... Read More

Program to calculate area and perimeter of equilateral triangle

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

278 Views

Tringle is a closed figure with three sides. An equilateral triangle has all sides equal. Area and perimeter of an equilateral triangle can be found using the below formula, Area of equilateral triangle = (√3)/4*a2Perimeter of equilateral triangle = 3 * aLogic of CodeTo find the area of an equilateral ... Read More

Program to calculate area and volume of a Tetrahedron

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

261 Views

A tetrahedron is a pyramid with triangular base i.e. it has a base that is a triangle and each side has a triangle. All the three triangles converge to a point. As in the figure, Code Logic − The code to find the area and volume of tetrahedron uses the ... Read More

Program to calculate area of Enneagon

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

108 Views

An enneagon also known as nonagon is a polygon with 9 sides. To calculate the area of enneagon the following formula is used, Area of ennagon = ((a2*9) / 4*tan (20°)) ∼= (6.18 * a2)Code Logic, The area of a polygon with nine sides is calculated by using the formula, ... Read More

Program to calculate Area Of Octagon

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

426 Views

An octagon is a polygon with eight sides. To calculate the area of octagon the following formula is used, Area of octagon = ((a2*2) / *tan (22.5°)) = ((2*a*a)(1+√2))Code Logic, The area of a polygon with eight side is calculated by using the above formula. The expression uses sqrt function ... Read More

How to count the number of occurrences of a specific value in a column with a single MySQL query?

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

816 Views

For this, you can use GROUP BY clause along with IN(). Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Name varchar(100)    -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in ... Read More

MySQL queries to update date records with NULL values

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

800 Views

You can use IFNULL() for this. Let us first create a table −mysql> create table DemoTable -> ( -> added_date date, -> updated_date date -> ); Query OK, 0 rows affected (0.95 sec)Insert some records in the table ... Read More

Retrieving MySQL Database structure information from Java?

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

334 Views

Use DatabaseMetaData class to retrieve MySQL database structure. In this example, we will display all the table names of database “web” using Java with the help of getMetaData().Following is the Java code −Exampleimport java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import com.mysql.jdbc.DatabaseMetaData; public class getDatabaseInformationDemo {    public static ... Read More

Add a new column and index to an existing table with ALTER in a single MySQL query?

Sharon Christine

Sharon Christine

Updated on 30-Jul-2019 22:30:26

345 Views

To add a new column to an existing table, use ADD. With that, to add a new index, use the ADD INDEX(). Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Name varchar(100),    -> PRIMARY KEY(Id) ... Read More

Advertisements