Vrundesha Joshi has Published 289 Articles

When to use anonymous JavaScript functions?

Vrundesha Joshi

Vrundesha Joshi

Updated on 23-Jun-2020 06:58:06

295 Views

The code while using anonymous functions is more readable when handlers are to be defined inside the calling code. Anonymous functions are declared inline. Normally, inline functions are better since they can access variables in the parent scopes.It allows for creating a function without any names identifier. It can be ... Read More

How does Exceptions Handling work in JavaScript?

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 14:38:52

233 Views

JavaScript uses try…catch…finally to handle exceptions. The latest versions of JavaScript added exception-handling capabilities. JavaScript implements the try...catch...finally construct as well as the throw operator to handle exceptions.You can catch programmer-generated and runtime exceptions, but you cannot catch JavaScript syntax errors.SyntaxHere is the try...catch...finally block syntax −     ExampleYou can ... Read More

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

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 13:33:45

187 Views

As we know that PHP provides us the function named mysql_select_db to select a mysql database.ExampleTo illustrate this we are selecting a database named ‘Tutorials’ with the help of PHP script in the following example −           Selecting MySQL Database                  

How can we find the employees from MySQL table whose age is greater than say 30 years, providing the only date of birth on the table?

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 12:37:37

1K+ Views

To understand this concept, we are using the data from table ‘emp_tbl’ as follows −mysql> Select * from emp_tbl; +--------+------------+ | Name   | DOB        | +--------+------------+ | Gaurav | 1984-01-17 | | Gaurav | 1990-01-17 | | Rahul  | 1980-05-22 | | Gurdas | 1981-05-25 | ... Read More

How can I get the output of multiple MySQL tables from a single query?

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 11:41:03

367 Views

As we know that a query can have multiple MySQL statements followed by a semicolon. Suppose if we want to get the result from multiple tables then consider the following example to get the result set from ‘Student_info’ and ‘Student_detail’ by writing a single query −mysql> Select Name, Address from ... Read More

How we can get more information about columns of a table than theinformation we got by DESCRIBE, EXPLAIN and SHOW COLUMNS MySQL statements?

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 08:34:54

98 Views

With the statement SHOW FULL COLUMNS, we can get more information about the columns of a table than the information we got by DESCRIBE, EXPLAIN, and SHOW COLUMNS MySQL statements.SyntaxSHOW FULL COLUMNS from Table_name;Examplemysql> SHOW FULL COLUMNS FROM EMPLOYEE\G; *************************** 1. row ***************************      Field: ID     ... Read More

How can we amend the declared size of a column’s data type in MySQL?

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 08:33:02

108 Views

It can be done with the help of ALTER TABLE command of MySQL. Consider the table ‘Student’ in which the size of ‘Grade’ column is declared as Varchar(10), can be seen from the following query −mysql> DESCRIBE Student; +--------+-------------+------+-----+---------+-------+ | Field  | Type        | Null | Key ... Read More

How can we create MySQL stored procedures without ‘BEGIN’ and ‘END’?

Vrundesha Joshi

Vrundesha Joshi

Updated on 22-Jun-2020 07:20:52

529 Views

We can create MySQL stored procedures without ‘BEGIN’ and ‘END’ just in the same way created with both of them only thing is to omit to BEGIN and END. In the following example, we are creating a stored procedure without ‘BEGIN’ and ‘END’ to get all the rows from a ... Read More

How can a MySQL stored procedure call another MySQL stored procedure inside it?

Vrundesha Joshi

Vrundesha Joshi

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

4K+ Views

It is quite possible that a MySQL stored procedure can call another MySQL stored procedure inside it. To demonstrate it, we are taking an example in which a stored procedure will call another stored procedure to find out the last_insert_id.Examplemysql> Create table employee.tbl(Id INT NOT NULL AUTO_INCREMENT, Name Varchar(30) NOT ... Read More

How can we subtract values in MySQL table with the help of LEFT JOIN?

Vrundesha Joshi

Vrundesha Joshi

Updated on 20-Jun-2020 11:17:24

941 Views

It can be understood with the help of an example in which two tables are having some values and we subtract the values with the help of LEFT JOIN. Here we are taking two tables having the following data −mysql> Select * from value_curdate; +----+----------+-------+ | Id | Product  | ... Read More

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