Select Only MySQL Date from Datetime Column

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

548 Views

Use DATE_FORMAT for this. Let us first create a table −mysql> create table DemoTable    (    ShippingDate varchar(200)     ); Query OK, 0 rows affected (0.25 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('04:58 PM 10/31/2018'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values('02:30 AM 01/01/2019'); Query OK, 1 row affected (0.07 sec) mysql> insert into DemoTable values('12:01 AM 05/03/2019'); Query OK, 1 row affected (0.06 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+---------------------+ | ... Read More

What is Bitcoin's Lightning Network?

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

162 Views

Ever since Bitcoin came into existence in 2008, scalability has been one of the important drawbacks. Well, let us understand what is the scalability. Bitcoin is capable of processing around 7 transactions per second, when compared to 24, 000 transactions per second by Visa. Given the magnitude of increase in transactions every day, the system is getting congested for the last few years. One more issue with this is, more time a transaction takes, it uses the more resources and thereby increasing the transaction fees.The Bitcoin’s Lightning Network came up as a solution for this problem. This is being tested ... Read More

Add JTable to Panel in Java Swing

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

3K+ Views

To add JTabel to Panel, let us first crerate a panel −JPanel panel = new JPanel();Now, create JTable and add rows and columns with the records −String[][] rec = {    { "1", "Steve", "AUS" },    { "2", "Virat", "IND" },    { "3", "Kane", "NZ" },    { "4", "David", "AUS" },    { "5", "Ben", "ENG" },    { "6", "Eion", "ENG" }, }; String[] header = { "Rank", "Player", "Country" }; JTable table = new JTable(rec, header);Add the above created table to panel −panel.add(new JScrollPane(table));The following is an example to add JTabel to Panel in Java ... Read More

Determine Squares of Numbers in an Array using 8086

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

3K+ Views

In this program we will see how to find the squares of n numbers stored in an array.Problem StatementWrite 8086 Assembly language program to calculate square of each numbers stored in an array of size n. The array size is stored at location offset 600, and Numbers are stored at 601 onwards.DiscussionTo solve this problem, we are taking the size of the array into the CL register, and make CH = 00H for counting. Now from each location take the number into accumulator, to make square, we have to multiply it two times. so we are multiplying AL with AL. ... Read More

Print Table of Input Integer in 8085

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

607 Views

In this program we will see how to generate table of an integer.Problem StatementWrite 8085 Assembly language program to generate a table of input integer. The number is stored at F050, and the table will be stored at F051 onwards.DiscussionTable generation is basically the multiplication table creation. We are taking the number and storing it to B. And initialize the counter as 0A (10 in decimal). In each step we are adding B with A and store value of A into memory, and decrease the counter by 1. These steps will repeat until the counter become 0.InputAddressData……F0504…… Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 50 ... Read More

HTML Textarea Required Attribute

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

53 Views

The required attribute of the element in HTML is used to let visitors know that this textarea field is to be filled before submitting the form. If a visitor clicks on Submit, without filling the textarea set with required attribute, then the form won’t submit.Following is the syntax −Let us now see an example to implement the required attribute of the element −Example Live Demo Subject-wise rank    Student:        Subject:        Rank:        Marks:        Remarks         OutputIn the above example, we ... Read More

Display All Records Ignoring the Current Date Record in MySQL

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

144 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Name varchar(100),    -> DueDate datetime    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. Let’s say the current date is “2019-07-05” −mysql> insert into DemoTable values('Chris', '2019-06-24'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('Chris', '2018-01-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Robert', '2019-07-05'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Carol', '2019-08-03'); Query OK, 1 row affected (0.22 ... Read More

Comma Operator in C/C++

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

319 Views

Comma Operator in C/C++ programming language has two contexts −As a Separator −As an operator − The comma operator { , } is a binary operator that discards the first expression (after evaluation) and then use the value of the second expression. This operator has the least precedence.Consider the following codes and guess the output −Example Live Demo#include int main(void) {    char ch = 'a', 'b', 'c';    printf("%c", ch);    return 0; }OutputIt gives an error because the works as a separator.prog.c: In function ‘main’: prog.c:5:20: error: expected identifier or ‘(’ before 'b' char ch = 'a', 'b', ... Read More

Get Max Columns in Table Using DatabaseMetadata in Java

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

88 Views

The getMaxColumnsInTable() method of the DatabaseMetaData interface is used to find out the maximum number of columns that the underlying database allows in a table.This method returns an integer value, representing the maximum number of columns allowed in a table. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method of the DriverManager ... Read More

Use CHAR_LENGTH in MySQL CREATE TABLE Query

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

114 Views

Use CHAR_LENGTH(yourColumnName) at the time of table creation. Let us first see an example and create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Title varchar(200),    `Number_of_characters` int as (char_length(Title))    ); Query OK, 0 rows affected (0.18 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Title) values('Introduction To MySQL'); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(Title) values('Introduction To Java'); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(Title) values('Introduction To MongoDB'); Query OK, 1 row affected (0.04 ... Read More

Advertisements