The Basics of MySQL

       The basics MySQL is a DBMS (Database Management System) which is multiuser and multireading. SQL (Structured Query Language) which is the standard language used for relational database management system.  
Data Types
Each data has a data type. Data types are divided into two: a standard data types and data type extension.
Some of the standard data types such as:
1. Char: to represent sequences of characters (String)
2. Integer: to declare integers
3. Numeric: to declare the real numbers

And expansion of multiple data types such as:

1. Varchar: to declare variable-length string
2. Boolean: to declare the type of logical (true or false)
3. Money: to declare the money
4. Blob: to express binary data or images
5. Serial: to declare the value of the order

MySQL Statement
DDL (Data Definition Language)
Create a database, use it, create tables, define index and table storage structure

-    CREATE DATABASE {database name to be created}.
     This command is used when creating a database for the first time
-    USE {database name to be used}.
     To use a database that was created
-    CREATE TABLE {table name to be created}.
     Create the necessary database tables.

DML (Data Manipulation System)
Manipulation and retrieval of data in the form of insertion or addition of new data, deletion of data and conversion data.

-    INSERT
     Command: INSERT INTO namatabel (field1, [field2, [...]]) VALUES (value1 [, value2, [....]);
-    UPDATE
     Command: UPDATE SET field1 = value1 namatabel, field2 = value2 [...] WHERE condition;
-    DELETE
     Command: DELETE FROM WHERE namatabel conditions;
-    SELECT
     Command: SELECT * FROM namatabel;
(*) To select the entire field when only some of which will be used fieldnya mentioned. Use of SELECT with a variety of conditions.


Using the operator IS NULL and IS NOT NULL

IS NULL operator is used to search for empty values ​​in a column, while IS NOT NULL is used to find values ​​that are not empty.

Example:
SELECT * FROM table WHERE my data IS NULL;
SELECT * FROM table WHERE my data S NOT NULL;
 
Sort the data with ORDER BY
Example:  SELECT * FROM table ORDER BY name;
 
Sort the data in Descending
Example:  SELECT * FROM table ORDER BY name DESC  

DCL (Data Control Language)
     DCL is a command to make the definition of users to access the database with a variety of previlage. DCL consists of a group of SQL Server commands to give the right to access the database, allocating space, pendefinisan space and auditing the use of the database. Usually this is available on the database management system that has the facility to limit the user premises security and authority 


Category Article

What's on Your Mind...

Powered by Blogger.