Got it

The Series of MySQL -1- Basic of MySQL - EP 01_04

Latest reply: May 22, 2022 12:22:45 931 26 17 0 0

The Series of MySQL -1- Basic of MySQL - EP 01_04

HI Hi, Greetings!  i_f47.gif

Happy December i_f25.gif


Hi Everyone,

Today, I would like to share with you an article about the first episode of Series of MySQL, and the content is given below.


a.    Data Types of MySQL

b.   Variables of MySQL


a.    Data Types of MySQL


A Data Type defines a certain type of data, such as integers, floating points, Booleans, and so on. It also describes the type's available values, actions that can be performed on the type, and how the type's values are stored. Each database table in MySQL has a number of columns, each with its own data type.

The following features can be used to determine the data type in MySQL:


·       The type of values it represents (fixed or variable).

·       It depends on whether the values are fixed-length or variable-length in terms of storage capacity.

·       Its values may or may not be indexed.

·       MySQL's method for comparing values of a specific data type.


MySQL has many SQL standard data types in many different categories. It employs a variety of data types, which can be classified.


                                          i.        Numeric:


MySQL includes all of the necessary SQL numeric data types. These data types can be exact numeric data types (for example, integer, decimal, numeric, etc.) or approximate numeric data types (for example, integer, decimal, numeric, etc). (For example, float, real, and double precision). It also has a BIT data type that can be used to hold bit values. Except for bit data types, numeric data types in MySQL are divided into two categories: signed and unsigned.


The following table lists all of the numeric data types that MySQL supports:


31

                                         ii.        Date and time:


Date, time, DateTime, timestamp, and year are all examples of temporal values represented by this data type. There are values in each temporal type, including zero. When we insert an invalid value, MySQL is unable to represent it, therefore it defaults to a zero value.


The table below shows all of the date and time data types that MySQL supports:

32

                                        iii.        String types:


The string data type is used to store plain text and binary data, such as files, pictures, and other types of data. MySQL can search for and compare string values using pattern matching techniques like the LIKE operator and Regular Expressions.


The table below shows all of the string data types that MySQL supports:

333


                                          iv.        BLOB:


BLOB is a data type in MySQL that can carry a large quantity of data. They are divided into four types based on the maximum length of data that they can carry.

The table below lists all of the Binary Large Object data formats that MySQL supports:


35

                                          v.        JSON data types:


Since MySQL 5.7.8, the native JSON data type has been supported. This data type enables us to quickly store and retrieve the JSON document.

When compared to storing JSON-format strings in a string column, the JSON data type offers the following benefits:


·       It checks JSON documents for errors automatically. It would generate an error if we stored invalid documents in JSON columns.

·       It has a storage format that is ideal.


35


b.    Variables of MySQL:


Variables are used to store data or information while a program is running. It is a method of labeling data with a meaningful term that aids the reader's comprehension of the program. The variable's principal purpose is to keep data in memory so that it can be used throughout the program.


Variables can be used in three different ways in MySQL, as seen below:


·       User-Defined Variable:


We occasionally need to transmit values from one statement to another. We can utilize the user-defined variable to store a value in one statement and then refer to it in another. To declare and initialize a variable in MySQL, use the SET and SELECT statements. The @ sign precedes the name of the user-defined variable.


User-defined variables such as @name and @NAME are case-insensitive; both are the same. A user-defined variable that is declared by one person cannot be seen by another. The user-defined variable can be assigned to only a few data types: integer, float, decimal, string, or NULL. The length of the user-defined variable is limited to 64 characters.


·       Local Variable:


It's a variable that isn't preceded by the @ symbol. A strongly typed variable is the local variable. The local variable's scope is defined in the saved program block in which it is declared. The DECLARE keyword is used by MySQL to declare the local variable. A DEFAULT clause is also included in the DECLARE statement to specify a default value for a variable. If you don't include the DEFAULT clause, the default value is NULL. It's most commonly utilized in stored procedure programs.


·       System Variable:


All program units belong to a particular class called system variables, which contains preset variables. MySQL has a number of system variables that control how it works, and each of these variables has a default value. Using the SET statement at runtime, we can alter several system variables dynamically. It allows us to make changes to the server's functionality without having to stop and restart it. In addition, the system variable can be used in expressions.


The MySQL server provides a variety of system variables, including the GLOBAL, SESSION, and MIX types. The GLOBAL variable is visible throughout the server's lifecycle, but the SESSION variable is only active during a single session.  



You are welcome to like and leave feedback in the comment area. 


Link: 


Main:



EP 01_01:

The Series of MySQL -1- Basic of MySQL - EP 01_01


EP 01_02:



EP 01_03:


EP 01_05:

The Series of MySQL -1- Basic of MySQL - EP 01_05



Source:

·        https://www.w3schools.com/mySQl/default.asp

·        https://www.mysqltutorial.org/mysql-basics/


M M Zaheer Hussain

Stay Safe!

tt


The post is synchronized to: Author groupzaheernew's Author Collection

  • x
  • convention:

Saqib123
Created Dec 29, 2021 16:50:08

Thanks for sharing
View more
  • x
  • convention:

zaheernew
zaheernew Created Dec 30, 2021 12:24:27 (0) (0)
Awesome  
maithi
Created Dec 30, 2021 08:53:18

Good one
View more
  • x
  • convention:

zaheernew
MVE Author Created Dec 30, 2021 18:42:30

@BAZ @Irina @little_fish @Anno7 @Kevin_Thomas @Saqib123 @faysalji @andersoncf1 @LucianoNhantumbo @Fuchsia @Unicef @Herediano @MahMush @adrian_alucard @IndianKid @Sara_Obaid @wissal @Vesper_EvenStar @hemin88 @AL_93 @Caroline_Herrera @Zemo_Mccracken @gzzz @chenhui @stephen.xu @Lan59 @dragos_v @olive.zhao @fuzi_yao @umaryaqub @Chenxintao @DDSN @Malik3000 @Y_T_Z @hamza11 @E.DR_91 @jason_hu @Diego.Silva @dengdengdeng
View more
  • x
  • convention:

zaheernew
MVE Author Created Dec 30, 2021 18:44:03

@BAZ @Irina @little_fish @Anno7 @Kevin_Thomas @Saqib123 @faysalji @andersoncf1 @LucianoNhantumbo @Fuchsia @Unicef @Herediano @MahMush @adrian_alucard @IndianKid @Sara_Obaid @wissal @Vesper_EvenStar @hemin88 @AL_93 @Caroline_Herrera @Zemo_Mccracken @gzzz @chenhui @stephen.xu @Lan59 @dragos_v @olive.zhao @fuzi_yao @umaryaqub @Chenxintao @DDSN @Malik3000 @Y_T_Z @hamza11 @E.DR_91 @jason_hu @Diego.Silva @dengdengdeng
View more
  • x
  • convention:

Rumana
Created Dec 31, 2021 06:02:42

The Series of MySQL -1- Basic of MySQL - EP 01_04-4572241-1
View more
  • x
  • convention:

zaheernew
MVE Author Created Jan 9, 2022 06:18:48

@wissal @BAZ @Unicef @user_4147187 @E.DR_91 @umaryaqub @sachandio @Malik3000 @MahMush @Abdussamed @Vlada85 @cmarban @lucian2003 @sliawatimena @hamza1 @amr_rashedy @Diego.Silva @andersoncf1 @bruno.guedes @Kashif @Lucfabrice @AymanOT @tubaboraka @DrDoom @Mahedi @Aqeel73 @Saqib123 @DienLg @Anno7 @IndianKid @Rumana @Vesper_EvenStar @Irina @AL_93 @faysalji @jason_hu @Y_T_Z @Somemeow @hemin88 @Kevin_Thomas @harisaliehsan @Irshadhussain @azkasaqib @NTan33 @hanhcao @mytruc
View more
  • x
  • convention:

BWGARM
Created Jan 9, 2022 06:37:20

The Series of MySQL -1- Basic of MySQL - EP 01_04-4588509-1
View more
  • x
  • convention:

Sara_Obaid
Created Jan 10, 2022 05:32:31

Thanks for sharing
View more
  • x
  • convention:

user_4326135
Created Jan 10, 2022 12:24:27

Thanks for sharing
View more
  • x
  • convention:

123
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.