MySQL
MySQL with PHP is a very popular database type. MySQL
is used to create an application on a Web server with PHP.
MySQL is an open-source RDBMS (Relational DataBase Management System).
- The MySQL abbreviation is 'My Structured Query Language'.
- MySQL is also used on XAMPP and LAMP famous web servers.
- MySQL uses many other websites like famous websites like Google, Facebook, Twitter.
- MySQL is free.
- Development of MySQL Oracle Corp. Has been done by
-MySQL is done on an operating system such as Windows, Linux, and Mac OS.
- Some tables can be created in MySQL database, which contains data in rows.
Here we have given 5 rows on one table. Information about 'student_name', 'percentages' and ' grade' of 5 students is given
- idstudent_namepercentagesgrade1Rakesh48.45C2Raju68.85B3Akshay80A4Raman75.25A5Deep90.96A
More than one database of MySQL is also created in PHP.MySQL Database; To create 'CREATE DATABASE database_name' statement is used.
Many tables are created in a database of MySQL.CREATE TABLE table_name This statement is used to create a table in the database.
Here the 'Student' name table has been taken and three fields are named id, student_name and
grade.Example of Creating Table Structure
CREATE TABLE Student(
id INT(2) AUTO_INCREMENT PRIMARY KEY,
student_name VARCHAR(50) NOT NULL,
grade VARCHAR(1) NOT NULL
)
Here INT (2), VARCHAR (50) and VARCHAR (1) are the data types of MySQL.All data types are taken down to MySQL.Data Types for MySQLIn MySQL, data types are divided into three types.Numeric Data TypesDate and Time Data Types- String Data Types
We Are CBitss Technologies We Provides best PHP Training In Chandigarh . We Also deal
in Wordpress ,MySQL , Android , C,C++ , Java & more Courses .more information join CBitss
And make your Career.
In MySQL, only a few data types are used.
- INT: Here the value of integer is signed (negative) or unsigned (positive). Here the length
of INT is from 1 to 11 digits. When no length is given for INT, then '11' gets the default
length. For eg. INT (8) - VARCHAR: The length of the characters in varchar ranges from 1 to 255. For eg.
VARCHAR (210)
- TINYTEXT: The length of the characters in tinytext is up to 255. If length is not given, then
default is there. - TEXT: The length of the characters in text is 65535. If length is not given, then default is
there.MEDIUMTEXT: The length of the characters in text is 16777215. If length is not
given, then default is there.
- LONGTEXT: The length of the characters in text is 4294967295. If length is not given, then
default is there.
- DATE: Date 'YYYY-MM-DD' is given in this format here. The date can be given from
1000-01-01 to 9999-12-30. For eg. 2090-12-15
- DATETIME: Here date and time 'YYYY-MM-DD HH: MM: SS' is in this format. The date
and time can be given from 1000-01-01 00:00 to 0999-12-30 23:59:59. For eg.
2090-12-15 22:58:45
On the columns, when the data type and their length are given, attributes are also given.AUTO_INCREMENT: There is a value increment of 1-1 each time here.NOT NULL: Null value is not allowed here. There should be some value on every record.UNSIGNED: Only positive value and zero are allowed here.DEFAULT default_value: Here the default value can be set. For eg. DEFAULT 0PRIMARY KEY: A value can not be returned here. AUTO_INCREMENT does not create
a duplicate value from this attribute here.
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments