UPDATES

Structured Question Language (SQL)| Full Clarification (Definition, utilization, construction and instance with MySQL)

[ad_1]

Structured Question Language (SQL)| Full Clarification (Definition, utilization, construction and instance with MySQL)

Whats up, my identify is Daniela Barazarte and I need to welcome you to this whole rationalization of SQL. This rationalization shall be intuitive and easy in addition to all the reasons which are a part of #DetectaLaLogica.

For those who choose movies, here’s a full tutorial made by me on YouTube, it is in Spanish but it surely additionally has subtitles: https://youtu.be/Hjs-zGEQtg8



Definition of every phrase

Structured Question Language (SQL) or Structured Question Language

  • Language: refers back to the algorithm and syntax used to jot down applications that a pc can perceive.
  • Structured: means to arrange the code of a program in smaller and extra logical items, in order that it’s simpler to grasp and preserve.
  • Question: refers to a selected seek for data in a database.



Full definition

SQL is a programming language used to handle and manipulate structured and relational databases utilizing queries.

SQL Database



#DetectTheLogic

SQL is named Structured Question Language (Structured Question Language) as a result of it’s actually a language that enables us to question a structured database and procure outcomes



In order that

It’s used to handle and manipulate relational databases, both to create, modify, delete, or view tables, objects, and information in a database.



When and the place

  • E-commerce web sites
  • Content material administration purposes
  • Social media apps
  • Knowledge evaluation purposes
  • Challenge administration purposes
  • Reserving and appointment apps



As

You want a relational database administration system that helps SQL (MySQL, Oracle, Microsoft SQL Server, and many others.) Then, you should use the instructions



Train

You have got an online software for a web-based retailer that sells electronics. You have to retailer and handle order data.



Methodology: SQL

-- Create the order desk
CREATE TABLE orders (
   id INT AUTO_INCREMENT PRIMARY KEY,
   shopper VARCHAR(50) NOT NULL,
   date DATE NOT NULL,
   product VARCHAR(50) NOT NULL,
   quantity INT NOT NULL,
   value DECIMAL(10,2) NOT NULL
);

-- Create orders
INSERT INTO orders (buyer, date, product, amount, value)
VALUES
   ('Juan Perez', '2023-06-16', 'Pink shirt', 2, 20.50),
   ('Ana Garcia', '2023-06-15', 'Blue pants', 1, 35.00),
   ('Luis Gomez', '2023-06-15', 'Inexperienced costume', 2, 40.00),
   ('Maria Hernandez', '2023-06-14', 'Bob Grapefruit Socks', 12, 5.80),
   ('Carlos Rodriguez', '2023-06-14', 'Jacket for the chilly', 1, 75.50),
   ('Laura Martinez', '2023-06-13', 'Blue Shirt', 3, 30.20),
   ('Pedro Sanchez', '2023-06-13', 'Cowboy Denims', 6, 50.00),
   ('Sofia Ramirez', '2023-06-12', 'Sweatshirt for train', 2, 25.80),
   ('Diego Torres', '2023-06-12', 'Crocodile Cap', 1, 12.80),
   ('Fernanda Castro', '2023-06-11', 'Coat', 2, 90.00);

-- Learn all orders
SELECT * FROM orders;

-- Learn order by ID
SELECT * FROM orders WHERE id = 3;

-- Edit/Replace Order
UPDATE orders SET amount = 4, value = 80.00 WHERE id = 5;

-- Delete order
DELETE FROM orders WHERE id IN (2, 6, 8);
Enter fullscreen mode

Exit fullscreen mode

SQL has a number of advantages:

  • It’s straightforward to study and use.
  • It is extremely environment friendly to govern and entry knowledge.
  • It’s versatile and may deal with each easy and sophisticated queries.
  • It’s scalable, it really works with small or very giant databases.
  • It’s a de facto customary, broadly suitable between completely different database programs.
  • When you grasp it, you possibly can apply your abilities to a number of database platforms.

(Keep in mind) #DetectaLaLógica: SQL is named Structured Question Language (Structured Question Language) as a result of it’s actually a language that enables us to question a structured database and procure outcomes

You may observe this matter in my GitHub repository (C# language code): https://github.com/danielabarazarte/DetectaLaLogica

Thanks very a lot for studying, when you’ve got any questions you possibly can remark and you can too observe me to see extra posts of this fashion, thanks <3.

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *