As we know the EXPLAIN statement will provide the information/structure of the whole table. With the help of the EXPLAIN statement along with the table name and the column name, we can get the information about that column.SyntaxEXPLAIN table_name col_name;Example1mysql> EXPLAIN employee ID; +-------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | +-------+---------+------+-----+---------+----------------+ 1 row in set (0.11 sec)The query above will give the information about the column ‘ID’ of a table named ... Read More
To display large Fibonacci numbers, try the following login and code.Here, we have set the value of n as the series. Set it to get the Fibonacci number. Below, we have set it to 100 to get the first 100 Fibonacci numbers.Since the first two numbers in a Fibonacci series are 0 and 1. Therefore, we will set the first two values.int val1 = 0, val2 = 1;The following is the complete code to display large Fibonacci numbers.Example Live Demousing System; public class Demo { public static void Main(string[] args) { int val1 = 0, val2 = ... Read More
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 | Default | Extra | +--------+-------------+------+-----+---------+-------+ | Name | varchar(20) | YES | | NULL | | | RollNo | int(11) | YES | | NULL | | | Grade | varchar(10) | YES | ... Read More
For writing MySQL query to get all the tables having a particular column name, we can use LIKE operator. It can be understood with the help of an example as follows −ExampleFollowing is the MySQL query to get all the tables having columns name ‘ID’ in it −mysql> Select Column_name as 'ColumnName', Table_name As 'Tablename' FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE '%ID%' ORDER BY Tablename LIMIT 10; +-------------+---------------+ | ColumnName | Tablename | +-------------+---------------+ | id | arena | | id | arena1 | ... Read More
As we know that a query consists of MySQL statements followed by a semicolon. We can enter multiple MySQL statements, separated by semicolons, on a single line. Consider the following example −mysql> Select * from Student; Select * from Student ORDER BY Name; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Gaurav | 100 | B.tech | | Aarav | 150 | M.SC | | Aryan | 165 | M.tech | +--------+--------+--------+ 3 rows in set (0.00 sec) +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Aarav | 150 ... Read More
Disks are the mainly used mass storage devices. They provide the bulk of secondary storage in operating systems today.Disk StructureEach modern disk contains concentric tracks and each track is divided into multiple sectors. The disks are usually arranged as a one dimensional array of blocks, where blocks are the smallest storage unit.Blocks can also be called as sectors. For each surface of the disk, there is a read/write desk available. The same tracks on all the surfaces is known as a cylinder.Disk SchedulingThere are many disk scheduling algorithms that provide the total head movement for various requests to the disk. ... Read More
HashMap is in Java, not C#. The equivalent of HashMap in C# is Dictionary that is used as a collection of key-value pair.Firstly, set the Dictionary −Dictionary d = new Dictionary(); d.Add("soccer", 1); d.Add("cricket", 2); d.Add("tennis", 3); d.Add("rugby", 4);Now get the keys and sort them using ToList() and Sort() method respectively.// get keys var val = d.Keys.ToList(); // sort val.Sort();The following is the complete example to sort a HashMap according to keys −Exampleusing System; using System.Collections.Generic; using System.Linq; class Program { static void Main() { Dictionary d = new Dictionary() ... Read More
For combining ROW selection with COLUMN selection, we can use the ‘WHERE’ clause. For example, we have a table below −mysql> Select * from Student; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Gaurav | 100 | B.tech | | Aarav | 150 | M.SC | | Aryan | 165 | M.tech | +--------+--------+--------+ 3 rows in set (0.00 sec)Now, the following query will show how we can combine ROW selection with COLUMN selection using WHERE clause.mysql> Select Name, RollNo, Grade from Student where Grade='M.Sc' or Grade='B.Tech'; +--------+--------+--------+ | Name | RollNo ... Read More
Chained Exceptions are a chain of try-catch statements that handle exceptions. To create a chain of exceptions i.e. chained exceptions −Set the first try-catch −Examplestatic void Main(string[] args) { try { One(); } catch (Exception e) { Console.WriteLine(e); } }Now try-catch under method One() −Examplestatic void One() { try { Two(); } catch (Exception e) { throw new Exception("First exception!", e); } }The method Two() also continues chained exception.Examplestatic void Two() { try { Three(); } catch ... Read More
LOAD DATAThis statement is used for importing the data from data files into our database. It reads data records directly from a file and inserts them into a table. Its syntax would be as follows −SyntaxLOAD DATA LOCAL INFILE '[path/][file_name]' INTO TABLE [table_name ];Here, a path is the address of the file.file_name is the name of the .txt filetable_name is the table where the data will be loaded.To illustrate the concept we are having the following data, separated by tab, in ‘A.txt’ whose path is d:/A.txt −100 John USA 10000 101 Paul UK 12000 102 Henry NZ 11000 103 Rick ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP