Upload Data into MySQL Tables Using mysqlimport

Prabhas
Updated on 20-Jun-2020 10:38:34

362 Views

For uploading the data into MySQL tables by using mysqlimport we need to follow following steps −Step-1 − Creating the tablefirst of all, we need to have a table in which we want to upload the data. We can use CREATE TABLE statement for creating a MySQL table. For example, we created a table named ‘student_tbl’ as follows −mysql> DESCRIBE Student_tbl; +--------+-------------+------+-----+---------+-------+ | Field | Type         | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | RollNo | int(11)     | YES  |     | NULL    |       | | ... Read More

What is Type Casting in C#

Samual Sam
Updated on 20-Jun-2020 10:38:06

418 Views

Type casting is converting one type of data to another type. The two forms are −Implicit type conversion − These conversions are performed by C# in a type-safe manner. For example, are conversions from smaller to larger integral types and conversions from derived classes to base classes.Explicit type conversion− These conversions are done explicitly by users using the pre-defined functions. Explicit conversions require a cast operator.The following are the built-in type conversion methods −Sr.NoMethod & Description1ToBooleanConverts a type to a Boolean value, where possible.2ToByteConverts a type to a byte.3ToCharConverts a type to a single Unicode character, where possible.4ToDateTimeConverts a type ... Read More

Upload Data into Multiple MySQL Tables using mysqlimport

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

429 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     Digvijay   11thAnd House.txt1   Furniture 2   Television 3   RefrigeratorFollowings are MySQL tables into which we want to upload the above data −mysql> DESCRIBE Student1_tbl; +--------+-------------+------+-----+---------+-------+ | Field  | Type        | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | RollNo | int(11) ... Read More

Cases Where MySQL TRIM Function Cannot Be Used

Arjun Thakur
Updated on 20-Jun-2020 10:35:51

585 Views

Actually for using MySQL TRIM() function we must have to know the string which we want to trim from the original string. This becomes the major drawback of TRIM() in the cases where we want to trim the strings having different values. For example, suppose we want to get the output after trimming the last two characters from the strings but every string is having different characters at last two places.Examplemysql> Select * from Employee; +------+----------------+------------+-----------------+ | Id   | Name           | Address    | Department      | +------+----------------+------------+-----------------+ | 100  | Raman ... Read More

Java Regular Expression That Doesn't Contain a Certain String

Arnab Chakraborty
Updated on 20-Jun-2020 10:34:58

661 Views

Exampleimport java.util.regex.*; class PatternMatch{    public static void main(String args[]) {       String content = "I am a student";       String string = ".*boy.*";       boolean isMatch = Pattern.matches(string, content);       System.out.println("The line contains 'boy'?"+ isMatch);    } }Outputthe line contains 'boy'?falsematches()­­It is used to check if the whole text matches a pattern. Its output is boolean. It returns true if match is found otherwise false.This is one of simplest and easiest way of searching a String in a text using Regex .There is a another method compile() , if you want ... Read More

Eradicate Specific Suffix or Prefix from MySQL String

Sharon Christine
Updated on 20-Jun-2020 10:32:21

379 Views

MySQL TRIM() function is used to eradicate a specific suffix or prefix or both from the string. The working of TRIM() function can be understood with the help of its syntaxSyntaxTRIM([{BOTH | LEADING | TRAILING} [str_to_remove] FROM] string)Here,  The argument BOTH means the prefixes from both left and right to be removed from the string.LEADING argument means that only leading prefixes to be removed.TRAILING argument means that only trailing prefixes to be removed.Str_to_remove is the argument which means the string we want to remove from the string.String argument means the string from which the prefixes have to be removed.Examplemysql> Select ... Read More

Iterators in C#

Samual Sam
Updated on 20-Jun-2020 10:30:53

365 Views

Iterator performs a custom iteration over a collection. It uses the yield return statement and returns each element one at a time. The iterator remembers the current location and in the next iteration the next element is returned.The following is an example −Example Live Demousing System; using System.Collections.Generic; using System.Linq; namespace Demo {    class Program {       public static IEnumerable display() {          int[] arr = new int[] {99, 45, 76};          foreach (var val in arr) {             yield return val.ToString();       ... Read More

Write the First Program in C#

karthikeya Boyini
Updated on 20-Jun-2020 10:29:55

587 Views

The following is the first program in C# programming −Example Live Demousing System; namespace MyHelloWorldApplication {    class MyDemoClass {       static void Main(string[] args) {          // display text          Console.WriteLine("Hello World");          // display another text          Console.WriteLine("Welcome!");          Console.ReadKey();       }    } }OutputHello World Welcome!Let us see now what all it includes.using System; - the using keyword is used to include the System namespace in the program.namespace declaration - A namespace is a ... Read More

Declare an Event in C#

Samual Sam
Updated on 20-Jun-2020 10:29:25

397 Views

Events are user actions such as key press, clicks, mouse movements, etc., or some occurrence such as system-generated notifications.The events are declared and raised in a class and associated with the event handlers using delegates within the same class or some other class. The class containing the event is used to publish the event.To declare an event inside a class, first a delegate type for the event must be declared. For example, public delegate string myDelegate(string str);Now, declare an event −event myDelegate newEvent;Let us see an example to work with events in C# −Example Live Demousing System; namespace Demo { ... Read More

Declare and Initialize a Dictionary in C#

karthikeya Boyini
Updated on 20-Jun-2020 10:28:45

1K+ Views

Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.To declare and initialize a Dictionary −IDictionary d = new Dictionary();Above, types of key and value are set while declaring a dictionary object. An int is a type of key and string is a type of value. Both will get stored in a dictionary object named d.Let us now see an example −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       IDictionary d = new Dictionary();       d.Add(1, 97);       ... Read More

Advertisements