MySql Quries
Create Databases;Query is used to Create the Database(Schema).
use Query
use Databases;Query is used to Select the Database for creating the table.Remember without use database you cann't create table in the database.
All Table show in Database
show tables;
Query is used to show the list of all table in the database.Befor this Query you can select the database where you are check the table using Use Query.
Create Query
Create Table Query is used to Create the Table in the Database.You can create multiple table in the database according to your requirements.
not null is used when the user insert the data the user is necessary to insert the data in column in otherwise the data conn't be saved in database.It show error.if you not add the not null in your create table query then the user have the option when they input the data in the database if any field empty the data would be saved in the databases.
insert Query
Insert QueryQuery is used to insert the data in the Database.
Select Query
Select TableQuery is used to show the Record that have saved in the table.
Drop Query
Drop TableQuery is used to Delete the table in the Database.
Drop DatabaseQuery is used if you can delete the the complete the database then you can ente use drop database database_name; and your database is delete if you run this query.
ALTER TABLE
Alter Rename ColumnQuery is used to rename the column name by using alter query.
Add Column in Table Query is used to Add the new column in the database by using alter query.
ALTER TABLE - DROP COLUMN Query is used to Delete the column in the table by using alter query.
Alter ADD Primary Key in ColumnQuery is used to Add the Primary key in the column.But Remember Primary key is only apply on column follow the rule of primary key or empty column.
Alter ADD Foreign Key in ColumnQuery is used to Add the foreign key in the column.But Remember foreign key is only apply on empty column.
Alter ADD Default Constraints in ColumnQuery is used to Add the Default value in the database. If the user not Enter the Value of any column then the Default value would be set.
Primary and Foriegn key
Alter Rename ColumnWe have created two table one table name is hassan and other table name is ali.First we have create table hassan and create column in the table and write their primary key and datatypes.In other table ali we have created a column and one column name hassanID is take value from the primary key from other table and give the reference of the table.
Syntax :
How to Find mySql Database File in System?
Simple you can Go to C Drive and Enter the Search menu C:\ProgramData then you see the mySql folder.
How to get Backup of mysql Database?
Simple open cmd and run as Administator then type cd C:\Program Files\MySQL\MySQL Server 8.0\bin and hit Enter.After this Process you can Enter the blow code;
How to get Restore of mysql Database?
Simple open cmd and run as Administator then type cd C:\Program Files\MySQL\MySQL Server 8.0\bin and hit Enter.But Remember First you Create the Database name(mean Create Schema b/c the tables are import to the Schema) where you Import/Restore the Database.After this Process you can Enter the blow code;
How to get Restore of mysql Database in Xampp?
When you Import the mysql Database in Xampp the they show unicode Error then following code should be remove then your problem will be solve.
Mysql Database Query
MySQL Connection Using CMD through XAMPP
mysql mean Mysql Database
-u mean Username
-p mean password
-h mean host like localhost
-P means Port Number where you Run Sql
Arrow Error in Mysql
Arrow Error show in mysql if you have press the wrong mysql command then the arrow repeat when you press.Simply you can ctrl+cthen hit Enter this error will be resolve.
MariaDB [(none)]> in CMD:
MariaDB [(none)]>is used to all operation perform it. Like show databases, drop database databasename, create database databasename.
ctr+c is used in cmd to exit the MariaDB [(none)] to C:\xampp\mysql\bin>
Show Tables in CMD:
Show Tables Database in CMD:
Create Database:
USE DATABASE:
USE Query in Database is use for the Select the Database to Continue the Operation Like Create Table, Drop Table or Other.It is Necessary to Select Database Before to continue to create table in Database.
DROP DATABASE:
DROP DATABASE is used to Delete the Database to the Database and use for Delete a table from Database.
Create Table:
MySQL Connection Query:
die(); is used when the query not run sucessfully then show the error message.
SQL Query:Run MySQL Connection Query:
Example:Close MySQL Connection Query:
Example:Header Query in Database
header query is used in the database to Redirect the page to other page.When the data is send to Database then form will redirect.In location Section you can use the Code to the Form after Send Data Redirects.
Example:$_GET & $_POST
Read About $_GET AND $_POSTForm Call Self in Database
Read More About PHP_SELF
Pagination
Query: Example: How to Calculate Offset:In Page Number you can Add Page Start Number
Post a Comment