Varun has Published 83 Articles

In MySQL, how can we maintain data-driven table relationship using joins?

varun

varun

Updated on 20-Jun-2020 10:59:25

119 Views

Actually, sometimes we can avoid data-driven relationships in tables and we need to join them. It can be done with the help of CASE statement in the SELECT list to handle the joining possibilities. To understand it, we are taking the example of three data-driven tables namely ‘Student_Detail’ which have ... Read More

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

varun

varun

Updated on 20-Jun-2020 10:37:03

320 Views

With the help of mysqlimport we can upload data into multiple MySQL tables. It is illustrated in the example below −ExampleSuppose we want to upload the following data from two data files namely student1_tbl.txt −1     Saurav     11th 2     Sahil      11th 3   ... Read More

CSS3 font combinations

varun

varun

Updated on 20-Jun-2020 08:50:06

76 Views

CSS3 has adapted font combinations technology. In here, if the browser does not support the first font then it tries the next font.Let us see an example of Sans-Serif fonts −

On passing an out-of-range value in UNIX_TIMESTAMP() or FROM_UNIXTIME() function, what MySQL will return?

varun

varun

Updated on 20-Jun-2020 06:35:01

271 Views

When we pass an out-of-range value in UNIX_TIMESTAMP, MySQL returns 0. The valid range of value is same as for the TIMESTAMP data type.Examplemysql> Select UNIX_TIMESTAMP('1969-01-01 04:05:45'); +---------------------------------------+ | UNIX_TIMESTAMP('1969-01-01 04:05:45') | +---------------------------------------+ |                         0       ... Read More

How can we insert current date and time automatically on inserting values in other columns in MySQL?

varun

varun

Updated on 19-Jun-2020 13:54:44

1K+ Views

In MySQL, we can insert the current date and time automatically to a column on inserting the values in another column by declaring that column as DEFAULT CURRENT_TIMESTAMP.Examplemysql> Create table testing    -> (    -> StudentName varchar(20) NOT NULL,    -> RegDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP    -> ); Query ... Read More

How to count the number of occurrences of a character in a string in JavaScript?

varun

varun

Updated on 17-Jun-2020 06:39:27

521 Views

To count the number of occurrences of a character in a string, try to run the following code −ExampleLive Demo                    function displayCount() {             setTimeout(function() {                var ... Read More

How to make an anchor tag refer to nothing?

varun

varun

Updated on 16-Jun-2020 13:10:42

4K+ Views

To make an anchor tag refer to nothing, use “javascript: void(0)”. The following link does nothing because the expression "0" has no effect in JavaScript. Here the expression "0" is evaluated, but it is not loaded back into the current document.ExampleLive Demo               ... Read More

What are all the ways an object can be created in Java?

varun

varun

Updated on 16-Jun-2020 09:03:59

128 Views

You can create an objectUsing new keyword.Sample obj = new Sample();Using the newInstance() method and Class.forName() method.Sample obj2 = (Sample) Class.forName("Sample").newInstance();Using the clone() method by implementing Cloneable Interface (marker).Sample obj3 = (Sample) obj1.clone();Using class loader.Object obj4 = Sample.class.getClassLoader().loadClass("Sample");Using the constructor class from lang.reflect.Class cls = Sample.class; Constructor obj = cls.getDeclaredConstructors()[0]; ... Read More

What are immediate functions in JavaScript?

varun

varun

Updated on 16-Jun-2020 06:18:43

243 Views

The immediate function executes as soon as it is defined. To understand the role of immediate function, let’s see the difference between a function and an immediate function −Here’s immediate function −(function() {    var str = "display"; }()); function display() {    // this returns undefined    alert(str); }Here’s ... Read More

What are async methods in JavaScript?

varun

varun

Updated on 15-Jun-2020 13:18:08

101 Views

The async function declaration as the name suggests defines an asynchronous function. This function returns an AsyncFunction object.SyntaxHere’s the syntax −async function functionname([param[, param[, ... param]]]) {    statements to be executed }ExampleLet’ see an example, which prints the result after 5 seconds −           ... Read More

Advertisements