Tag Archives: sql tutorials online

SQL Syntax

Most Commonly used SQL Keywords are

SELECT, INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, JOIN, USE, SHOW

Note :

  1. Sql is case insensitive means you can use both upper case & lower case
  2. My Sql: If you are using MySql, Table Name are case sensitive means use the table names in MySql as they are
    in MySql Database.

Semicolon :

Semicolon after syntax is optional after the each statement but always use semicolon after the statement.

Example

select *from users;

 

Some Common Sql Commands

1. SELECT
2. INSERT
3. UPDATE
4. JOIN
5. DELETE
6. ALTER
7. DROP

SQL Tutorial

SQL (pronounced “ess-que-el”) stands for Structured Query Language.
SQL is standard language to communicate with a database.
According to ANSI (American National Standards Institute), Sql is the standard language for relational database management systems.

For Selecting all data from Users Table

Following Query is used :

Example

select *from users

Try it »

Get the best out of yourself with our SQL Tutorial online

How to select database using command line in Mysql

Use the following command to select database using command line in Mysql.

1 . Grant Permission

GRANT ALL PRIVILEGES ON `database_name`.* TO 'username'@'localhost'WITH GRANT OPTION;

2 . Now Select Database

Use database_name;

you will be switch to this database.

How to update row using joins in MYSQL | to updtae row ,data using joins in sql

You can update row using joins in MYSQL as follows :

 

update TABLE_1 join TABLE_2  on   TABLE_1.id=TABLE_2.user_id SET  TABLE_1.name =”Test”  where TABLE_2.user_id=’12’ ;