Anvi Jain has Published 629 Articles

Counting presence of a NOT NULL value in MySQL

Anvi Jain

Anvi Jain

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

564 Views

To count presence of a NOT NULL value, use aggregate function COUNT(yourColumnName). Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    NumberOfQuestion int,    NumberOfSolution int    ); Query OK, 0 rows affected (0.20 sec)Insert some records in ... Read More

Java DatabaseMetaData getMaxRowSize() method with example.

Anvi Jain

Anvi Jain

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

36 Views

The getMaxRowSize() method of the DatabaseMetaData interface is used to find out the maximum number of bytes that the underlying database allows in a row.This method returns an integer value, representing the maximum row size. If this value is 0 it indicates that there is no limit or, limit is ... Read More

How can I find all columns where the column name length is greater than 5 in MySQL?

Anvi Jain

Anvi Jain

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

104 Views

Use HAVING to find all columns where the column name length is greater than 5. This will produce the following output −+-------------------+-------------------------+ | TABLE_NAME        | COLUMN_NAME             | +-------------------+-------------------------+ | DemoTable         | UserId           ... Read More

How can I calculate the total value of products from my MySQL product table?

Anvi Jain

Anvi Jain

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

466 Views

Let us first create a table −mysql> create table DemoTable    (    ProductId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ProductQuantity int,    ProductPrice int    ); Query OK, 0 rows affected (0.19 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ProductQuantity, ProductPrice) values(10, 100); ... Read More

Java DatabaseMetaData getMaxTablesInSelect() method with example.

Anvi Jain

Anvi Jain

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

24 Views

The getMaxTablesInSelect() method of the DatabaseMetaData interface is used to find out the maximum number of tables that the underlying database allows in an SQL SELECT statement.This method returns an integer value, representing the maximum number of tables allowed in a SELECT statement. If this value is 0 it indicates ... Read More

MySQL filtering by multiple columns?

Anvi Jain

Anvi Jain

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

2K+ Views

To perform filtering by multiple columns, use where clause along with OR. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(10),    Score int    ); Query OK, 0 rows affected (0.28 sec)Insert some records in ... Read More

Java DatabaseMetaData getMaxSchemaNameLength() method with example.

Anvi Jain

Anvi Jain

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

28 Views

The getMaxSchemaNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a schema.This method returns an integer value, representing the maximum number of characters allowed in a schema name. If this value is 0 it ... Read More

How can I order in group but randomly with MySQL?

Anvi Jain

Anvi Jain

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

257 Views

Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Value char(1)    ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Value) values('X'); Query OK, 1 row affected ... Read More

HTML

Anvi Jain

Anvi Jain

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

582 Views

The value attribute of the element is used to set the initial value of a button. You can set this in a . Here, we will be showing an example without using a form.Following is the syntax −Above, value is the initial value.Let us now see an example to ... Read More

How to set all the Arrow Buttons in a frame with Java?

Anvi Jain

Anvi Jain

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

210 Views

To set arrow buttons in a frame, let us first create a frame −JFrame frame = new JFrame();Now, set the layout for the frame wherein all the arrow buttons would be displayed −frame.setLayout(new GridLayout(0, 5));Set the arrow buttons for all the locations −frame.add(new BasicArrowButton(BasicArrowButton.EAST)); frame.add(new BasicArrowButton(BasicArrowButton.NORTH)); frame.add(new BasicArrowButton(BasicArrowButton.SOUTH)); frame.add(new BasicArrowButton(BasicArrowButton.WEST));The ... Read More

Advertisements