SQL Example, Codes and Tutorials

Advertisement

SQL stands for Structured Query Language. It is easy and allows us to create a database.

SQL Example, Codes and Tutorials

SQL Tutorials:Collection of SQL tutorials for beginners and advance programmers. We have
developed many tutorials and examples on SQL. Here you will find everything to
get started with SQL and then learn the advance concepts of SQL. The Standard
Query Language or SQL for short is standard language to interact with the
database. SQL allows you to create, delete, update tables and data stored in the
table. SQL provides everything to help the programmer to interact with database
and develop enterprise applications.

In this tutorial you will learn how to you user SQL to interact with
database. We have used MySQL database to make the process simple. You can easily
download MySQL from mysql.com and install on your machine to experiment and
learn the SQL concepts.

SQL BeginnerThe Tutorial brings a unique introduction on SQL for
beginners, who want to learn and understand SQL.

Following articles/examples are used frequently while interacting with the
databases. Learn SQL concepts by reading the following tutorials.

Data Normalization
In this section we will learn about the concepts of data normalization. The most important
thing in database designing is to make sure that the data get properly distributed among the tables.

Create a database
we can create a database by using the Database
name. In SQL the key word 'Show databases' finds the existing databases.
You may create your own or use an existing one after that create connection with database.

The INSERT INTO StatementTo insert records into a table, use the
key word insert into 'table name', just write a list of column names
separated by commas, followed by a closing parenthesis then using keyword
values, write the list of values enclosed in parenthesis.

The UPDATE StatementThe UPDATE statement is used to modify the data in the
database table in a specified manner. In the syntax of update statement the
keyword 'set' is used to assign a new value to a selected column. The
statement is accomplished by a where clause.

The DELETE StatementThe DELETE statement is used to delete rows in a table.
database will update that is why deletion and insertion of data will be
done.

SQL Add Column IntSQL Add Column Int is used to add new column, whose
field data type is integer.

SQL add column default valueAdd a Column default value is used in SQL, When create
statement Query is performed in SQL .Usually, the default value is given
to the column ,when no value is inserted to the column .

SQL Add ColumnSQL Add Column is used to add a new column in the
existing table.

SQL _ WildcardsSQL wildcards used for searching one or more
characters from data in a database.

LIKE OperatorThe LIKE operator is used for searching a
specified pattern in the column.

SQL SELECT DISTINCT
StatementIn this example we will show you the usage of Distinct
clause with the select statement. The SQL Distinct clause is used with the
Select statement to show all unique records from database.

SQL LEFT JOINThe LEFT JOIN keyword retrieve all rows from the left
table (table_name1), even if there are no matches in the right table
(table_name2).