SQL Bascis

1 How to create database

create database sarkarijobwob


//sarkarijobwob// is database name


2 How to get all database names

show databases


3 How to use a database

 use sarkarijobwob


Note: After using use command then only we can create the and edit the table



4 How to show tables

show table


//after using use command//



5: How to get more details of a table

desc user




//user is table name//


6: How to insert data into a table


insert into user (username) values ("vicky")


//user is table name//


7: How to look all the values in a table


select * from user


//user is table name//

 4: How to create table on SQL




Create table users ( id int, usermane text)

Second example

create table users (id int, username text, address_number float)


5 How to read a data base

SELECT * FROM [OrderDetails]


6 : How to delete table 

drop table user

\\"user" is table name//


**How to check engine

use users

show engine

show table status                            ///to check which engine is working on table////


**Types of engines 



**How to use different engines on a table

create table donald(id int) engine=MyISAM

//table name is donald

After entering show 

show table status




**How to change default storage engine

set default_storage_engine=MYISAM

** How to check SQL mode

select @@GLOBAL.SQL_MODE

select @@GLOBAL.SQL_MODE, @@session.SQL_MODE

Comments

Popular posts from this blog

Java Apni Kak

JS