Jump to content

SQL-Structured Query Language


Recommended Posts

Hello

how are you guys ?

Today I will explain Ask for SQL

Arab section

In the name of God :

1. Tables | Tables

- Of course initially create a simple table as follows:

We use the command:

CREATE TABLE 

 

---

Ex:

CREATE TABLE programmers (id INTEGER, name TEXT, age INTEGER); 

Of course I'm SQL Editor user

When we create this table, I have a table will appear in this form in the editor

p_127cf021.png

---

Now we finished creating the table

If We Need add people to the table, how ?

add using this switch.

INSERT INTO & VALUES 

-

Ex:

INSERT INTO programmers (id, name, age) 
VALUES (1, "Mr.CoR", 18); 
INSERT INTO programmers (id, name, age) 
VALUES (2, "Tn6el", 18); 
INSERT INTO programmers (id, name, age) 
VALUES (3, "General", 20); 
INSERT INTO programmers (id, name, age) 
VALUES (4, "MoDeR", 16); 
INSERT INTO programmers (id, name, age) 
VALUES (5, "DABL", 19); 
INSERT INTO programmers (id, name, age) 
VALUES (6, "MezoO", 16); 
INSERT INTO programmers (id, name, age) 
VALUES (7, "ZA7F", 20); 
INSERT INTO programmers (id, name, age) 
VALUES (8, "TAPL", 21); 
INSERT INTO programmers (id, name, age) 
VALUES (9, "shweki", 18); 
INSERT INTO programmers (id, name, age) 
VALUES (10, "Mr.Grand", 16); 

 

It will show us the editor

p_127lj3m2.png

-

Now we have a table by programmers data

 

As an example we would expect that one of the programmers data error or a problem

How to adjust them?

Simply

Using the command:

UPDATE 
SET 
WHERE 

UPDATE: ordered to update the table

SET: What is the thing that caused you want?

WHERE: Where thing where you want to update?

UPDATE programmers -- here his gift is an event I programmers agenda

SET age = 22 -- Suppose that I am Gltt b Omar creepy, infield here Alkolmn to my father, which is brought about by age and after the equals sign and the new infield old

WHERE id = 7; -- Here or disparage place to Alro is the creep data

Here we discover that he was modifying data

p_127o2p03.png

-

We will suppose that we want to delete a specific statement of how?

Orders:

DELETE FROM & WHERE & IS & NULL

DELETE FROM: removed

WHERE: it is described previously

NULL:: lua in the language of the nill these are like the

Ex:

 

DELETE FROM programmers WHERE Instagram IS NULL; -- Here we are saying Delete programmers agenda when the ranks of Coleman Alanstaqram undefined 

Then becomes a table like this:

p_127h9ia6.png

-

We will suppose we want to determine the value of the table.

Orders:

SELECT 

Ex:

SELECT * FROM programmers; 

* = Identify all the values ​​in the table

Will suppose we wanted Bs Dhour the cloumn 2 only

We replace the name of the star cloumn

Ex:

SELECT name FROM programmers; 

It will show us this way!

p_127jni07.png

----

In this explanation we have learned these are commands in the language of SQL Wallace

1. CREATE TABLE = used for making table

2. INSERT INTO = used to add (Row - Cloumn) within the table

3. SELECT = are showing a certain something in the table, according to your selection

4. UPDATE = used to update a specific value within the table

5. ALTER TABLE = used to bring about radical changes in the table, such as adding a new Coleman

6. DELETE FROM = delete (Row - Cloumn) of the table

Author:

Mr.C (o) R

Transalte:

iMr.WiFi

Edited by Guest
Link to comment
  • 2 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...