0% found this document useful (0 votes)
4 views2 pages

SQL Tutorial

SQL (Structured Query Language) is the standard language for managing data in relational databases, allowing users to create, delete, update, and read data. The tutorial provides steps to set up a MySQL environment and includes an example of creating a database, table, and inserting and retrieving data. SQL is widely supported across various database systems such as MySQL, Oracle, and PostgreSQL.

Uploaded by

rauta1934
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

SQL Tutorial

SQL (Structured Query Language) is the standard language for managing data in relational databases, allowing users to create, delete, update, and read data. The tutorial provides steps to set up a MySQL environment and includes an example of creating a database, table, and inserting and retrieving data. SQL is widely supported across various database systems such as MySQL, Oracle, and PostgreSQL.

Uploaded by

rauta1934
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL Tutorial

Structured Query Language (SQL) is the standard language used to interact with relational
databases.

• Mainly used to manage data. Whether you want to create, delete, update or read data,
SQL provides commands to perform these operations.

• Widely supported across various database systems like MySQL oracle, PostgreSQL, SQL
Server and many others.

• Mainly works with Relational Databases (data is stored in the form of tables).

Writing First SQL Query

Before running SQL queries you need to set up a database server like MySQL, PostgreSQL or
SQLite. Here, we are going to use MySQL server. Follow below steps to set up a basic SQL
Environment:

1. Install MySQL in your system

2. Start MySQL Server

3. Access MySQL Command Line

After your MySQL environment is set up, you can write your SQL program. Below is the example
to display " Hello World" using SQL.

1. Create a database named test_db

CREATE DATABASE test_db;

2. Use the test_db database

USE test_db;

3. Create a table named greetings

CREATE TABLE greetings (


id INT PRIMARY KEY,
message VARCHAR(255)
);
3. Insert the message 'Hello, World!' into the greetings table

INSERT INTO greetings (id,message)


VALUES (1,'Hello, World!');

4. Retrieve the message from the greetings table

SELECT message FROM greetings;

Output:

You might also like