V Jyothi has Published 87 Articles

How can I check the list of MySQL tables, in the current database we are using, along with table type in the result set?

V Jyothi

V Jyothi

Updated on 20-Jun-2020 12:58:01

46 Views

It can be done with the SHOW FULL TABLES statement. Its Syntax would be as follows −SyntaxSHOW FULL TABLESExampleIn the following example our current database is ‘query’ hence the statement below will show us the table list along with table type in the result set from this database −mysql> SHOW ... Read More

What kinds of programs are available in MySQL database to manage MySQL server?

V Jyothi

V Jyothi

Updated on 20-Jun-2020 11:44:48

55 Views

MySQL database provides us the following programs as administrative tools to manage MySQL server −mysqldIt is also known as MySQL server daemon. It is the main program that does most of the work in a MySQL installation. We need to use ‘mysqld’ to start our MySQL server. It is having ... Read More

How can I create a table and insert values in that table using prepare statements?

V Jyothi

V Jyothi

Updated on 20-Jun-2020 10:54:07

98 Views

It can be understood with the help of following the example in which we have created the table named ‘Student’ by using prepared statement −mysql> PREPARE stmt3 FROM 'CREATE TABLE Student(Id INT, Name Varchar(20))'; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> EXECUTE stmt3; Query OK, 0 ... Read More

How can we check the character set of all the tables in a particular MySQL database?

V Jyothi

V Jyothi

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

1K+ Views

With the help of the following MySQL query we can check the character sets of all the tables in a particular database −mysql> Select TABLE_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.Columns Where TABLE_SCHEMA = 'db_name';ExampleFor example, the query below returns the character sets of all the tables in a database named ‘Alpha’.mysql> Select ... Read More

What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?

V Jyothi

V Jyothi

Updated on 20-Jun-2020 06:41:07

180 Views

In that case, MySQL returns the Unix timestamp of the current date and time. Hence we can say that using no argument is same as using NOW() as an argument to UNIX_TIMESTAMP() function.For example, if we run the query for UNIX_TIMESTAMP() with no value and with NOW() as an argument ... Read More

How to create an array of strings in JavaScript?

V Jyothi

V Jyothi

Updated on 19-Jun-2020 13:19:50

9K+ Views

To create an array of strings in JavaScript, simply assign values −var animals = ["Time", "Money", "Work"];You can also use the new keyword to create an array of strings in JavaScript −var animals = new Array("Time", "Money", "Work");The Array parameter is a list of strings or integers. When you specify ... Read More

What is onsubmit event in JavaScript?

V Jyothi

V Jyothi

Updated on 19-Jun-2020 11:19:19

3K+ Views

The onsubmit event is an event that occurs when you try to submit a form. You can put your form validation against this event type. The following example shows how to use onsubmit. Here we are calling a validate() function before submitting a form data to the web server. If ... Read More

What is the best way to initialize a JavaScript Date to midnight?

V Jyothi

V Jyothi

Updated on 18-Jun-2020 09:15:34

333 Views

To initialize a JavaScript Date to midnight, set hours like the following −setHours(0,0,0,0);ExampleYou can try to run the following code to set a date to midnight −Live Demo                    var dt;          dt = new Date();          dt.setHours(0,0,0,0);          document.write(dt);           OutputMon May 28 2018 00:00:00 GMT+0530 (India Standard Time)

How to get current date and time using JavaScript?

V Jyothi

V Jyothi

Updated on 18-Jun-2020 08:36:06

357 Views

To get current date and time using JavaScript, use the Date() method. JavaScript Date() method returns today's date and time and does not need any object to be called.ExampleYou can try to run the following code to get current date and time −Live Demo           JavaScript ... Read More

Prime number program in Java.

V Jyothi

V Jyothi

Updated on 18-Jun-2020 07:00:54

1K+ Views

Following is the required program.ExampleLive Demopublic class Tester {    public static void main(String args[]) {       int i, m = 0, flag = 0;       int n = 41;// it is the number to be checked       m = n / 2;       if (n == 0 || n == 1) {          System.out.println(n + " not a prime number");       } else {          for (i = 2; i

Advertisements