Hello brothers, welcome to master arts.
Today we learn about database creation in phpmyadmin. Hindi me hi sikhate hai kya bolate ho ? Dosto, aap sap phpmy admin ke bare me to jante hi honge. Chalo aaj me batata hu aapko ki database kaise create karate hai.
Agar aapane nahi pada to yaha se sikh sakte hai. kaise phpmyadmin kholana hai. To aap browser me localhost likhe waha heder me aapko phpmyadmin mill jayega. Ager xamp on hai to. Agar aapko database creat karna hai to simple new pe click karke database bana de.
Create database
Database name wale box me database a name likh ke create kar de database ban jayega.
Create Tables
Jaisa ki aap uper left side bar me mera mydb name se database create hua hai usake + sign pe click karenge to aapko new likha milega usape click karke aap table create kar sakte hai. aap usape click karenge to kuch aisa page khulega.

Apako char column ke box dilkhenge. aap or column bhi add kar sakte hai table me uper add wale se. koi bhi table banaye pehala column ID ka banaye. to first box me ID likho or A_I wala box pe click karde A_I ka matlab hai auto increment. ab secon box me aap apane hisab se name dede jo jo requirement ho.
text limited field hai to type me varchar select kare lanth me aap 1 se 256 ki limit set kar sakte hai. or agar 256 se jyada insert karna chahte hai to TEXT select karle type lanth blank chod de. by default koi value add karna chahte hai to aap default me set kar sakte hai. or NULL allow nahi larna to NULL pe tik na kare. ab create karle table go pe click karke.
ab table create kar diya or aapko ek or column insert karna hai ya koi column nikalna hai to? iska bhi tarika hai dosto
Create Database
CREATE DATABASE testDB;
Create Index
CREATE INDEX idx_lastname ON Persons (LastName);
Create Table
CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) );
insert new column
ALTER TABLE table_name ADD COLUMN column_name varchar(256); // run this quarry in SQL first open database then
insert new column with default value
ALTER TABLE table_name ADD COLUMN column_name bit(1) DEFAULT 0; // run this quarry in SQL first open database then
Delete Drop column
ALTER TABLE table_name DROP COLUMN column_name; // run this quarry in SQL first open database then
Delete quarry
DELETE FROM table_name WHERE user_name='user'; // run this quarry in SQL first open database then
SQL PRIMARY KEY on CREATE TABLE
CREATE TABLE Persons ( ID int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Age int, PRIMARY KEY (ID) );
SQL FOREIGN KEY on CREATE TABLE
CREATE TABLE Orders ( OrderID int NOT NULL, OrderNumber int NOT NULL, PersonID int, PRIMARY KEY (OrderID), FOREIGN KEY (PersonID) REFERENCES Persons(PersonID) );
SQL Server Data Types
String data types:
CHAR(size) | A FIXED length string (can contain letters, numbers, and special characters). The size parameter specifies the column length in characters – can be from 0 to 255. Default is 1 |
VARCHAR(size) | A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum column length in characters – can be from 0 to 65535 |
BINARY(size) | Equal to CHAR(), but stores binary byte strings. The size parameter specifies the column length in bytes. Default is 1 |
VARBINARY(size) | Equal to VARCHAR(), but stores binary byte strings. The size parameter specifies the maximum column length in bytes. |
TINYBLOB | For BLOBs (Binary Large OBjects). Max length: 255 bytes |
TINYTEXT | Holds a string with a maximum length of 255 characters |
TEXT(size) | Holds a string with a maximum length of 65,535 bytes |
BLOB(size) | For BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data |
MEDIUMTEXT | Holds a string with a maximum length of 16,777,215 characters |
MEDIUMBLOB | For BLOBs (Binary Large OBjects). Holds up to 16,777,215 bytes of data |
LONGTEXT | Holds a string with a maximum length of 4,294,967,295 characters |
LONGBLOB | For BLOBs (Binary Large OBjects). Holds up to 4,294,967,295 bytes of data |
ENUM(val1, val2, val3, …) | A string object that can have only one value, chosen from a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. The values are sorted in the order you enter them |
SET(val1, val2, val3, …) | A string object that can have 0 or more values, chosen from a list of possible values. You can list up to 64 values in a SET list |
Numeric data types:
Data type | Description |
---|---|
BIT(size) | A bit-value type. The number of bits per value is specified in size. The size parameter can hold a value from 1 to 64. The default value for size is 1. |
TINYINT(size) | A very small integer. Signed range is from -128 to 127. Unsigned range is from 0 to 255. The size parameter specifies the maximum display width (which is 255) |
BOOL | Zero is considered as false, nonzero values are considered as true. |
BOOLEAN | Equal to BOOL |
SMALLINT(size) | A small integer. Signed range is from -32768 to 32767. Unsigned range is from 0 to 65535. The size parameter specifies the maximum display width (which is 255) |
MEDIUMINT(size) | A medium integer. Signed range is from -8388608 to 8388607. Unsigned range is from 0 to 16777215. The size parameter specifies the maximum display width (which is 255) |
INT(size) | A medium integer. Signed range is from -2147483648 to 2147483647. Unsigned range is from 0 to 4294967295. The size parameter specifies the maximum display width (which is 255) |
INTEGER(size) | Equal to INT(size) |
BIGINT(size) | A large integer. Signed range is from -9223372036854775808 to 9223372036854775807. Unsigned range is from 0 to 18446744073709551615. The size parameter specifies the maximum display width (which is 255) |
FLOAT(size, d) | A floating point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter. This syntax is deprecated in MySQL 8.0.17, and it will be removed in future MySQL versions |
FLOAT(p) | A floating point number. MySQL uses the p value to determine whether to use FLOAT or DOUBLE for the resulting data type. If p is from 0 to 24, the data type becomes FLOAT(). If p is from 25 to 53, the data type becomes DOUBLE() |
DOUBLE(size, d) | A normal-size floating point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter |
DOUBLE PRECISION(size, d) | |
DECIMAL(size, d) | An exact fixed-point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter. The maximum number for size is 65. The maximum number for d is 30. The default value for size is 10. The default value for d is 0. |
DEC(size, d) | Equal to DECIMAL(size,d) |
Hope understand everithing about database, we will explain insert update delete etc in next lession.
happy coding.
I’m not that much of a internet reader to be honest but your blogs
really nice, keep it up! I’ll go ahead and bookmark
your website to come back in the future. Cheers
My website best kratom (https://www.peninsuladailynews.com/marketplace/best-kratom-for-pain-top-strains-reviews-dosage-effects/)
Howdy! I’m at work browsing your blog from
my new iphone 3gs! Just wanted to say I love reading your blog and look forward to
all your posts! Keep up the fantastic work!
Its like you read my mind! You appear to know so much about this, like you
wrote the book in it or something. I think that you could do with some pics to drive the message home a little bit, but
other than that, this is fantastic blog. An excellent read.
I’ll certainly be back.
Also visit my website: penguin cbd
Hi there! This post could not be written any better! Looking at this article reminds me of my previous roommate!
He continually kept preaching about this. I most certainly will send this post
to him. Pretty sure he’ll have a great read. Thank you
for sharing!
Feel free to visit my webpage … buy weed, http://www.heraldnet.com,
Way cool! Some extremely valid points! I appreciate you writing this article and also the rest of the website is also really good.
I’d like to find out more? I’d want to find out some additional information.
Every weekend i used to pay a visit this website, for the reason that i wish for enjoyment, since this this website conations genuinely nice funny material too.
We wish to thank you again for the beautiful ideas you offered Janet when preparing a post-graduate research in addition to, most importantly, for providing many of the ideas in one blog post.
Hello! Would you mind if I share your blog with my myspace group? There’s a lot of people that I think would really appreciate your content. Please let me know. Thanks
I really liked this post i read your blog very often, and you’re always coming out with some great stuff. I shared this on my fb, and my followers really liked it.
Excellent article. I’m going through a few of these issues as well..
thanks for commenting