Convert Subqueries to INNER JOIN

Samual Sam
Updated on 22-Jun-2020 10:59:14

1K+ Views

To make it understand we are using the data from the following tables −mysql> Select * from customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ |           1 | Rahul    | |           2 | Yashpal  | |           3 | Gaurav   | |           4 | Virender | +-------------+----------+ 4 rows in set (0.00 sec) mysql> Select * from reserve; +------+------------+ | ID   | Day        | +------+------------+ |    1 | 2017-12-30 | | ... Read More

CSS Descendant Selector

varun
Updated on 22-Jun-2020 10:58:36

339 Views

The descendant selector in CSS is used to match all elements that are descendants of a specified element.ExampleYou can try to run the following code to implement CSS Descendent Selector:Live Demo                    div p {             background-color: orange;          }                              Para 1 in the div          Para 2 in the div             Para 3 outside the div.     Output

Flow Control in Try-Catch-Finally in C#

karthikeya Boyini
Updated on 22-Jun-2020 10:58:29

728 Views

The flow control in try, catch, and finally can be understood using the following example. Here, we are dividing two numbers −Example Live Demousing System; namespace ErrorHandlingApplication {    class DivNumbers {       int result;       DivNumbers() {          result = 0;       }       public void division(int num1, int num2) {          try {             result = num1 / num2;          } catch (DivideByZeroException e) {             Console.WriteLine("Exception caught: {0}", e);   ... Read More

Output of NULL Value in Arithmetic Expression

mkotla
Updated on 22-Jun-2020 10:58:08

1K+ Views

As we know that a NULL is no value and it is not the same as zero. MySQL represents a database column as NULL if it does not contain any data. Now, if we will use NULL in any arithmetic expression then the result will be NULL also.Examplemysql> Select 65/NULL, 65+NULL, 65*NULL, 65-NULL, 65%NULL; +---------+---------+---------+---------+---------+ | 65/NULL | 65+NULL | 65*NULL | 65-NULL | 65%NULL | +---------+---------+---------+---------+---------+ |    NULL |    NULL |    NULL |    NULL |    NULL | +---------+---------+---------+---------+---------+ 1 row in set (0.00 sec)From the above example, it can be observed that if we ... Read More

Different MySQL Prompts on the Command Line

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

424 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 command. ‘>It means that MySQL is waiting for the next line, waiting for the completion of a string that began with a single quote. “>It means that MySQL is waiting for the next line, waiting for the completion of a string that began with a double quote. `>It means that MySQL is waiting ... Read More

Convert Decimal to Binary using C#

Samual Sam
Updated on 22-Jun-2020 10:57:36

397 Views

Let’s say we want to convert the number 48 to binary.Firstly, set it and use the / and % operators and loop until the value is greater than 1 −decVal = 48; while (decVal >= 1) {    val = decVal / 2;    a += (decVal % 2).ToString();    decVal = val; }Now, display every bit of the binary as shown in the complete code −Example Live Demousing System; using System.Collections.Generic; using System.Text; namespace Demo {    class MyApplication {       static void Main(string[] args) {          int decVal;         ... Read More

Write Hello World in C#

karthikeya Boyini
Updated on 22-Jun-2020 10:56:46

581 Views

To print “Hello World” in C#, use the Console.WriteLine.Let us see a basic C# program to display a text −Example Live Demousing System; using System.Collections.Generic; using System.Text; namespace Program {    class MyApplication {       static void Main(string[] args) {          Console.WriteLine("Hello World");          Console.Read();       }    } }OutputHello WorldAbove, we displayed the text “Hello World” using the WriteLine() method. The output is displayed using the Console −Console.WriteLine("Hello World");

Use Two Columns with MySQL WHERE Clause

radhakrishna
Updated on 22-Jun-2020 10:56:28

564 Views

It is very rarely used to use two columns of the same table in WHERE clause but still we can perform a query with two columns of the same table. Consider the below example −mysql> Select F_name, L_name     -> From Customer     -> where F_name = L_name;     Empty set (0.00 sec)Here we are using both the columns(F_Name and L_Name) from the same table(Customer) hence the result is an Empty set.

Convert Subqueries to LEFT JOIN

Sai Nath
Updated on 22-Jun-2020 10:55:57

2K+ Views

To make it understand we are using the data from the following tables −mysql> Select * from customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ | 1           | Rahul    | | 2           | Yashpal  | | 3           | Gaurav   | | 4           | Virender | +-------------+----------+ 4 rows in set (0.00 sec) mysql> Select * from reserve; +------+------------+ | ID   | Day        | +------+------------+ | 1    | 2017-12-30 | | ... Read More

Linked List in Chash

Samual Sam
Updated on 22-Jun-2020 10:55:35

2K+ Views

System.Collections.Generic namespace is available in C# for LinkedList. The LinkedList class allows insertion and deletion of elements from the list at a fast pace.C# LinkedList class uses the concept of linked list. It allows us to insert and delete elements fastly. It can have duplicate elements. It is found in System.Collections.Generic namespace.Here is an example −Example Live Demousing System; using System.Collections.Generic; class Demo {    static void Main() {       LinkedList < string > l = new LinkedList < string > ();       l.AddLast("one");       l.AddLast("two");       l.AddLast("three");     ... Read More

Advertisements