Generate 6-Digit Random Number in MySQL

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

2K+ Views

You can use LPAD() along with rand() and floor() to generate 6-digit random number. Let us first create a table −mysql> create table DemoTable    (    Value int    ); Query OK, 0 rows affected (0.64 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(1); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(2); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(3); Query OK, 1 row affected (0.24 sec) mysql> insert into DemoTable values(4); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(5); Query OK, ... Read More

Java DatabaseMetaData getTables Method with Example

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

4K+ Views

This method retrieves the description of the tables available in the specified database/catalog. It accepts 4 parameters −catalog   − A string parameter representing the name (or, name pattern) of the catalog (database in general) in which the table (that contains the columns of which you need to retrieve the description about) exists. pass "" to get the description of the columns in tables with no catalog and, pass null if you don't want to use catalog and thus narrow the search.schemaPattern  − A String parameter representing the name (or, name pattern) of the schema of the table, pass "" ... Read More

Lower Case Column Names with MySQL SELECT

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

886 Views

Let us first create a table −mysql> create table DemoTable    (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserFirstName varchar(20),    UserLastName varchar(20),    UserAge int,    UserCountryName varchar(20)    ); Query OK, 0 rows affected (0.27 sec)Now check the description of table.mysql> desc DemoTable;This will produce the following output −+-----------------+-------------+------+-----+---------+----------------+ | Field           | Type        | Null | Key | Default | Extra | +-----------------+-------------+------+-----+---------+----------------+ | UserId          | int(11)     | NO   | PRI ... Read More

Get Previous Node from a JTree in Java

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

239 Views

Use the getPreviousNode() method to get the previous node of this node in Java. Here, we are displaying the previous node of child node “eight” −System.out.println("Get Previous Node = "+eight.getPreviousNode());The following is an example to get the previous node from a JTree −Examplepackage my; import javax.swing.JFrame; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; public class SwingDemo {    public static void main(String[] args) throws Exception {       JFrame frame = new JFrame("Demo");       DefaultMutableTreeNode node = new DefaultMutableTreeNode("Products");       DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("Clothing (Product1 - P66778)");       DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("Accessories (Product2 - ... Read More

Reverse 16-Bit Number Using 8-Bit Operation in 8086

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

1K+ Views

In this program we will see how to reverse a 16-bit number using 8-bit operation.Problem StatementWrite 8086 Assembly language program to reverse a 16-bit number which is stored at location 2000 and 2001, using 8-bit operations.Discussion8086 has 8-bit operation for rotation. For 16-bit number, we are taking the bytes from 2000 and 2001. Then rotate each byte with ROL instruction. After that put the numbers in reverse form to reverse the bytes. Like the content of 2000 will be stored at 2001 after reverse, and content of 2001 will be stored at 2000 after reverse.InputAddressData……2000AB2001CD…… Flow Diagram ProgramOutputAddressData……2000DC2001BA……          

8259 PIC Microprocessor

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

29K+ Views

The 8259 is known as the Programmable Interrupt Controller (PIC) microprocessor. In 8085 and 8086 there are five hardware interrupts and two hardware interrupts respectively. Bu adding 8259, we can increase the interrupt handling capability. This chip combines the multi-interrupt input source to single interrupt output. This provides 8-interrupts from IR0 to IR7. Let us see some features of this microprocessor.This chip is designed for 8085 and 8086.It can be programmed either in edge triggered, or in level triggered modeWe can mask individual bits of Interrupt Request Register.By cascading 8259 chips, we can increase interrupts up to 64 interrupt linesClock ... Read More

Access Function Property as a Method in JavaScript

vineeth.mariserla
Updated on 30-Jul-2019 22:30:26

1K+ Views

Accessing a function as a method A javascript object is made up of properties. To access a property as a method, just define a function to a property and include other properties in that function.In the following example an object called "employee" is created with properties "fullName", "lastName" , "firstName" and "id". A function is defined under property "fullName" and properties such as "firstName" and "lastName" were included in it. So when the property "fullName" is called, the full name of the employee is going to display as shown in the output.Example-1Live Demo    var employee = {   ... Read More

Show Grants for Root in MySQL

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

163 Views

For this, use the following syntax, wherein we have used SHOW GRANTS −SHOW GRANTS FOR 'yourUserName'@'yourHostName';HostName may be ‘%’ or localhost.Let us implement the above syntax in order to show grants from ROOT −mysql> SHOW GRANTS FOR 'root'@'%' ;Output+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for root@%                                                                                                                   ... Read More

HTML DOM Input Datetime Disabled Property

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

187 Views

The HTML DOM Input Datetime disabled property sets/returns whether Input Datetime is enabled or disabled.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeObject.disabledSetting disabled to booleanValueinputDatetimeObject.disabled = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input datetime is disabled.falseIt defines that the input datetime is not disabled and it is also the default value.ExampleLet us see an example of Input Datetime disabled property − Live Demo Input Datetime Disabled Date & Time: Enable Datetime Input    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect");    divDisplay.textContent = 'Datetime Input ... Read More

Play Audio and Video Files in iOS

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

1K+ Views

Understanding how to play audio and video in iOS is very important, as almost every application has audio and video these days. From your gaming application to social media to your music player and so on.In this post, we will be seeing how to play audio and video file using Swift.So let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “AudioVideo”.Step 2 − Open Main.storyboard and add three buttons and name them as shown below.Step 3 − Create @IBOutlet for three buttons and name it to stop, playButton and video button, ... Read More

Advertisements