I was using the database command of MySQL, I thought I should share these to help the world with a collection of the most common command of MySQL. Let’s get started. If you would like my collection let me know in the comment box so I can work more to impove my blog to help you guys.
CREATE SCHEMA DatabaseName;
create database DatabaseName;
CREATE SCHEMA School;
create database school;
This command is used to delete a database along with the whole data present in the database that you have added.
DROP SCHEMA DataBaseName; –OR DROP DATABASE DatabaseName;
DROP SCHEMA School; -Or DROP DATABASE School;
If there is one database or many, then you will have make one as default to start work. So you will have to use command “USE”. Its syntax is USE DataBaseName;
For Example database name is College, then you will have to write this command. “USE”
USE College;
If you have used a SQL command then you do not want to use that command, make it into comment.
Use this command. “–“
–use college;
SELECT column_name
FROM table_name;
SELECT statements fetch data from a table of a database. It is very common command to check the data of table from a database.
There is one common patron to select all columns records. “*” star mean select all columns.
select * from school;
select all columns from table school
CREATE TABLE table_name (
column_1 datatype,
column_2 datatype,
column_3 datatype
);
CREATE TABLE statements create a new table in the database of MySQl or SQL.
ALTER TABLE table_name
ADD column_name datatype;
ALTER TABLE statements add, delete, or modify columns in an existing table of MySQL.
DROP TABLE table_name;
DROP TABLE statements drop an existing table in a database of MySQL.
UPDATE table_name
SET some_column = some_value
WHERE some_column = some_value
UPDATE statements allow us to edit rows in a table of database. If “where” condition is not used then whole data will be updated. So be careful.
INSERT INTO table_name (column_1, column_2, column_3)
VALUES (value_1, ‘value_2’, value_3);
INSERT statements add a new row or multiple rows to a table of database.
DELETE FROM table_name
WHERE some_column = some_value;
DELETE statements remove rows from a table of database. If it “where” condition is not used then whole data will be deleted.
CREATE INDEX index_name
ON table_name (column_name1, column_name2…);
Index statements create on existing tables to retrieve the rows quickly and easily.
ALTER TABLE table_name
DROP INDEX index_name;
DROP INDEX statements delete an index in a table. very helpful
This question can be asked in multiple ways! First question is the main point which will be expalined and all questions will be answered by answering the first question. Let me first raise all questions related to this task. how to connect ptcl modem to ptcl modem how to connect ptcl modem to router how…
Homeopathy Remedy finder in Urdu is very helpful for doctors who are practicing in the field of homeopathy. If you are not a doctor or don’t have any knowledge of homeopathy then don’t use it before consulting any doctor. Share on Facebook Tweet Follow us Save Post Views: 186
ہمیں اس بات کا بخوبی علم ہے کہ تعلقات پیدا کرنے اور بڑھانے سے کامیابی کے حصول میں بھی کافی زیادہ مد د ملتی ہے۔ کیونکہ آپ اپنے دوست احباب سے بہت زیادہ مدد حاصل کر سکتے ہیں۔ لیکن یہ یادر ہے کہ اپنا مطلب نکالنے کے لئے دوست نہیں بنائے جاتے۔ اگر آپکے پیش…
کمر درد کا علاج از ہومیو ڈاکٹر مبشر احمد شاد صاحب آپ نے دیکھا ہو گا کہ ہر تیسرا مریض کمر درد کا ہوتا ہے ,اگر آپ کو کمر درد ہے تو یقین کریں کہ آپ محسوس کریں گے کہ نہ آپ دائیں طرف لیٹ سکتے ہیں نہ آپ بائیں طرف لیٹ سکتے ہیں نہ…
Create and Use DataBase in MySql Type this code for creating database in MySql create database adeel; Type this code for using by default database.use adeel; Create Table create table TestAdeel (id int, FirstName varchar(255),LastName varchar(255),FatherName varchar(255),Address varchar(255)); Insert into Table Data insert into testadeel (id, FirstName, LastName, FatherName, Address)values(1, ‘Adeel’, ‘Ahmad’, ‘Khalil’, ‘Lahore’); insert…
روس سے آنے والا تیل پاکستان کے لئے کئی فوائد پیدا کر سکتا ہے۔ میں یہاں ان فوائد کو انجام دیتا ہوں: 1. تجارتی فوائد: روس سے تیل کی خریداری پاکستان کو تجارتی فائدے پہنچاتی ہے۔ اس سے ملک کے درمیان تجارتی رشتے مضبوط ہوتے ہیں اور دونوں ممالک کے درمیان تجارت بڑھتی ہے۔ 2. …