Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

SQL in MySQL

SQL in MySQL

1. Firstly we have to start MySQL 5.5 Command line client then we need to enter password, created during installation.

After entering password, screen looks like below

2. To create database: Creation of database is necessary, before creating any table. To create a database in sql, follow following syntax.Syntax: – create database ;For Example: – create database kr;

3. To Use database: To use a created  database the use query is used in sql statement.Syntax: – use ;For Example: – use kr;

4. To show databases: The show database is used to show list of  all the databases in the sql statement.Syntax: – show database;

5. To create table: To create a table in sql database we have to give table name along with columns names and its attributes into the database, See the syntax and example below.Syntax: – create table table-name (properties);For Example: – create table kr (name varchar (30), rollno int (10), address varchar (30));

6. To insert value: To insert value in a table we have to follow below syntax and see the example below.     Syntax: – insert into (table name) (properties name) values ( values name);For Example: – insert into kr (name, rollno, address) values (ks, 23, burhanpur);

7. Show tables: Show tables query is used to show the list of tables in selected database in sql.Syntax: – show tables;

8. Select query: select query is used to show the selected database tables.Syntax: – select * from (table name);

9. Update: update query is used to update in the selected table.

10. Group by:

11. Like query:

12. Distinct query:

13.Drop query: