Write Multiple Line Statement in MySQL

Nitya Raut
Updated on 22-Jun-2020 08:46:50

5K+ Views

We can write multiple-line statements because MySQL determines the end of a statement by looking for the termination semicolon, not by looking for the end of the input line.Examplemysql> Select *     -> from     -> stock_item; +------------+-------+----------+ | item_name  | Value | Quantity | +------------+-------+----------+ | Calculator | 15    | 89      | | Notebooks  | 63    | 40      | | Pencil     | 15    | 40      | | Pens       | 65    | 32      | | Shirts     | 13   ... Read More

Create Table with Name Like 'a' and Same Column Name 'name'

Priya Pallavi
Updated on 22-Jun-2020 08:46:26

153 Views

For creating a table with such kinds of names we must have to use quote character. The quotes can be single or double depends upon ANSI_QUOTES SQL mode. If this mode is disabled then the identifier quote character is the backtick (“`”). Consider the following example in which we created a table named ‘select’ −mysql> Create table `a^b`(`a^b` int); Query OK, 0 rows affected (0.19 sec) mysql> Create table "a^g"("a^g" int); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"a^g" ("a^g" ... Read More

Queue Interface in C#

Samual Sam
Updated on 22-Jun-2020 08:45:39

468 Views

Queue represents a first-in, first out collection of object. It is used when you need a first-in, first-out access to items. When you add an item to the list, it is called enqueue, and when you remove an item, it is called deque.Let us see an example of the Queue class.To add elements, use Enqueue −Queue q = new Queue(); q.Enqueue('X'); q.Enqueue('Y'); q.Enqueue('Z');To delete elements, use Dequeue −// remove elements while (q.Count > 0) Console.WriteLine(q.Dequeue());Let us see an example to add elements in a queue.Example Live Demousing System; using System.Collections; namespace Demo {    class Program {     ... Read More

Test for Existence of Records in MySQL Subquery

Rishi Raj
Updated on 22-Jun-2020 08:45:22

189 Views

We can use MySQL EXIST operator to test for the existence of a record in the subquery. In other words, we can say that EXIST operator checks if a subquery returns any rows. The syntax of using EXIST operator with MySQL subquery is as follows −SyntaxWHERE EXISTS (Subquery)The above EXIST (subquery) expression returns TRUE if the subquery returns at least one row, otherwise it returns false.ExampleTo make it understand we are using the data from the following tables −mysql> Select * from Customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ | 1           | ... Read More

Make jQuery Animations Smoother

Kristi Castro
Updated on 22-Jun-2020 08:44:07

669 Views

To make jQuery animations smoother use the easing library. Use the animation speed properly to form it a perfect animation for the web page. Do not speed up animation and you should know where to stop it while using animate().For an example, set a button, that fades out on click and displays a textarea:Add answerThe following is the textarea that generates showing smoother animation using animation() and fadeout(): You can try to run the following code to make jQuery animation smoother:Example Live Demo               $(document).ready(function(){          $('body').on('click', '#answer', function() ... Read More

Evaluate MySQL EXISTS Operator with NULL Subquery

Chandu yadav
Updated on 22-Jun-2020 08:43:34

480 Views

If a subquery, used with EXIST operator, returns NULL, the expression EXIST NULL returns TRUE and MySQL returns the result based on an outer query. It can be understood with the help of simple example using the following data from table ‘Customers’ −mysql> Select * from Customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ | 1           | Rahul    | | 2           | Yashpal  | | 3           | Gaurav   | | 4           | Virender | +-------------+----------+ 4 rows in ... Read More

MySQL Evaluation of EXISTS Operator with No Rows Subquery

Monica Mona
Updated on 22-Jun-2020 08:42:56

169 Views

If a subquery, used with EXIST operator, returns no rows, the expression EXIST returns FALSE and MySQL returns the empty set as output. It can be understood with the help of simple example using the following data from table ‘Customers’ −mysql> Select * from Customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ |           1 | Rahul    | |           2 | Yashpal  | |           3 | Gaurav   | |           4 | Virender | +-------------+----------+ 4 rows in ... Read More

Nest a Subquery Within Another Subquery

Swarali Sree
Updated on 22-Jun-2020 08:42:04

189 Views

If a subquery is nested inside another subquery then it is called a nested subquery. To make it understand we are creating the nested subquery from the following tables data −mysql> Select * from Cars; +------+--------------+---------+ | ID   | Name         | Price   | +------+--------------+---------+ |    1 | Nexa         | 750000  | |    2 | Maruti Swift | 450000  | |    3 | BMW          | 4450000 | |    4 | VOLVO        | 2250000 | |    5 | Alto   ... Read More

Animate Background Color Change using jQuery on Mouseover

Kristi Castro
Updated on 22-Jun-2020 08:41:49

827 Views

To change background color, use the mouseenter event. The background color change when you place mouse cursor:mouseenter: function(){    $(this).css("background-color", "gray"); }The mouse cursor is placed on the following element:Click and move the mouse pointer to change the background color.You can try to run the following code to learn how to animate a change in background color on mouseover:Example Live Demo               $(document).ready(function(){          $("body").on({             mouseenter: function(){                $(this).css("background-color", "gray");             },                 mouseleave: function(){                $(this).css("background-color", "red");             },              });       });        Click and move the mouse pointer to change the background color.

Single Row and Multiple Row Subqueries

Vikyath Ram
Updated on 22-Jun-2020 08:41:13

14K+ Views

Single Row Sub QueryA single-row subquery is used when the outer query's results are based on a single, unknown value. Although this query type is formally called "single-row, " the name implies that the query returns multiple columns-but only one row of results. However, a single-row subquery can return only one row of results consisting of only one column to the outer query.In the below SELECT query, inner MySQL returns only one row i.e. the minimum salary for the company. It, in turn, uses this value to compare the salary of all the employees and displays only those, whose salary ... Read More

Advertisements