Rishi Rathor has Published 155 Articles

What are Self-Invoking Anonymous Functions in JavaScript?

Rishi Rathor

Rishi Rathor

Updated on 22-Jun-2020 14:39:42

360 Views

In JavaScript, the functions wrapped with parenthesis are called “Immediately Invoked Function Expressions" or "Self Executing Functions.The purpose of wrapping is to the namespace and control the visibility of member functions. It wraps the code inside a function scope and decreases clashing with other libraries. This is what we call ... Read More

How can we delete a MySQL database by using PHP script?

Rishi Rathor

Rishi Rathor

Updated on 22-Jun-2020 13:34:21

132 Views

As we know that PHP provides us the function named mysql_query to delete an existing database.ExampleTo illustrate this we are deleting a database named ‘Tutorials’ with the help of PHP script in the following example −           Deleting MySQL Database                  

How can we fetch alternate odd numbered records from MySQL table?

Rishi Rathor

Rishi Rathor

Updated on 22-Jun-2020 12:39:47

748 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

What is the default sort order in MySQL tables?

Rishi Rathor

Rishi Rathor

Updated on 22-Jun-2020 08:23:55

500 Views

The default sort order in MySQL tables is ascending. Whenever we use ORDER BY clause to sort out the rows of a table, MySQL gives output in ascending order, with the smallest value first. Consider the following example from a table named ‘student’ −mysql> Select * from student order by ... Read More

What are the limitations for replicating stored procedure and functions?

Rishi Rathor

Rishi Rathor

Updated on 22-Jun-2020 07:24:53

146 Views

Followings are the limitations for replicating stored procedure and functions −Type of Action − Actually the replication of stored procedure and functions depends upon the type of action. If the action, embedded in stored procedures, is nondeterministic (random) or time-based then it may not replicate properly. By their very nature, ... Read More

Create a procedure to list the tables with detailed information in a particular database.

Rishi Rathor

Rishi Rathor

Updated on 22-Jun-2020 06:51:19

47 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 give ... Read More

What MySQL returns if I do not use the keyword ‘RIGHT’ or ‘LEFT’ while writing the query for RIGHT JOIN or LEFT JOIN?

Rishi Rathor

Rishi Rathor

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

59 Views

In both the cases i.e. on not using ‘RIGHT’ or ‘LEFT’ keyword in the query, MySQL will return the result by taking it as INNER JOIN query. It is because the only difference between RIGHT, LEFT and INNER JOIN is the keyword of RIGHT or LEFT. To understand it, we ... Read More

How to show that each MySQL enumeration has an index value?

Rishi Rathor

Rishi Rathor

Updated on 20-Jun-2020 08:46:23

308 Views

Actually, the elements listed in the ENUM column specifications are assigned index numbers which begin with 1. Here the term “index” is indicating towards the position within the list of enumeration values and they are not related to table indexes. With the help of following examples we can show that ... Read More

How can I check the character set of all the tables along with column names in a particular MySQL database?

Rishi Rathor

Rishi Rathor

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

88 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 Column_name, 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 along with ... Read More

How to use compound INTERVAL unit in MySQL?

Rishi Rathor

Rishi Rathor

Updated on 20-Jun-2020 06:26:43

95 Views

Compound INTERVAL unit keywords are made up of two keywords and separated by an underscore (_). For using them in MySQL the unit values must be enclosed in single quotes and separated by space.Example − Following query will add 2 years and 2 months in the date value.mysql> Select timestamp('2017-10-22 ... Read More

Previous 1 ... 3 4 5 6 7 ... 16 Next
Advertisements