Prabhas has Published 78 Articles

Do we require any authentication for login into MySQL command line tool?

Prabhas

Prabhas

Updated on 20-Jun-2020 13:52:19

95 Views

Yes, we require authentication for login into MySQL command line tool. For example, if we are trying to log in from windows command line then it will prompt for the password every time. The command for login is as follows −C:\Program Files\MySQL\bin>mysql -u root -p Enter password: *****Read More

After connecting to MySQL server how can we select a database fromcommand prompt?

Prabhas

Prabhas

Updated on 20-Jun-2020 13:42:08

104 Views

Once we get connected to the MySQL server, it is required to select a database to work with. This is because there might be more than one database available with the MySQL Server.It is very simple to select a database from the mysql> prompt. We can use SQL command ‘use’ ... Read More

How can I get the list of columns from a table in the database we are currently using?

Prabhas

Prabhas

Updated on 20-Jun-2020 13:07:19

42 Views

It can be done with the SHOW COLUMNS statement. Its Syntax would be as follows −SyntaxSHOW COLUMNS FROM tab_nameHere tab_name is the name of the table from which we want to see the list of columns.ExampleIn the example we are getting the list of columns from a table named Student_info ... Read More

What happens if I will prepare the statement with the same name without de-allocating the earlier one?

Prabhas

Prabhas

Updated on 20-Jun-2020 10:56:55

49 Views

Actually, in MySQL, we can prepare a statement with the same name without de-allocating the earlier one because MySQL automatically drops the prepared statements when they are redefined or when we close the connection to the server. In other words, we can say that we can use the same name ... Read More

How can we upload data into MySQL tables by using mysqlimport?

Prabhas

Prabhas

Updated on 20-Jun-2020 10:38:34

215 Views

For uploading the data into MySQL tables by using mysqlimport we need to follow following steps −Step-1 − Creating the tablefirst of all, we need to have a table in which we want to upload the data. We can use CREATE TABLE statement for creating a MySQL table. For example, ... Read More

What happens when I insert the value ‘NULL’ in an AUTO_INCREMENT MySQL column?

Prabhas

Prabhas

Updated on 20-Jun-2020 07:50:04

828 Views

When we insert NULL value to AUTO_INCREMENT column, MySQL will return sequence number.Examplemysql> Create table employee(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Name Varchar(10)); Query OK, 0 rows affected (0.16 sec) mysql> Insert into employee(id, Name) values(NULL, 'Gaurav'); Query OK, 1 row affected (0.07 sec) mysql> Select * ... Read More

How to preselect a value in a dropdown list of items in HTML forms?

Prabhas

Prabhas

Updated on 18-Jun-2020 06:01:47

5K+ Views

With HTML, you can easily create a simple drop down list of items to get user input in HTML forms. A select box also called drop down box provides an option to list down various options in the form of drop down list.You can also preselect a value in dropdown ... Read More

How to pass a function as a parameter in Java

Prabhas

Prabhas

Updated on 17-Jun-2020 11:36:16

4K+ Views

Yes. From Java 8 onwards, we can do so using method references.Method references help to point to methods by their names. A method reference is described using "::" symbol. A method reference can be used to point the following types of methods −Static methodsInstance methodsConstructors using new operator (TreeSet::new)Method Reference ... Read More

Advantages and disadvantages of arrays in Java

Prabhas

Prabhas

Updated on 17-Jun-2020 07:50:41

1K+ Views

BenefitsEasier access to any element using the index.Easy to manipulate and store large data.DisadvantagesFixed size. Can not be increased or decrease once declared.Can store a single type of primitives only.

What is the best way to initialize a JavaScript number?

Prabhas

Prabhas

Updated on 17-Jun-2020 06:38:06

396 Views

The best way to initialize a number in JavaScript is to initialize variables while declaring them. Through this, you can easily avoid undefined values.ExampleYou can try to run the following code to initialize a number −Live Demo                    var deptNum = 20, id = 005;          document.write("Department number: "+deptNum);          

Advertisements