Sravani S has Published 62 Articles

How can I check if a JavaScript function is defined?

Sravani S

Sravani S

Updated on 23-Jun-2020 06:48:39

345 Views

To check if a JavaScript function is defined or not, checks it with “undefined”.ExampleYou can try to run the following example to check for a function is defined or not in JavaScript −                    function display() {       ... Read More

How can we fetch alternate even-numbered records from MySQL table?

Sravani S

Sravani S

Updated on 22-Jun-2020 12:26:48

402 Views

To understand this concept we are using the data from table ‘Information’ as follows −mysql> Select * from Information; +----+---------+ | id | Name    | +----+---------+ |  1 | Gaurav  | |  2 | Ram     | |  3 | Rahul   | |  4 | Aarav   ... Read More

How can we use MySQL SELECT without FROM clause?

Sravani S

Sravani S

Updated on 22-Jun-2020 11:42:35

2K+ Views

FROM clause after SELECT shows the references to a table. But if there is no reference to any table then we can use SELECT without the FROM clause. In other words, we can say that SELECT can be used to retrieve rows computed without reference to any table. Consider the ... Read More

What are the different MySQL prompts we have on the command line?

Sravani S

Sravani S

Updated on 22-Jun-2020 10:57:40

468 Views

As we know that after writing the first line of multiple-line queries, MySQL changes the prompt. The following table shows different MySQL prompts and it's meaning −PromptMeaning         mysql>It means MySQL is ready for a new command. →It means that MySQL is waiting for the next line of multiple-line ... Read More

Create a MySQL stored procedure, which takes the name of the database as its parameter, to list the tables with detailed information in a particular database.

Sravani S

Sravani S

Updated on 22-Jun-2020 06:49:30

569 Views

Suppose currently we are using a database named ‘query’ and it is having the following tables in it −mysql> Show tables in query; +-----------------+ | Tables_in_query | +-----------------+ | student_detail  | | student_info    | +-----------------+ 2 rows in set (0.00 sec)Now, following is a stored procedure, which will accept ... Read More

How can we see the list, along with complete information, of stored procedures in a particular MySQL database?

Sravani S

Sravani S

Updated on 22-Jun-2020 05:32:26

155 Views

We can use mysql.proc to see the list, along with complete information, of stored procedures in a particular MySQL database by the following query −mysql> Select * from mysql.proc where db = 'query' AND type = 'PROCEDURE' \G *************************** 1. row ***************************                 ... Read More

How can we establish MySQL database by using MySQL binary at commandprompt?

Sravani S

Sravani S

Updated on 20-Jun-2020 13:41:12

150 Views

You can establish the MySQL database using the mysql binary at the command prompt. It can be understood with the help of the following example −ExampleWe can use following statements to connect to the MySQL server from the command prompt −[root@host]# mysql -u root -p Enter password:******This will give us the mysql> ... Read More

How can I update a table using prepare statements?

Sravani S

Sravani S

Updated on 20-Jun-2020 10:53:26

193 Views

It can be understood with the help of following the example in which we have updated the table named ‘Student’, having the following data, by using prepared statement −mysql> Select * from Student; +------+-------+ | Id   | Name  | +------+-------+ | 1    | Ram   | | 2 ... Read More

How MySQL reacts when we specify a CHARACTER SET binary attribute for a character string data type?

Sravani S

Sravani S

Updated on 20-Jun-2020 07:36:30

238 Views

On specifying a CHARACTER SET binary attribute for a character string data type, MySQL creates that column as its subsequent binary string type. The conversions for CHAR, VARCHAR and BLOB data types take place as follows −CHAR would become BINARYVARCHAR would become VARBINARYTEXT would become BLOBThe above kind of conversion ... Read More

In MySQL, how can we use FROM_UNIXTIME() function with format string?

Sravani S

Sravani S

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

225 Views

Suppose if we want the output of FROM_UNIXIME() function in a particular format then we can use date format string or time format string or both in it. Following is the example of using the format string in FROM_UNIXTIME() function −mysql> Select FROM_UNIXTIME(1555033470 '%Y %M %D')AS 'Formatted Output'; +------------------+ | ... Read More

Advertisements