I/O Systems and Subsystems

Ricky Barnes
Updated on 22-Jun-2020 11:06:34

16K+ Views

I/O devices are very important in the computer systems.They provide users the means of interacting with the system. So there is a separate I/O system devoted to handling the I/O devices.The different Components of the I/O systems are −I/O HardwareThere are many I/O devices handled by the operating system such as mouse, keyboard, disk drive etc. There are different device drivers that can be connected to the operating system to handle a specific device. The device controller is an interface between the device and the device driver.A diagram to represent this is −I/O Application InterfaceThe user applications can access all ... Read More

How MySQL Determines the End of a Statement

Govinda Sai
Updated on 22-Jun-2020 11:06:30

152 Views

MySQL determines the end of a statement when it encounters any one of the followings −Semicolon(;)Generally, MySQL determines the end of the statement, single-line or multiple-line, when it encounters the termination semicolon(;). Consider the examples below, mysql> Select * from employee; (Single line statement) mysql> Select *     -> from     -> employee; (Multiple line statement)In both cases, MySQL returns the result set after encountering the semicolon, which means the end of the statement.\G option\G option means to send the current state to the server to be executed and display the result in a vertical format. When we ... Read More

Use MySQL Subquery as a Table in FROM Clause

Monica Mona
Updated on 22-Jun-2020 11:04:04

230 Views

We can use a subquery as a table in the FROM clause in the same way as the result of a subquery can be used with an operator in the WHERE clause. In the following example, we are using the result of subquery as a table by writing it after the FROM clause. It is mandatory to use an alias after subquery, here we are using alias ‘C_car’. To demonstrate it we are using the data as follows from table ‘Cars’ −mysql> Select * from Cars; +------+--------------+---------+ | ID   | Name         | Price   | ... Read More

Display MySQL Query Result Vertically

Abhinaya
Updated on 22-Jun-2020 11:03:30

831 Views

With the use of ego, \G option at end of a statement, we can get the result set in vertical format. Consider the following example −mysql> Select * from Student where name = 'Aarav'\G *************************** 1. row ***************************   Name: Aarav RollNo: 150  Grade: M.SC 1 row in set (0.00 sec)

Clone a Generic List in C#

Chandu yadav
Updated on 22-Jun-2020 11:02:47

525 Views

A list is a Generic collection to hold elements of same datatypes.To clone a list, you can use the CopyTo method.Declare a list and add elements −List < string > myList = new List < string > (); myList.Add("Programming"); myList.Add("Web Dev"); myList.Add("Database");Now create a new array and clone the list into it −string[] arr = new string[10]; myList.CopyTo(arr);Here is the complete code −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       List < string > myList = new List < string > ();       myList.Add("Programming");       ... Read More

Specify Sort Order Using Non-Retrieved Column in MySQL

Prabhas
Updated on 22-Jun-2020 11:02:44

111 Views

Actually, as we know that we can specify a sort order with the help of the ORDER BY clause. We need to write the ORDER BY keyword followed by the name of the column on which we want to sort the table. It is not necessary that we have to use that column name after the SELECT keyword in the query.Examplemysql> Select Sr, Item from ratelist ORDER BY Price; +----+------+ | Sr | Item | +----+------+ |  5 | T    | |  1 | A    | |  2 | B    | |  4 | h    | ... Read More

Convert Array of Characters into String in C#

Arjun Thakur
Updated on 22-Jun-2020 11:01:48

218 Views

Let us first set an array of 5 characters −char[] ch = new char[15]; ch[0] = 'T'; ch[1] = 'r'; ch[2] = 'i'; ch[3] = 'c'; ch[4] = 'k';Now convert them into a string −string str = new string(ch);Here is the complete code −ExampleUsing System; class Program {    static void Main() {       char[] ch = new char[15];       ch[0] = 'T';       ch[1] = 'r';       ch[2] = 'i';       ch[3] = 'c';       ch[4] = 'k';       // converting to string       string str = new string(ch);       Console.WriteLine(str);    } }

Specify Number of Records in MySQL Output

Abhinanda Shri
Updated on 22-Jun-2020 11:01:04

205 Views

We can specify the number of records to be returned in output by adding a LIMIT clause in MySQL query. LIMIT clause restricts the number of rows to be returned. Consider the following example −mysql> Select * from ratelist ORDER BY Price; +----+------+-------+ | Sr | Item | Price | +----+------+-------+ |  5 | T    |   250 | |  1 | A    |   502 | |  2 | B    |   630 | |  4 | h    |   850 | |  3 | C    |  1005 | +----+------+-------+ 5 rows in set ... Read More

Convert String to Int in C#

George John
Updated on 22-Jun-2020 11:00:34

390 Views

Let’s say our string is −string str ="9999";Now, use the Int32.Parse() to convert the string into integer −int n = Int32.Parse(str);Now display the integer value as shown in the following code −Exampleusing System; class Demo {    static void Main() {       string str ="9999";       int n = Int32.Parse(str);       Console.WriteLine(n);    } }

Cancel MySQL Command in Progress

Giri Raju
Updated on 22-Jun-2020 10:59:45

131 Views

Suppose if we do not want to execute a command that we are entering, then we can use a clear \c option which clears the current input. For example, the use of \c option can be done as follows −mysql> Select *     -> from\cIn the example above, when we use \c in a statement, MySQL clears the current input and returns back to the MySQL prompt for accepting other statements.

Advertisements