<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Daniela "Ingeniela" Barazarte</title>
    <description>The latest articles on Forem by Daniela "Ingeniela" Barazarte (@ingeniela).</description>
    <link>https://forem.com/ingeniela</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1052868%2F99ee3fb5-b2f2-4972-88c9-15593637d082.jpeg</url>
      <title>Forem: Daniela "Ingeniela" Barazarte</title>
      <link>https://forem.com/ingeniela</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ingeniela"/>
    <language>en</language>
    <item>
      <title>对象关系映射（ORM）| 完整解释（定义、用法、结构和实践）</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Fri, 14 Jul 2023 19:38:53 +0000</pubDate>
      <link>https://forem.com/ingeniela/dui-xiang-guan-xi-ying-she-orm-wan-zheng-jie-shi-ding-yi-yong-fa-jie-gou-he-shi-jian--19d1</link>
      <guid>https://forem.com/ingeniela/dui-xiang-guan-xi-ying-she-orm-wan-zheng-jie-shi-ding-yi-yong-fa-jie-gou-he-shi-jian--19d1</guid>
      <description>&lt;p&gt;对象关系映射（ORM）| 完整解释（定义、用法、结构和实践）&lt;/p&gt;

&lt;h1&gt;
  
  
  介绍
&lt;/h1&gt;

&lt;p&gt;大家好，我是 Daniela Barazarte，欢迎您阅读有关 ORM（对象关系映射）的完整说明。 这个解释以及#DetectaLaLogica 中的所有解释一样直观且简单。&lt;/p&gt;

&lt;p&gt;如果您喜欢视频，这里是我在 YouTube 上制作的完整教程，它是西班牙语，但也有字幕：&lt;a href="https://www.youtube.com/watch?v=XIkDO9aPX_4"&gt;https://www.youtube.com/watch?v=XIkDO9aPX_4&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;理论&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  每个单词的定义
&lt;/h2&gt;

&lt;p&gt;*&lt;em&gt;对象关系映射（ORM）&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;对象（Object）：在OOP中，它是一个类的实例，具有允许其执行某些操作和操作数据的属性和方法。&lt;/li&gt;
&lt;li&gt;关系型（Relational）：关系数据库是组织成通过关系互连的表的数据结构。&lt;/li&gt;
&lt;li&gt;映射：是一种在编程语言的对象和关系数据库的表之间进行转换的方法。&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  完整定义
&lt;/h2&gt;

&lt;p&gt;它是一种用于连接关系数据库和面向对象编程语言的软件工程技术。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--76R3WpId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6187jygz44jm5m5qc5lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--76R3WpId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6187jygz44jm5m5qc5lm.png" alt="ORM" width="673" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #检测逻辑
&lt;/h2&gt;

&lt;p&gt;ORM全称为对象关系映射（Object-Relational Mapping），因为它是一种将面向对象编程语言的对象与关系数据库的表进行映射的技术。&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;使用&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  以便
&lt;/h2&gt;

&lt;p&gt;开发人员不必直接编写 SQL 查询，而是可以与表示数据库中数据的编程语言中的对象进行交互。&lt;/p&gt;

&lt;h2&gt;
  
  
  何时何地
&lt;/h2&gt;

&lt;p&gt;它广泛用于各种软件应用程序，从 Web 应用程序到桌面和移动应用程序。 它在处理大量数据并需要高效访问数据库的应用程序中特别有用。&lt;/p&gt;

&lt;h2&gt;
  
  
  作为
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hibernate：Java 的 ORM。&lt;/li&gt;
&lt;li&gt;EntityFramwork：.NET/C# 的 ORM&lt;/li&gt;
&lt;li&gt;Django ORM：Django 的默认 ORM。&lt;/li&gt;
&lt;li&gt;Sequel：Ruby 的 ORM。&lt;/li&gt;
&lt;li&gt;SQLAlchemy：Python 的 ORM。&lt;/li&gt;
&lt;li&gt;Eloquent：Laravel 框架中使用的 PHP ORM。&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;练习&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  锻炼
&lt;/h2&gt;

&lt;p&gt;您有一个销售电子产品的在线商店的 Web 应用程序。 您必须使用 OOP 语言存储和管理产品、客户、订单和财务交易的信息。&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;方法：SQL&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;我需要创建数据库，然后创建客户表并能够在其中插入数据...但考虑到我无法直接从网页执行此操作，它并没有那么有用&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Create a customer:
INSERT INTO clients (Name, Email)
VALUES('client name', 'client email');

-- Read all customers:
SELECT * FROM clients;

-- Edit a client
UPDATE clients
SET Name = 'new client name', Email = 'new client email'
WHERE Id = client id;

-- Delete a client
DELETE FROM clients
WHERE Id = client id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;方法：ORM&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;使用Csharp（编程语言）和实体框架（ORM）我可以使数据从网页直接进入数据库。 我将使用的数据库将是 MySql，我将需要不同的东西，但我可以突出显示此 ORM 中通常使用的 DbContext&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class MyDbContext : DbContext
     {
         // Add the connection line to the database in MySQL
         internal readonly string connectionString = "server=localhost;port=3306;database=dbclients";

         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             // Declare the use of MySQL and send the connection line and the MySQL version
             optionsBuilder.UseMySql(connectionString, new MySqlServerVersion(ServerVersion.AutoDetect(connectionString)));
         }
         // Declare the table to be used
         public DbSet&amp;lt;Client&amp;gt; Clients { get; set; }
     }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;建立连接后，我将需要进行迁移，然后我可以直接从项目开始执行某些功能。&lt;/p&gt;

&lt;p&gt;一个例子是添加客户端函数：&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Function to add a new customer to the database
static void AddClient(MyDbContext db)
{
     // Print a message to indicate that a new customer is being added
     Console.WriteLine("\nAdding a new client...");

     // Prompt the user to enter the customer's name and email
     Console.Write("Name: ");
     string name = Console.ReadLine();
     Console.Write("Email: ");
     string email = Console.ReadLine();

     // Create a new Client object with the data entered by the user
     var newClient = new Client
     {
         Name = name,
         email = email
     };

     // Add the new customer object to the database
     db.Clients.Add(newClient);

     // Save the changes to the database
     db.SaveChanges();

     // Print a message to indicate that the new customer has been added to the database
     Console.WriteLine($"Added client: {newClient.Name} ({newClient.Email})");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;并且可以执行类似的读取、编辑和删除功能。&lt;/p&gt;

&lt;p&gt;就像这样，您可以直接从应用程序与数据库交互，甚至无需使用 SQL 语言。&lt;/p&gt;

&lt;h1&gt;
  
  
  重要性
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ORM 有几个好处：&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;数据库抽象&lt;/li&gt;
&lt;li&gt;减少开发时间&lt;/li&gt;
&lt;li&gt;代码可移植性&lt;/li&gt;
&lt;li&gt;易于维护&lt;/li&gt;
&lt;li&gt;注入攻击的安全性&lt;/li&gt;
&lt;li&gt;工作更高效、更快&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;＃ 告别&lt;br&gt;
（记住）#DetectaLaLógica：ORM 被称为对象关系映射（Object-Relational Mapping），因为它是一种将面向对象编程语言中的对象与关系数据库表进行映射的技术。&lt;/p&gt;

&lt;p&gt;您可以在我的 GitHub 存储库（C# 语言代码）中练习此主题：&lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;非常感谢您的阅读，如果我的文章对您有帮助，您可以点赞，让更多的人看到，也可以评论您的任何问题或建议，感谢您关注我，查看更多此文章风格，谢谢&amp;lt;3。&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Mapeamento objeto-relacional (ORM) | Explicação completa (Definição, uso, estrutura e prática)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Fri, 14 Jul 2023 19:31:34 +0000</pubDate>
      <link>https://forem.com/ingeniela/mapeamento-objeto-relacional-orm-explicacao-completa-definicao-uso-estrutura-e-pratica-3gc6</link>
      <guid>https://forem.com/ingeniela/mapeamento-objeto-relacional-orm-explicacao-completa-definicao-uso-estrutura-e-pratica-3gc6</guid>
      <description>&lt;p&gt;Mapeamento objeto-relacional (ORM) | Explicação completa (Definição, uso, estrutura e prática)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introdução
&lt;/h1&gt;

&lt;p&gt;Olá, meu nome é Daniela Barazarte e quero dar as boas-vindas a esta explicação completa sobre ORM (Object-Relational Mapping). Esta explicação será intuitiva e simples assim como todas as explicações que fazem parte do #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;Se você preferir vídeos, aqui está um tutorial completo feito por mim no YouTube, é em espanhol, mas também tem legendas: &lt;a href="https://www.youtube.com/watch?v=XIkDO9aPX_4"&gt;https://www.youtube.com/watch?v=XIkDO9aPX_4&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Teoria&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definição de cada palavra
&lt;/h2&gt;

&lt;p&gt;*&lt;em&gt;Mapeamento Relacional de Objeto (ORM)&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object (Object): em OOP, é uma instância de uma classe que possui atributos e métodos que permitem realizar determinadas ações e manipular dados.&lt;/li&gt;
&lt;li&gt;Relacional (Relacional): banco de dados relacional é uma estrutura de dados organizada em tabelas que são interligadas por relacionamentos.&lt;/li&gt;
&lt;li&gt;Mapeamento: é uma forma de tradução entre os objetos de uma linguagem de programação e as tabelas de um banco de dados relacional.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definição completa
&lt;/h2&gt;

&lt;p&gt;É uma técnica de engenharia de software usada para conectar um banco de dados relacional e uma linguagem de programação orientada a objetos.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--76R3WpId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6187jygz44jm5m5qc5lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--76R3WpId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6187jygz44jm5m5qc5lm.png" alt="ORM" width="673" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectTheLogic
&lt;/h2&gt;

&lt;p&gt;O ORM é chamado de Object-Relational Mapping (Mapeamento Object-Relacional) porque é uma técnica de mapeamento de objetos de uma linguagem de programação orientada a objetos com tabelas de um banco de dados relacional.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Usar&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Para que
&lt;/h2&gt;

&lt;p&gt;Em vez de escrever consultas SQL diretamente, os desenvolvedores podem interagir com objetos na linguagem de programação que representam os dados no banco de dados.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quando e onde
&lt;/h2&gt;

&lt;p&gt;Ele é usado em uma ampla variedade de aplicativos de software, desde aplicativos da Web até aplicativos de desktop e móveis. É especialmente útil em aplicativos que lidam com grandes quantidades de dados e requerem acesso eficiente ao banco de dados.&lt;/p&gt;

&lt;h2&gt;
  
  
  Como
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hibernar: ORM para Java.&lt;/li&gt;
&lt;li&gt;Entity Framework: ORM para .NET/C#&lt;/li&gt;
&lt;li&gt;Django ORM: ORM padrão para Django.&lt;/li&gt;
&lt;li&gt;Sequela: ORM para Ruby.&lt;/li&gt;
&lt;li&gt;SQLAlchemy: ORM para Python.&lt;/li&gt;
&lt;li&gt;Eloquent: ORM para PHP que é utilizado no framework Laravel.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Praticar&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Exercício
&lt;/h2&gt;

&lt;p&gt;Você tem um aplicativo da web para uma loja online que vende eletrônicos. Você deve armazenar e gerenciar as informações de produtos, clientes, pedidos e transações financeiras usando uma linguagem OOP.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Método: SQL&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Preciso criar o banco de dados, depois criar a tabela do cliente e poder inserir dados lá... mas não é tão útil considerando que não posso fazer isso diretamente da página da web&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Criar um cliente:
INSERT INTO clientes (Nome, E-mail)
VALUES('nome do cliente', 'e-mail do cliente');

-- Leia todos os clientes:
SELECIONE * DE clientes;

-- Editar um cliente
ATUALIZAR clientes
SET Nome = 'novo nome do cliente', Email = 'novo email do cliente'
WHERE Id = id do cliente;

-- Excluir um cliente
EXCLUIR DE clientes
WHERE Id = id do cliente;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Método: ORM&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Com Csharp (Linguagem de Programação) E Entity Framework (ORM), posso fazer com que os dados cheguem diretamente ao banco de dados da página da web. O banco de dados que usarei será MySql e precisarei de coisas diferentes, mas posso destacar o DbContext que geralmente é usado neste ORM&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;classe pública MyDbContext : DbContext
     {
         // Adiciona a linha de conexão ao banco de dados no MySQL
         string interna readonly connectionString = "server=localhost;port=3306;database=dbclients";

         substituição protegida void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             // Declara o uso do MySQL e envia a linha de conexão e a versão do MySQL
             optionsBuilder.UseMySql(connectionString, new MySqlServerVersion(ServerVersion.AutoDetect(connectionString)));
         }
         // Declara a tabela a ser utilizada
         public DbSet&amp;lt;Client&amp;gt; Clientes { get; definir; }
     }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uma vez feita a conexão, vou precisar fazer as migrações e a partir daí posso começar a fazer determinadas funções diretamente do projeto.&lt;/p&gt;

&lt;p&gt;Um exemplo é a função adicionar cliente:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Função para adicionar um novo cliente ao banco de dados
static void AddClient(MyDbContext db)
{
     // Imprime uma mensagem para indicar que um novo cliente está sendo adicionado
     Console.WriteLine("\nAdicionando um novo cliente...");

     // Solicita ao usuário que insira o nome e o e-mail do cliente
     Console.Write("Nome: ");
     string nome = Console.ReadLine();
     Console.Write("E-mail: ");
     string email = Console.ReadLine();

     // Cria um novo objeto Cliente com os dados inseridos pelo usuário
     var novoCliente = novo Cliente
     {
         nome = nome,
         e-mail = e-mail
     };

     // Adiciona o novo objeto cliente ao banco de dados
     db.Clients.Add(newClient);

     //Salva as alterações no banco de dados
     db.SaveChanges();

     // Imprime uma mensagem para indicar que o novo cliente foi adicionado ao banco de dados
     Console.WriteLine($"Cliente adicionado: {newClient.Name} ({newClient.Email})");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;E funções semelhantes podem ser executadas para leitura, edição e exclusão.&lt;/p&gt;

&lt;p&gt;E assim, você pode interagir com um banco de dados diretamente da sua aplicação, mesmo sem usar a linguagem SQL.&lt;/p&gt;

&lt;h1&gt;
  
  
  Importância
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ORM tem vários benefícios:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Abstração de banco de dados&lt;/li&gt;
&lt;li&gt;Redução do tempo de desenvolvimento&lt;/li&gt;
&lt;li&gt;Portabilidade de código&lt;/li&gt;
&lt;li&gt;Facilidade de manutenção&lt;/li&gt;
&lt;li&gt;Segurança para ataques de injeção&lt;/li&gt;
&lt;li&gt;Trabalhe de forma mais eficiente e rápida&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Até a próxima
&lt;/h1&gt;

&lt;p&gt;(Lembre-se) #DetectaLaLógica: ORM é chamado de Object-Relational Mapping (Mapeamento Object-Relacional) porque é uma técnica de mapeamento de objetos a partir de uma linguagem de programação orientada a objetos com tabelas de banco de dados relacional.&lt;/p&gt;

&lt;p&gt;Você pode praticar este tópico em meu repositório GitHub (código da linguagem C#): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Muito obrigado por ler, se meu post te ajudou, você pode dar um LIKE para que mais pessoas possam ler, você também pode comentar qualquer dúvida ou sugestão que você tenha e eu agradeço se você me seguir para ver mais posts deste estilo, obrigada &amp;lt;3.&lt;/p&gt;

</description>
      <category>braziliandevs</category>
      <category>tutorial</category>
      <category>detectalalogica</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Object-Relational Mapping (ORM)| Full Explanation (Definition, usage, structure and practice)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Fri, 14 Jul 2023 19:29:31 +0000</pubDate>
      <link>https://forem.com/ingeniela/object-relational-mapping-orm-full-explanation-definition-usage-structure-and-practice-4ccd</link>
      <guid>https://forem.com/ingeniela/object-relational-mapping-orm-full-explanation-definition-usage-structure-and-practice-4ccd</guid>
      <description>&lt;p&gt;Object-Relational Mapping (ORM)| Full Explanation (Definition, usage, structure and practice)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Hello, my name is Daniela Barazarte and I want to welcome you to this complete explanation about ORM (Object-Relational Mapping). This explanation will be intuitive and simple as well as all the explanations that are part of #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;If you prefer videos, here is a complete tutorial made by me on YouTube, it's in Spanish but it also has subtitles: &lt;a href="https://www.youtube.com/watch?v=XIkDO9aPX_4"&gt;https://www.youtube.com/watch?v=XIkDO9aPX_4&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Theory&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definition of each word
&lt;/h2&gt;

&lt;p&gt;*&lt;em&gt;Object Relational Mapping (ORM)&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object (Object): in OOP, it is an instance of a class that has attributes and methods that allow it to perform certain actions and manipulate data.&lt;/li&gt;
&lt;li&gt;Relational (Relational): relational database is a data structure organized into tables that are interconnected by relationships.&lt;/li&gt;
&lt;li&gt;Mapping: is a way of translating between the objects of a programming language and the tables of a relational database.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Full definition
&lt;/h2&gt;

&lt;p&gt;It is a software engineering technique used to connect a relational database and an object-oriented programming language.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--76R3WpId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6187jygz44jm5m5qc5lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--76R3WpId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6187jygz44jm5m5qc5lm.png" alt="ORM" width="673" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectTheLogic
&lt;/h2&gt;

&lt;p&gt;ORM is called Object-Relational Mapping (Object-Relational Mapping) because it is a technique of mapping objects of an object-oriented programming language with tables of a relational database.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Use&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  So that
&lt;/h2&gt;

&lt;p&gt;Instead of having to write SQL queries directly, developers can interact with objects in the programming language that represent the data in the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  When and where
&lt;/h2&gt;

&lt;p&gt;It is used in a wide variety of software applications, from web applications to desktop and mobile applications. It is especially useful in applications that handle large amounts of data and require efficient access to the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  As
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hibernate: ORM for Java.&lt;/li&gt;
&lt;li&gt;Entity Framework: ORM for .NET/C#&lt;/li&gt;
&lt;li&gt;Django ORM: Default ORM for Django.&lt;/li&gt;
&lt;li&gt;Sequel: ORM for Ruby.&lt;/li&gt;
&lt;li&gt;SQLAlchemy: ORM for Python.&lt;/li&gt;
&lt;li&gt;Eloquent: ORM for PHP that is used in the Laravel framework.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Practice&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Exercise
&lt;/h2&gt;

&lt;p&gt;You have a web application for an online store that sells electronics. You must store and manage the information of products, customers, orders and financial transactions using an OOP language.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Method: SQL&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I need to create the database, then create the customer table and be able to insert data there... but it's not that useful considering that I can't do it directly from the web page&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Create a customer:
INSERT INTO clients (Name, Email)
VALUES('client name', 'client email');

-- Read all customers:
SELECT * FROM clients;

-- Edit a client
UPDATE clients
SET Name = 'new client name', Email = 'new client email'
WHERE Id = client id;

-- Delete a client
DELETE FROM clients
WHERE Id = client id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Method: ORM&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;With Csharp(Programming Language) AND Entity Framework(ORM) I can make the data come directly to the database from the web page. The database that I will use will be MySql and I will need different things but I can highlight the DbContext that is usually used in this ORM&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class MyDbContext : DbContext
     {
         // Add the connection line to the database in MySQL
         internal readonly string connectionString = "server=localhost;port=3306;database=dbclients";

         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             // Declare the use of MySQL and send the connection line and the MySQL version
             optionsBuilder.UseMySql(connectionString, new MySqlServerVersion(ServerVersion.AutoDetect(connectionString)));
         }
         // Declare the table to be used
         public DbSet&amp;lt;Client&amp;gt; Clients { get; set; }
     }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the connection is made, I'm going to need to do migrations and from there I can start doing certain functions directly from the project.&lt;/p&gt;

&lt;p&gt;An example is the add client function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Function to add a new customer to the database
static void AddClient(MyDbContext db)
{
     // Print a message to indicate that a new customer is being added
     Console.WriteLine("\nAdding a new client...");

     // Prompt the user to enter the customer's name and email
     Console.Write("Name: ");
     string name = Console.ReadLine();
     Console.Write("Email: ");
     string email = Console.ReadLine();

     // Create a new Client object with the data entered by the user
     var newClient = new Client
     {
         Name = name,
         email = email
     };

     // Add the new customer object to the database
     db.Clients.Add(newClient);

     // Save the changes to the database
     db.SaveChanges();

     // Print a message to indicate that the new customer has been added to the database
     Console.WriteLine($"Added client: {newClient.Name} ({newClient.Email})");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And similar functions can be performed for reading, editing and deleting.&lt;/p&gt;

&lt;p&gt;And just like that, you can interact with a database directly from your application without even using SQL language.&lt;/p&gt;

&lt;h1&gt;
  
  
  Importance
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ORM has several benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database abstraction&lt;/li&gt;
&lt;li&gt;Reduced development time&lt;/li&gt;
&lt;li&gt;Code portability&lt;/li&gt;
&lt;li&gt;Ease of maintenance&lt;/li&gt;
&lt;li&gt;Security for injection attacks&lt;/li&gt;
&lt;li&gt;Work more efficient and faster&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Farewell
&lt;/h1&gt;

&lt;p&gt;(Remember) #DetectaLaLógica: ORM is called Object-Relational Mapping (Object-Relational Mapping) because it is a technique of mapping objects from an object-oriented programming language with relational database tables.&lt;/p&gt;

&lt;p&gt;You can practice this topic in my GitHub repository (C# language code): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you very much for reading, if my post helped you, you can give it a LIKE so that more people can read it, you can also comment on any questions or suggestions you have and I appreciate you following me to see more posts of this style, thanks &amp;lt;3.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>detectalalogica</category>
    </item>
    <item>
      <title>Object-Relational Mapping (ORM)| Explicación Completa (Definición, uso, estructura y práctica)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Fri, 14 Jul 2023 19:27:09 +0000</pubDate>
      <link>https://forem.com/ingeniela/object-relational-mapping-orm-explicacion-completa-definicion-uso-estructura-y-practica-4j56</link>
      <guid>https://forem.com/ingeniela/object-relational-mapping-orm-explicacion-completa-definicion-uso-estructura-y-practica-4j56</guid>
      <description>&lt;p&gt;Object-Relational Mapping (ORM)| Explicación Completa (Definición, uso, estructura y práctica)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducción
&lt;/h1&gt;

&lt;p&gt;Hola buenas, mi nombre es Daniela Barazarte y te quiero dar la bienvenida a esta explicación completa sobre ORM (Object-Relational Mapping). Esta explicación será intuitiva y simple así como todas las explicaciones que forman parte de #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;Si prefieres los videos, aquí tienes un tutorial completo hecho por mí en YouTube, está en español pero también tiene subtítulos: &lt;a href="https://www.youtube.com/watch?v=XIkDO9aPX_4" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=XIkDO9aPX_4&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Teoría&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definición de cada palabra
&lt;/h2&gt;

&lt;p&gt;*&lt;em&gt;Object-Relational Mapping (ORM)&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object (Objeto): en POO, es una instancia de una clase que tiene atributos y métodos que le permiten realizar ciertas acciones y manipular datos.&lt;/li&gt;
&lt;li&gt;Relational (Relacional): base de datos relacional es una estructura de datos organizada en tablas que están interconectadas mediante relaciones.&lt;/li&gt;
&lt;li&gt;Mapping (Mapeo): es una forma de traducir entre los objetos de un lenguaje de programación y las tablas de una base de datos relacional.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definición completa
&lt;/h2&gt;

&lt;p&gt;Es una técnica en ingeniería de software que se utiliza para conectar una base de datos relacional y un lenguaje de programación orientado a objetos.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6187jygz44jm5m5qc5lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6187jygz44jm5m5qc5lm.png" alt="ORM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectaLaLógica
&lt;/h2&gt;

&lt;p&gt;ORM se dice Object-Relational Mapping (Mapeo Objeto-Relacional) pues es una técnica de mapear objetos de un lenguaje de programación orientado a objetos con tablas de una base de datos relacional.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Uso&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Para qué
&lt;/h2&gt;

&lt;p&gt;En lugar de tener que escribir consultas SQL directamente, los desarrolladores pueden interactuar con objetos en el lenguaje de programación que representan los datos en la base de datos&lt;/p&gt;

&lt;h2&gt;
  
  
  Cuando y donde
&lt;/h2&gt;

&lt;p&gt;Se utiliza en una amplia variedad de aplicaciones de software, desde aplicaciones web hasta aplicaciones de escritorio y móviles. Es especialmente útil en aplicaciones que manejan grandes cantidades de datos y que requieren un acceso eficiente a la base de datos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cómo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hibernate: ORM para Java. &lt;/li&gt;
&lt;li&gt;Entity Framework: ORM para .NET/C#&lt;/li&gt;
&lt;li&gt;Django ORM: ORM predeterminado para Django.&lt;/li&gt;
&lt;li&gt;Sequel: ORM para Ruby.&lt;/li&gt;
&lt;li&gt;SQLAlchemy: ORM para Python.&lt;/li&gt;
&lt;li&gt;Eloquent: ORM para PHP que se utiliza en el framework Laravel. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Práctica&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Ejercicio
&lt;/h2&gt;

&lt;p&gt;Tienes una aplicación web de una tienda en línea que vende productos electrónicos. Debes almacenar y gestionar la información de los productos, clientes, pedidos y transacciones financieras utilizando un lenguaje de POO.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Método: SQL&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Necesito crear la base de datos, después crear la tabla de clientes y ahí poder insertar datos... pero no es tan útil considerando que no lo puedo hacer directamente desde la página web&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

-- Crear un cliente:
INSERT INTO clients (Name, Email)
VALUES ('client name', 'client email');

-- Leer todos los clientes:
SELECT * FROM clients;

-- Editar un client
UPDATE clients
SET Name = 'new client name', Email = 'new client email'
WHERE Id = client id;

-- Eliminar un client
DELETE FROM clients
WHERE Id = client id;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Método: ORM&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Con Csharp(Lenguaje de programación) Y Entity Framework(ORM) puedo hacer que los datos lleguen directamente a la base de datos desde la página web. La base de datos que utilizaré será MySql y necesitaré diferentes cosas pero puedo destacar el DbContext que suele utilizarse en este ORM&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

public class MyDbContext : DbContext
    {
        // Agregar la liena de conexión a la base de datos en MySQL
        internal readonly string connectionString = "server=localhost;port=3306;database=dbclients";

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            // Declarar el uso de MySQL y enviar la linea de conexión y la versión del MySQL
            optionsBuilder.UseMySql(connectionString, new MySqlServerVersion(ServerVersion.AutoDetect(connectionString)));
        }
        // Declaro la tabla que se va a utilizar
        public DbSet&amp;lt;Client&amp;gt; Clients { get; set; }
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Una vez hecha la conexión, voy a necesitar hacer migraciones y de ahi puedo empezar a hacer ciertas funciones directamente desde el proyecto.&lt;/p&gt;

&lt;p&gt;Un ejemplo es la función de agregar cliente:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

// Función para agregar un nuevo cliente a la base de datos
static void AddClient(MyDbContext db)
{
    // Imprime un mensaje para indicar que se está agregando un nuevo cliente
    Console.WriteLine("\nAdding a new client...");

    // Solicita al usuario que ingrese el nombre y el correo electrónico del cliente
    Console.Write("Name: ");
    string name = Console.ReadLine();
    Console.Write("Email: ");
    string email = Console.ReadLine();

    // Crea un nuevo objeto de tipo Client con los datos ingresados por el usuario
    var newClient = new Client
    {
        Name = name,
        Email = email
    };

    // Agrega el nuevo objeto de cliente a la base de datos
    db.Clients.Add(newClient);

    // Guarda los cambios en la base de datos
    db.SaveChanges();

    // Imprime un mensaje para indicar que se ha agregado el nuevo cliente a la base de datos
    Console.WriteLine($"Added client: {newClient.Name} ({newClient.Email})");
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Y se pueden realizar funciones similares para la lectura, edición y eliminación.&lt;/p&gt;

&lt;p&gt;Y así de simple ya puedes interactuar con una base de datos, directamente desde tu aplicación sin siquiera utilizar lenguaje SQL.&lt;/p&gt;

&lt;h1&gt;
  
  
  Importancia
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ORM tiene varios beneficios:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Abstraccion de la base de datos&lt;/li&gt;
&lt;li&gt;Reducción del tiempo de desarrollo&lt;/li&gt;
&lt;li&gt;Portabilidad del código&lt;/li&gt;
&lt;li&gt;Facilidad del mantenimiento&lt;/li&gt;
&lt;li&gt;Seguridad para ataques de inyección&lt;/li&gt;
&lt;li&gt;Trabajo más eficiente y rápido&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Despedida
&lt;/h1&gt;

&lt;p&gt;(Recuerda) #DetectaLaLógica: ORM se dice Object-Relational Mapping (Mapeo Objeto-Relacional) pues es una técnica de mapear objetos de un lenguaje de programación orientado a objetos con tablas de una base de datos relacional.&lt;/p&gt;

&lt;p&gt;Puedes practicar este tema en mi repositorio de GitHub (Código en lenguaje C#): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica" rel="noopener noreferrer"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Muchas gracias por leer, si mi post te ayudó le puedes dar LIKE para que más personas lo puedan leer, también puedes comentar cualquier duda o sugerenia que tengas y agradezco que me sigas para ver más posts de este estilo, gracias &amp;lt;3.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>database</category>
      <category>tutorial</category>
      <category>detectalalogica</category>
    </item>
    <item>
      <title>结构化查询语言（SQL）| 完整解释（定义、用法、结构和 MySQL 示例）</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 23:28:05 +0000</pubDate>
      <link>https://forem.com/ingeniela/jie-gou-hua-cha-xun-yu-yan-sql-wan-zheng-jie-shi-ding-yi-yong-fa-jie-gou-he-mysql-shi-li--pk2</link>
      <guid>https://forem.com/ingeniela/jie-gou-hua-cha-xun-yu-yan-sql-wan-zheng-jie-shi-ding-yi-yong-fa-jie-gou-he-mysql-shi-li--pk2</guid>
      <description>&lt;p&gt;结构化查询语言（SQL）| 完整解释（定义、用法、结构和 MySQL 示例）&lt;/p&gt;

&lt;h1&gt;
  
  
  介绍
&lt;/h1&gt;

&lt;p&gt;您好，我的名字是 Daniela Barazarte，欢迎您阅读 SQL 的完整解释。 这个解释以及#DetectaLaLogica 中的所有解释一样直观且简单。&lt;/p&gt;

&lt;p&gt;如果您喜欢视频，这里是我在 YouTube 上制作的完整教程，它是西班牙语，但也有字幕：&lt;a href="https://youtu.be/Hjs-zGEQtg8"&gt;https://youtu.be/Hjs-zGEQtg8&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;理论&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  每个单词的定义
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;结构化查询语言 (SQL) 或结构化查询语言&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;语言（Language）：指用于编写计算机可以理解的程序的一组规则和语法。&lt;/li&gt;
&lt;li&gt;结构化（Structured）：意味着将程序的代码组织成更小、更逻辑的片段，以便更容易理解和维护。&lt;/li&gt;
&lt;li&gt;查询：指在数据库中对信息进行特定的搜索。&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  完整定义
&lt;/h2&gt;

&lt;p&gt;SQL 是一种编程语言，用于使用查询来管理和操作结构化数据库和关系数据库。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" alt="SQL 数据库" width="235" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #检测逻辑
&lt;/h2&gt;

&lt;p&gt;SQL被称为结构化查询语言（Structured Query Language），因为它字面意思是一种允许我们查询结构化数据库并获取结果的语言&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;使用&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  以便
&lt;/h2&gt;

&lt;p&gt;它用于管理和操作关系数据库，用于创建、修改、删除或查看数据库中的表、对象和记录。&lt;/p&gt;

&lt;h2&gt;
  
  
  何时何地
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;电子商务网站&lt;/li&gt;
&lt;li&gt;内容管理应用程序&lt;/li&gt;
&lt;li&gt;社交媒体应用程序&lt;/li&gt;
&lt;li&gt;数据分析应用&lt;/li&gt;
&lt;li&gt;项目管理应用程序&lt;/li&gt;
&lt;li&gt;预订和预约应用程序&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  作为
&lt;/h2&gt;

&lt;p&gt;你需要一个支持SQL的关系数据库管理系统（MySQL、Oracle、Microsoft SQL Server等），那么你必须使用以下命令&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;练习&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  锻炼
&lt;/h2&gt;

&lt;p&gt;您有一个销售电子产品的在线商店的 Web 应用程序。 您必须存储和管理订单信息。&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;方法：SQL&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Create the order table
CREATE TABLE orders (
   id INT AUTO_INCREMENT PRIMARY KEY,
   client VARCHAR(50) NOT NULL,
   date DATE NOT NULL,
   product VARCHAR(50) NOT NULL,
   amount INT NOT NULL,
   price DECIMAL(10,2) NOT NULL
);

-- Create orders
INSERT INTO orders (customer, date, product, quantity, price)
VALUES
   ('Juan Perez', '2023-06-16', 'Red shirt', 2, 20.50),
   ('Ana Garcia', '2023-06-15', 'Blue pants', 1, 35.00),
   ('Luis Gomez', '2023-06-15', 'Green dress', 2, 40.00),
   ('Maria Hernandez', '2023-06-14', 'Bob Grapefruit Socks', 12, 5.80),
   ('Carlos Rodriguez', '2023-06-14', 'Jacket for the cold', 1, 75.50),
   ('Laura Martinez', '2023-06-13', 'Blue Blouse', 3, 30.20),
   ('Pedro Sanchez', '2023-06-13', 'Cowboy Jeans', 6, 50.00),
   ('Sofia Ramirez', '2023-06-12', 'Sweatshirt for exercise', 2, 25.80),
   ('Diego Torres', '2023-06-12', 'Crocodile Cap', 1, 12.80),
   ('Fernanda Castro', '2023-06-11', 'Coat', 2, 90.00);

-- Read all orders
SELECT * FROM orders;

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

-- Edit/Update Order
UPDATE orders SET quantity = 4, price = 80.00 WHERE id = 5;

-- Delete order
DELETE FROM orders WHERE id IN (2, 6, 8);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  重要性
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;SQL 有几个好处：&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;易于学习和使用。&lt;/li&gt;
&lt;li&gt;操作和访问数据非常有效。&lt;/li&gt;
&lt;li&gt;它很灵活，可以处理简单和复杂的查询。&lt;/li&gt;
&lt;li&gt;它具有可扩展性，适用于小型或大型数据库。&lt;/li&gt;
&lt;li&gt;它是事实上的标准，在不同数据库系统之间广泛兼容。&lt;/li&gt;
&lt;li&gt;一旦掌握了它，您就可以将您的技能应用到多个数据库平台。&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  告别
&lt;/h1&gt;

&lt;p&gt;（记住）#DetectaLaLógica：SQL被称为结构化查询语言（Structured Query Language），因为它字面上是一种允许我们查询结构化数据库并获取结果的语言&lt;/p&gt;

&lt;p&gt;您可以在我的 GitHub 存储库（C# 语言代码）中练习此主题：&lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;非常感谢您的阅读，如果有什么问题可以评论，也可以关注我看更多这种风格的帖子，谢谢&amp;lt;3.&lt;/p&gt;

</description>
      <category>development</category>
      <category>database</category>
      <category>chinese</category>
      <category>sql</category>
    </item>
    <item>
      <title>Structured Query Language (SQL)| Full Explanation (Definition, usage, structure and example with MySQL)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 23:24:39 +0000</pubDate>
      <link>https://forem.com/ingeniela/structured-query-language-sql-full-explanation-definition-usage-structure-and-example-with-mysql-59g2</link>
      <guid>https://forem.com/ingeniela/structured-query-language-sql-full-explanation-definition-usage-structure-and-example-with-mysql-59g2</guid>
      <description>&lt;p&gt;Structured Query Language (SQL)| Full Explanation (Definition, usage, structure and example with MySQL)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Hello, my name is Daniela Barazarte and I want to welcome you to this complete explanation of SQL. This explanation will be intuitive and simple as well as all the explanations that are part of #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;If you prefer videos, here is a full tutorial made by me on YouTube, it's in Spanish but it also has subtitles: &lt;a href="https://youtu.be/Hjs-zGEQtg8"&gt;https://youtu.be/Hjs-zGEQtg8&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Theory&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definition of each word
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Structured Query Language (SQL) or Structured Query Language&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language: refers to the set of rules and syntax used to write programs that a computer can understand.&lt;/li&gt;
&lt;li&gt;Structured: means to organize the code of a program in smaller and more logical pieces, so that it is easier to understand and maintain.&lt;/li&gt;
&lt;li&gt;Query: refers to a specific search for information in a database.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Full definition
&lt;/h2&gt;

&lt;p&gt;SQL is a programming language used to manage and manipulate structured and relational databases using queries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" alt="SQL Database" width="235" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectTheLogic
&lt;/h2&gt;

&lt;p&gt;SQL is called Structured Query Language (Structured Query Language) because it is literally a language that allows us to query a structured database and obtain results&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Use&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  So that
&lt;/h2&gt;

&lt;p&gt;It is used to manage and manipulate relational databases, either to create, modify, delete, or view tables, objects, and records in a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  When and where
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;E-commerce websites&lt;/li&gt;
&lt;li&gt;Content management applications&lt;/li&gt;
&lt;li&gt;Social media apps&lt;/li&gt;
&lt;li&gt;Data analysis applications&lt;/li&gt;
&lt;li&gt;Project management applications&lt;/li&gt;
&lt;li&gt;Booking and appointment apps&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  As
&lt;/h2&gt;

&lt;p&gt;You need a relational database management system that supports SQL (MySQL, Oracle, Microsoft SQL Server, etc.) Then, you must use the commands&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Practice&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Exercise
&lt;/h2&gt;

&lt;p&gt;You have a web application for an online store that sells electronics. You must store and manage order information.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Method: SQL&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Create the order table
CREATE TABLE orders (
   id INT AUTO_INCREMENT PRIMARY KEY,
   client VARCHAR(50) NOT NULL,
   date DATE NOT NULL,
   product VARCHAR(50) NOT NULL,
   amount INT NOT NULL,
   price DECIMAL(10,2) NOT NULL
);

-- Create orders
INSERT INTO orders (customer, date, product, quantity, price)
VALUES
   ('Juan Perez', '2023-06-16', 'Red shirt', 2, 20.50),
   ('Ana Garcia', '2023-06-15', 'Blue pants', 1, 35.00),
   ('Luis Gomez', '2023-06-15', 'Green dress', 2, 40.00),
   ('Maria Hernandez', '2023-06-14', 'Bob Grapefruit Socks', 12, 5.80),
   ('Carlos Rodriguez', '2023-06-14', 'Jacket for the cold', 1, 75.50),
   ('Laura Martinez', '2023-06-13', 'Blue Blouse', 3, 30.20),
   ('Pedro Sanchez', '2023-06-13', 'Cowboy Jeans', 6, 50.00),
   ('Sofia Ramirez', '2023-06-12', 'Sweatshirt for exercise', 2, 25.80),
   ('Diego Torres', '2023-06-12', 'Crocodile Cap', 1, 12.80),
   ('Fernanda Castro', '2023-06-11', 'Coat', 2, 90.00);

-- Read all orders
SELECT * FROM orders;

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

-- Edit/Update Order
UPDATE orders SET quantity = 4, price = 80.00 WHERE id = 5;

-- Delete order
DELETE FROM orders WHERE id IN (2, 6, 8);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Importance
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;SQL has several benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is easy to learn and use.&lt;/li&gt;
&lt;li&gt;It is very efficient to manipulate and access data.&lt;/li&gt;
&lt;li&gt;It is flexible and can handle both simple and complex queries.&lt;/li&gt;
&lt;li&gt;It is scalable, it works with small or very large databases.&lt;/li&gt;
&lt;li&gt;It is a de facto standard, widely compatible between different database systems.&lt;/li&gt;
&lt;li&gt;Once you master it, you can apply your skills to multiple database platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Farewell
&lt;/h1&gt;

&lt;p&gt;(Remember) #DetectaLaLógica: SQL is called Structured Query Language (Structured Query Language) because it is literally a language that allows us to query a structured database and obtain results&lt;/p&gt;

&lt;p&gt;You can practice this topic in my GitHub repository (C# language code): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you very much for reading, if you have any questions you can comment and you can also follow me to see more posts of this style, thanks &amp;lt;3.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>development</category>
    </item>
    <item>
      <title>Linguagem de consulta estruturada (SQL) | Explicação Completa (Definição, uso, estrutura e exemplo com MySQL)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 23:22:56 +0000</pubDate>
      <link>https://forem.com/ingeniela/linguagem-de-consulta-estruturada-sql-explicacao-completa-definicao-uso-estrutura-e-exemplo-com-mysql-3io9</link>
      <guid>https://forem.com/ingeniela/linguagem-de-consulta-estruturada-sql-explicacao-completa-definicao-uso-estrutura-e-exemplo-com-mysql-3io9</guid>
      <description>&lt;p&gt;Linguagem de consulta estruturada (SQL) | Explicação Completa (Definição, uso, estrutura e exemplo com MySQL)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introdução
&lt;/h1&gt;

&lt;p&gt;Olá, meu nome é Daniela Barazarte e quero dar as boas-vindas a esta explicação completa de SQL. Esta explicação será intuitiva e simples assim como todas as explicações que fazem parte do #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;Se você preferir vídeos, aqui está um tutorial completo feito por mim no YouTube, é em espanhol, mas também tem legendas: &lt;a href="https://youtu.be/Hjs-zGEQtg8"&gt;https://youtu.be/Hjs-zGEQtg8&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Teoria&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definição de cada palavra
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Linguagem de Consulta Estruturada (SQL) ou Linguagem de Consulta Estruturada&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linguagem (Language): refere-se ao conjunto de regras e sintaxe usados ​​para escrever programas que um computador pode entender.&lt;/li&gt;
&lt;li&gt;Estruturado (Structured): significa organizar o código de um programa em partes menores e mais lógicas, de modo que seja mais fácil de entender e manter.&lt;/li&gt;
&lt;li&gt;Consulta: refere-se a uma busca específica de informações em um banco de dados.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definição completa
&lt;/h2&gt;

&lt;p&gt;SQL é uma linguagem de programação usada para gerenciar e manipular bancos de dados estruturados e relacionais usando consultas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" alt="Banco de Dados SQL" width="235" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectTheLogic
&lt;/h2&gt;

&lt;p&gt;O SQL é chamado de Linguagem de Consulta Estruturada (Structured Query Language) porque é literalmente uma linguagem que nos permite consultar um banco de dados estruturado e obter resultados&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Usar&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Para que
&lt;/h2&gt;

&lt;p&gt;Ele é usado para gerenciar e manipular bancos de dados relacionais, seja para criar, modificar, excluir ou visualizar tabelas, objetos e registros em um banco de dados.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quando e onde
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sites de comércio eletrônico&lt;/li&gt;
&lt;li&gt;Aplicativos de gerenciamento de conteúdo&lt;/li&gt;
&lt;li&gt;Aplicativos de mídia social&lt;/li&gt;
&lt;li&gt;Aplicações de análise de dados&lt;/li&gt;
&lt;li&gt;Aplicativos de gerenciamento de projetos&lt;/li&gt;
&lt;li&gt;Aplicativos de reserva e agendamento&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Como
&lt;/h2&gt;

&lt;p&gt;Você precisa de um sistema de gerenciamento de banco de dados relacional que suporte SQL (MySQL, Oracle, Microsoft SQL Server, etc.)&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Praticar&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Exercício
&lt;/h2&gt;

&lt;p&gt;Você tem um aplicativo da web para uma loja online que vende eletrônicos. Você deve armazenar e gerenciar as informações do pedido.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Método: SQL&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Cria a tabela de pedidos
CREATE TABLE pedidos (
   id INT AUTO_INCREMENT PRIMARY KEY,
   cliente VARCHAR(50) NÃO NULO,
   data DATA NÃO NULA,
   produto VARCHAR(50) NÃO NULO,
   valor INT NÃO NULO,
   preço DECIMAL(10,2) NÃO NULO
);

-- Criar pedidos
INSERT INTO pedidos (cliente, data, produto, quantidade, preço)
VALORES
   ('Juan Perez', '2023-06-16', 'Camisa vermelha', 2, 20h50),
   ('Ana Garcia', '2023-06-15', 'Calça azul', 1, 35.00),
   ('Luis Gomez', '2023-06-15', 'Vestido verde', 2, 40.00),
   ('Maria Hernandez', '2023-06-14', 'Bob Grapefruit Socks', 12, 5.80),
   ('Carlos Rodriguez', '2023-06-14', 'Jaqueta para o frio', 1, 75,50),
   ('Laura Martinez', '2023-06-13', 'Blusa Azul', 3, 30.20),
   ('Pedro Sanchez', '2023-06-13', 'Cowboy Jeans', 6, 50.00),
   ('Sofia Ramirez', '2023-06-12', 'Camisola para exercício', 2, 25.80),
   ('Diego Torres', '2023-06-12', 'Crocodile Cap', 1, 12h80),
   ('Fernanda Castro', '2023-06-11', 'Casaco', 2, 90,00);

-- Leia todos os pedidos
SELECT * FROM pedidos;

-- Ler pedido por ID
SELECT * FROM pedidos WHERE id = 3;

-- Editar/atualizar pedido
UPDATE ordens SET quantidade = 4, preço = 80,00 WHERE id = 5;

-- Excluir pedido
DELETE FROM pedidos WHERE id IN (2, 6, 8);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Importância
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;SQL tem vários benefícios:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;É fácil de aprender e usar.&lt;/li&gt;
&lt;li&gt;É muito eficiente para manipular e acessar dados.&lt;/li&gt;
&lt;li&gt;É flexível e pode lidar com consultas simples e complexas.&lt;/li&gt;
&lt;li&gt;É escalável, funciona com bancos de dados pequenos ou muito grandes.&lt;/li&gt;
&lt;li&gt;É um padrão de fato, amplamente compatível entre diferentes sistemas de banco de dados.&lt;/li&gt;
&lt;li&gt;Depois de dominá-lo, você pode aplicar suas habilidades em várias plataformas de banco de dados.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Até a próxima
&lt;/h1&gt;

&lt;p&gt;(Lembre-se) #DetectaLaLógica: SQL é chamada de Structured Query Language (Linguagem de Consulta Estruturada) porque é literalmente uma linguagem que nos permite consultar um banco de dados estruturado e obter resultados&lt;/p&gt;

&lt;p&gt;Você pode praticar este tópico em meu repositório GitHub (código da linguagem C#): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Muito obrigado por ler, se tiver alguma dúvida pode comentar e também pode me seguir para ver mais posts desse estilo, obrigado &amp;lt;3.&lt;/p&gt;

</description>
      <category>database</category>
      <category>braziliandevs</category>
      <category>development</category>
      <category>sql</category>
    </item>
    <item>
      <title>Structured Query Language (SQL)| Explicación Completa (Definición, uso, estructura y ejemplo con MySQL)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 23:19:52 +0000</pubDate>
      <link>https://forem.com/ingeniela/structured-query-language-sql-explicacion-completa-definicion-uso-estructura-y-ejemplo-con-mysql-d44</link>
      <guid>https://forem.com/ingeniela/structured-query-language-sql-explicacion-completa-definicion-uso-estructura-y-ejemplo-con-mysql-d44</guid>
      <description>&lt;p&gt;Structured Query Language (SQL)| Explicación Completa (Definición, uso, estructura y ejemplo con MySQL)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducción
&lt;/h1&gt;

&lt;p&gt;Hola buenas, mi nombre es Daniela Barazarte y te quiero dar la bienvenida a esta explicación completa sobre SQL. Esta explicación será intuitiva y simple así como todas las explicaciones que forman parte de #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;Si prefieres los videos, aquí tienes un tutorial completo hecho por mí en YouTube, está en español pero también tiene subtítulos: &lt;a href="https://youtu.be/Hjs-zGEQtg8"&gt;https://youtu.be/Hjs-zGEQtg8&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Teoría&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definición de cada palabra
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Structured Query Language (SQL) o Lenguaje Estructurado de Consultas&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language (Lenguaje): se refiere al conjunto de reglas y sintaxis que se utilizan para escribir programas que una computadora pueda entender. &lt;/li&gt;
&lt;li&gt;Structured (Estructurado): significa organizar el código de un programa en piezas más pequeñas y lógicas, para que sea más fácil de entender y mantener.&lt;/li&gt;
&lt;li&gt;Query (Consulta): se refiere a una búsqueda específica de información en una base de datos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definición completa
&lt;/h2&gt;

&lt;p&gt;SQL es un lenguaje de programación que se utiliza para gestionar y manipular bases de datos relacionales y estructuradas mediante consultas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TXhi3DOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hlfjkg6gio7bbrut5t.png" alt="SQL Database" width="235" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectaLaLógica
&lt;/h2&gt;

&lt;p&gt;SQL se dice Structured Query Language (Lenguaje estructurado de consultas) pues literalmente es un lenguaje que nos permite hacer consultas a una base de datos estructurada y obtener resultados&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Uso&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Para qué
&lt;/h2&gt;

&lt;p&gt;Es utilizado para gestionar y manipular bases de datos relacionales, ya sea para crear, modificar, eliminar o ver tablas, objetos y registros en una base de datos&lt;/p&gt;

&lt;h2&gt;
  
  
  Cuando y donde
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sitios web de comercio electrónico&lt;/li&gt;
&lt;li&gt;Aplicaciones de gestión de contenido&lt;/li&gt;
&lt;li&gt;Aplicaciones de redes sociales&lt;/li&gt;
&lt;li&gt;Aplicaciones de análisis de datos&lt;/li&gt;
&lt;li&gt;Aplicaciones de gestión de proyectos&lt;/li&gt;
&lt;li&gt;Aplicaciones de reservas y citas&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cómo
&lt;/h2&gt;

&lt;p&gt;Necesitas un sistema de gestión de bases de datos relacionales que soporte SQL (MySQL, Oracle, Microsoft SQL Server, etc.)  Luego, debes utilizar los comandos&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Práctica&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Ejercicio
&lt;/h2&gt;

&lt;p&gt;Tienes una aplicación web de una tienda en línea que vende productos electrónicos. Debes almacenar y gestionar la información de los pedidos.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Método: SQL&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Crear la tabla de pedidos
CREATE TABLE pedidos (
  id INT AUTO_INCREMENT PRIMARY KEY,
  cliente VARCHAR(50) NOT NULL,
  fecha DATE NOT NULL,
  producto VARCHAR(50) NOT NULL,
  cantidad INT NOT NULL,
  precio DECIMAL(10,2) NOT NULL
);

-- Crear pedidos
INSERT INTO pedidos (cliente, fecha, producto, cantidad, precio)
VALUES
  ('Juan Perez', '2023-06-16', 'Camisa roja', 2, 20.50),
  ('Ana Garcia', '2023-06-15', 'Pantalón azul', 1, 35.00),
  ('Luis Gomez', '2023-06-15', 'Vestido verde', 2, 40.00),
  ('Maria Hernandez', '2023-06-14', 'Calcetines de Bob Toronja', 12, 5.80),
  ('Carlos Rodriguez', '2023-06-14', 'Chaqueta para el frío', 1, 75.50),
  ('Laura Martinez', '2023-06-13', 'Blusa azul', 3, 30.20),
  ('Pedro Sanchez', '2023-06-13', 'Jeans de vaquero', 6, 50.00),
  ('Sofia Ramirez', '2023-06-12', 'Sudadera para el ejercicio', 2, 25.80),
  ('Diego Torres', '2023-06-12', 'Gorra de Cocodrilos', 1, 12.80),
  ('Fernanda Castro', '2023-06-11', 'Abrigo', 2, 90.00);

-- Leer todos los pedidos
SELECT * FROM pedidos;

-- Leer pedido por ID
SELECT * FROM pedidos WHERE id = 3;

-- Editar/Actualizar pedido
UPDATE pedidos SET cantidad = 4, precio = 80.00 WHERE id = 5;

-- Eliminar pedido
DELETE FROM pedidos WHERE id IN (2, 6, 8);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Importancia
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;SQL tiene varios beneficios:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Es fácil de aprender y usar.&lt;/li&gt;
&lt;li&gt;Es muy eficiente para manipular y acceder a datos.&lt;/li&gt;
&lt;li&gt;Es flexible y puede manejar tanto consultas simples como complejas.&lt;/li&gt;
&lt;li&gt;Es escalable, funciona con bases de datos pequeñas o muy grandes.&lt;/li&gt;
&lt;li&gt;Es un estándar de facto, ampliamente compatible entre diferentes sistemas de bases de datos.&lt;/li&gt;
&lt;li&gt;Una vez que lo dominas, puedes aplicar tus habilidades a múltiples plataformas de bases de datos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Despedida
&lt;/h1&gt;

&lt;p&gt;(Recuerda) #DetectaLaLógica: SQL se dice Structured Query Language (Lenguaje estructurado de  consultas) pues literalmente es un lenguaje que nos permite hacer consultas a una base de datos estructurada y obtener resultados&lt;/p&gt;

&lt;p&gt;Puedes practicar este tema en mi repositorio de GitHub (Código en lenguaje C#): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Muchas gracias por leer, si tienes alguna duda puedes comentarla y también puedes seguirme para ver mas posts de este estilo, gracias &amp;lt;3.&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>development</category>
    </item>
    <item>
      <title>接口 | 完整说明（定义、用法、结构和 C# 示例）</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 22:58:12 +0000</pubDate>
      <link>https://forem.com/ingeniela/jie-kou-wan-zheng-shuo-ming-ding-yi-yong-fa-jie-gou-he-c-shi-li--3jm1</link>
      <guid>https://forem.com/ingeniela/jie-kou-wan-zheng-shuo-ming-ding-yi-yong-fa-jie-gou-he-c-shi-li--3jm1</guid>
      <description>&lt;p&gt;接口 | 完整说明（定义、用法、结构和 C# 示例）&lt;/p&gt;

&lt;p&gt;＃ 介绍&lt;/p&gt;

&lt;p&gt;您好，我的名字是 Daniela Barazarte，欢迎您阅读该界面的完整说明。 这个解释以及#DetectaLaLogica 中的所有解释一样直观且简单。&lt;/p&gt;

&lt;p&gt;如果您喜欢视频，这里是我在 YouTube 上制作的完整教程，它是西班牙语，但也有字幕：&lt;a href="https://www.youtube.com/watch?v=UbZORJzMQec"&gt;https://www.youtube.com/watch?v=UbZORJzMQec&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;理论&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  每个单词的定义
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“设计模式”&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;模式&lt;/strong&gt;：是一种重复事件或对象
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8d84YcgD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8hizh9zs3bzgaimxs1n.png" alt="设计模式" width="498" height="63"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;设计&lt;/strong&gt;：创意活动，其目的是设计有用且美观的物体&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;“界面”&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;接口&lt;/strong&gt;：一个系统对另一个系统的通信或操作区域
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FtyOCYts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvjfyhfzef7eu2ncla6t.png" alt="代表界面的铅笔和纸" width="198" height="198"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  完整定义
&lt;/h2&gt;

&lt;p&gt;接口设计模式是类必须提供的方法和属性的规范，任何实现该接口的类都致力于提供这些方法和属性。&lt;/p&gt;

&lt;h2&gt;
  
  
  #检测逻辑
&lt;/h2&gt;

&lt;p&gt;“接口”一词被定义为“一个系统对另一个系统的通信或操作区域”。 接口设计模式之所以如此命名，是因为接口正在与类通信，告诉它该类应该具有哪些参数。 它就像一个契约，其中接口声明它具有哪些组件，并且类也必须具有这些组件。&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;使用&lt;/u&gt;
&lt;/h1&gt;

&lt;p&gt;＃＃ 以便&lt;br&gt;
接口用于定义可以由多个不同类实现的公共接口。 这种模式允许这些类在遵守相同接口的同时具有不同的行为，从而为应用程序提供灵活性和模块化。&lt;/p&gt;
&lt;h2&gt;
  
  
  何时以及如何
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;通过拥有多个必须遵守一组特定行为的类&lt;/li&gt;
&lt;li&gt;通过具有必须符合一组特定行为的插件或外部模块的通用结构&lt;/li&gt;
&lt;li&gt;创建必须兼容分布式系统不同架构的应用程序时&lt;/li&gt;
&lt;li&gt;创建应易于扩展和模块化的应用程序时&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  &lt;u&gt;练习&lt;/u&gt;
&lt;/h1&gt;

&lt;p&gt;＃＃ 锻炼&lt;br&gt;
您必须创建一个控制台项目，其中有几种动物，并且可以在控制台中编写每只动物发出的声音&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;方法：接口&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" alt="界面" width="378" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;橙色部分（上图）：&lt;/strong&gt;是Animal接口&lt;br&gt;
&lt;strong&gt;蓝色部分（底部）：&lt;/strong&gt;是该接口的实现，在本例中是 3 种动物（猫、狗、鸟）&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface Animal
{
     void MakeSound();
     void CallFriend();
}

public class Dog : IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Wow! Woof!");
     }
     public void CallFriend()
     {
         Console.WriteLine("Come on friend dog!");
     }
}

public class Cat : IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Meow! Meow!");
     }
     public void CallFriend()
     {
         Console.WriteLine("Come on friend cat!");
     }
}
public class Bird : IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Tweet Tweet! Wow!");
     }

     public void CallFriend()
     {
         Console.WriteLine("Come on friend bird!");
     }
}
public class program
{
     public static void Main()
     {
         IAnimal myCat = new Cat();
         IAnimal myDog = new Dog();
         IAnimal myBird = new Bird();

         myCat.MakeSound();
         myCat.CallFriend();

         myDog.MakeSound();
         myDog.CallFriend();

         myBird.MakeSound();
         myBird.CallFriend();
     }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;拥有实现“鸟”、“狗”和“猫”的“动物”接口是有益的，因为它提供了有用的抽象，允许软件设计中的高度灵活性和可扩展性。 通过定义“动物”界面，您可以建立所有动物都必须具备的某些行为和特征，例如移动和呼吸的能力。&lt;/p&gt;

&lt;p&gt;在“Bird”、“Dog”和“Cat”上实现此接口可确保它们都具有这些共同特征，并且可以在需要“Animal”对象的代码中互换使用。 这使得代码更加模块化和可扩展，因为可以轻松添加符合“动物”接口的新动物类型，而无需更改现有代码。&lt;/p&gt;

&lt;h1&gt;
  
  
  重要性
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;界面设计模式有几个好处：&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;抽象&lt;/strong&gt;：接口允许定义一组方法和属性，这些方法和属性必须由实现它们的类来实现。 这允许您抽象接口后面的类的实现，使您的代码更易于理解和维护。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;关注点分离&lt;/strong&gt;：通过定义接口，您可以清楚地将用户界面与业务逻辑分开。 这允许应用程序的不同部分通过明确定义的接口相互通信。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;多态性&lt;/strong&gt;：接口允许多态性，这意味着实现接口的类可以被视为属于该类型的接口。 这使得实现相同接口的类可以在代码的不同部分中互换使用，从而更容易重用和维护代码。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;＃ 告别&lt;br&gt;
（记住）#DetectaLaLógica：“接口”一词被定义为“一个系统对另一个系统的通信或操作区域”。 接口设计模式之所以如此命名，是因为接口正在与类通信，告诉它该类应该具有哪些参数。 它就像一个契约，其中接口声明它具有哪些组件，并且类也必须具有这些组件。&lt;/p&gt;

&lt;p&gt;您可以在我的 GitHub 存储库（C# 语言代码）中练习此主题：&lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;非常感谢您的阅读，如果有什么问题可以评论，也可以关注我看更多这种风格的帖子，谢谢&amp;lt;3.&lt;/p&gt;

</description>
      <category>中文</category>
      <category>csharp</category>
      <category>dotnet</category>
      <category>programming</category>
    </item>
    <item>
      <title>Interface | Explicação Completa (Definição, uso, estrutura e exemplo com C#)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 22:55:34 +0000</pubDate>
      <link>https://forem.com/ingeniela/interface-explicacao-completa-definicao-uso-estrutura-e-exemplo-com-c-4mip</link>
      <guid>https://forem.com/ingeniela/interface-explicacao-completa-definicao-uso-estrutura-e-exemplo-com-c-4mip</guid>
      <description>&lt;p&gt;Interface | Explicação Completa (Definição, uso, estrutura e exemplo com C#)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introdução
&lt;/h1&gt;

&lt;p&gt;Olá, meu nome é Daniela Barazarte e quero dar as boas-vindas a esta explicação completa da interface. Esta explicação será intuitiva e simples assim como todas as explicações que fazem parte do #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;Se você preferir vídeos, aqui está um tutorial completo feito por mim no YouTube, é em espanhol, mas também tem legendas: &lt;a href="https://www.youtube.com/watch?v=UbZORJzMQec"&gt;https://www.youtube.com/watch?v=UbZORJzMQec&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Teoria&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definição de cada palavra
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Padrão de design"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Padrão&lt;/strong&gt;: é um tipo de eventos ou objetos repetitivos
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8d84YcgD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8hizh9zs3bzgaimxs1n.png" alt="Padrão de design" width="498" height="63"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design&lt;/strong&gt;: atividade criativa cujo objetivo é projetar objetos úteis e estéticos&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;"Interface"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interface&lt;/strong&gt;: zona de comunicação ou ação de um sistema sobre outro
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FtyOCYts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvjfyhfzef7eu2ncla6t.png" alt="Lápis e papel representando a Interface" width="198" height="198"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definição completa
&lt;/h2&gt;

&lt;p&gt;O padrão de design de interface é uma especificação de métodos e propriedades que uma classe deve fornecer, e qualquer classe que implemente essa interface está comprometida em fornecer esses métodos e propriedades.&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectTheLogic
&lt;/h2&gt;

&lt;p&gt;A palavra "Interface" é definida como "zona de comunicação ou ação de um sistema sobre outro". O padrão de design de interface é assim chamado porque uma interface está conversando com uma classe para informar quais parâmetros essa classe deve ter. É como um contrato onde a interface declara quais componentes ela possui e a classe também deve ter esses componentes.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Usar&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Para que
&lt;/h2&gt;

&lt;p&gt;A interface é usada para definir uma interface comum que pode ser implementada por várias classes diferentes. Esse padrão permite que essas classes tenham comportamentos diferentes enquanto aderem a uma mesma interface, proporcionando flexibilidade e modularidade ao aplicativo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quando e como
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Por ter várias classes que devem obedecer a um conjunto específico de comportamentos&lt;/li&gt;
&lt;li&gt;Por ter uma estrutura comum para plugins ou módulos externos que devem obedecer a um conjunto específico de comportamentos&lt;/li&gt;
&lt;li&gt;Ao criar um aplicativo que deve ser compatível com diferentes arquiteturas de sistemas distribuídos&lt;/li&gt;
&lt;li&gt;Ao criar um aplicativo que deve ser facilmente extensível e modular&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Praticar&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Exercício
&lt;/h2&gt;

&lt;p&gt;Tens de criar um projeto de consola onde tens vários animais e podes escrever na consola o som que cada um deles faz&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Método: Interface&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" alt="Interface" width="378" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A parte laranja (acima):&lt;/strong&gt; é uma interface Animal&lt;br&gt;
&lt;strong&gt;A parte azul (abaixo):&lt;/strong&gt; são implementações dessa interface, no caso, 3 animais (gato, cachorro, pássaro)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;animal de interface pública
{
     void MakeSound();
     void CallFriend();
}

public class Cachorro: IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Uau! Woof!");
     }
     public void CallFriend()
     {
         Console.WriteLine("Vamos amigo cão!");
     }
}

public class Gato: IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Miau! Miau!");
     }
     public void CallFriend()
     {
         Console.WriteLine("Vamos amigo gato!");
     }
}
classe pública Pássaro: IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Tweet Tweet! Uau!");
     }

     public void CallFriend()
     {
         Console.WriteLine("Vamos amigo passarinho!");
     }
}
programa de classe pública
{
     public static void Main()
     {
         IAnimal meuGato = new Gato();
         IAnimal meuCão = new Cachorro();
         IAnimal meuPássaro = new Pássaro();

         meuCat.MakeSound();
         myCat.CallFriend();

         myDog.MakeSound();
         myDog.CallFriend();

         meuPássaro.MakeSound();
         myBird.CallFriend();
     }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ter uma interface "Animal" que implementa "Bird", "Dog" e "Cat" é benéfico porque fornece uma abstração útil que permite um alto nível de flexibilidade e extensibilidade no design de software. Ao definir uma interface "Animal", você estabelece certos comportamentos e características que todos os animais devem ter, como a capacidade de se mover e respirar.&lt;/p&gt;

&lt;p&gt;A implementação dessa interface em "Bird", "Dog" e "Cat" garante que todos tenham essas características comuns e possam ser usados ​​de forma intercambiável no código que requer um objeto "Animal". Isso permite que o código seja mais modular e escalável, pois novos tipos de animais em conformidade com a interface "Animal" podem ser facilmente adicionados sem a necessidade de alterar o código existente.&lt;/p&gt;

&lt;h1&gt;
  
  
  Importância
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;O padrão de design de interface tem vários benefícios:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Abstração&lt;/strong&gt;: As interfaces permitem definir um conjunto de métodos e propriedades que devem ser implementados por uma classe que os implemente. Isso permite que você abstraia a implementação de uma classe por trás de uma interface, tornando seu código mais fácil de entender e manter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separação de preocupações&lt;/strong&gt;: Ao definir interfaces, você pode separar claramente a interface do usuário da lógica de negócios. Isso permite que as diferentes partes de um aplicativo se comuniquem por meio de interfaces bem definidas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polimorfismo&lt;/strong&gt;: Interfaces permitem polimorfismo, o que significa que uma classe que implementa uma interface pode ser tratada como se fosse daquele tipo de interface. Isso permite que as classes que implementam a mesma interface sejam usadas de forma intercambiável em diferentes partes do código, facilitando a reutilização e a manutenção do seu código.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Até a próxima
&lt;/h1&gt;

&lt;p&gt;(Lembre-se) #DetectaLaLógica: A palavra "Interface" é definida como "zona de comunicação ou ação de um sistema sobre outro". O padrão de design de interface é assim chamado porque uma interface está conversando com uma classe para informar quais parâmetros essa classe deve ter. É como um contrato onde a interface declara quais componentes ela possui e a classe também deve ter esses componentes.&lt;/p&gt;

&lt;p&gt;Você pode praticar este tópico em meu repositório GitHub (código da linguagem C#): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Muito obrigado por ler, se tiver alguma dúvida pode comentar e também pode me seguir para ver mais posts desse estilo, obrigado &amp;lt;3.&lt;/p&gt;

</description>
      <category>braziliandevs</category>
      <category>designpatterns</category>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Interface | Full Explanation (Definition, usage, structure and example with C#)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Mon, 03 Jul 2023 22:53:44 +0000</pubDate>
      <link>https://forem.com/ingeniela/interface-full-explanation-definition-usage-structure-and-example-with-c-1mll</link>
      <guid>https://forem.com/ingeniela/interface-full-explanation-definition-usage-structure-and-example-with-c-1mll</guid>
      <description>&lt;p&gt;Interface | Full Explanation (Definition, usage, structure and example with C#)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Hello, my name is Daniela Barazarte and I want to welcome you to this complete explanation of the interface. This explanation will be intuitive and simple as well as all the explanations that are part of #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;If you prefer videos, here is a complete tutorial made by me on YouTube, it's in Spanish but it also has subtitles: &lt;a href="https://www.youtube.com/watch?v=UbZORJzMQec"&gt;https://www.youtube.com/watch?v=UbZORJzMQec&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Theory&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definition of each word
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Design pattern"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pattern&lt;/strong&gt;: is a type of repetitive events or objects
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8d84YcgD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8hizh9zs3bzgaimxs1n.png" alt="Design Pattern" width="498" height="63"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design&lt;/strong&gt;: creative activity whose purpose is to project objects that are useful and aesthetic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;"Interface"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interface&lt;/strong&gt;: zone of communication or action of one system on another
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FtyOCYts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvjfyhfzef7eu2ncla6t.png" alt="Pencil and paper representing the Interface" width="198" height="198"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Full definition
&lt;/h2&gt;

&lt;p&gt;The interface design pattern is a specification of methods and properties that a class must provide, and any class that implements that interface is committed to providing those methods and properties.&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectTheLogic
&lt;/h2&gt;

&lt;p&gt;The word "Interface" is defined as "zone of communication or action of one system on another". The Interface design pattern is so called because an interface is talking to a class to tell it what parameters that class should have. It's like a contract where the interface declares what components it has and the class must have those components as well.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Use&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  So that
&lt;/h2&gt;

&lt;p&gt;The interface is used to define a common interface that can be implemented by several different classes. This pattern allows these classes to have different behaviors while adhering to the same interface, providing flexibility and modularity to the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  When and how
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;By having multiple classes that must comply with a specific set of behaviors&lt;/li&gt;
&lt;li&gt;By having a common structure for plugins or external modules that must comply with a specific set of behaviors&lt;/li&gt;
&lt;li&gt;When creating an application that must be compatible with different architectures of distributed systems&lt;/li&gt;
&lt;li&gt;When creating an application that should be easily extensible and modular&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Practice&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Exercise
&lt;/h2&gt;

&lt;p&gt;You have to create a console project where you have several animals and you can write in the console the sound that each one of them makes&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Method: Interface&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" alt="Interface" width="378" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The orange part (above):&lt;/strong&gt; is an Animal interface&lt;br&gt;
&lt;strong&gt;The blue part (bottom):&lt;/strong&gt; are implementations of that interface, in this case, 3 animals (cat, dog, bird)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface Animal
{
     void MakeSound();
     void CallFriend();
}

public class Dog : IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Wow! Woof!");
     }
     public void CallFriend()
     {
         Console.WriteLine("Come on friend dog!");
     }
}

public class Cat : IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Meow! Meow!");
     }
     public void CallFriend()
     {
         Console.WriteLine("Come on friend cat!");
     }
}
public class Bird : IAnimal
{
     public void MakeSound()
     {
         Console.WriteLine("Tweet Tweet! Wow!");
     }

     public void CallFriend()
     {
         Console.WriteLine("Come on friend bird!");
     }
}
public class program
{
     public static void Main()
     {
         IAnimal myCat = new Cat();
         IAnimal myDog = new Dog();
         IAnimal myBird = new Bird();

         myCat.MakeSound();
         myCat.CallFriend();

         myDog.MakeSound();
         myDog.CallFriend();

         myBird.MakeSound();
         myBird.CallFriend();
     }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having an "Animal" interface that implements "Bird", "Dog" and "Cat" is beneficial because it provides a useful abstraction that allows for a high level of flexibility and extensibility in software design. By defining an "Animal" interface, you establish certain behaviors and characteristics that all animals must have, such as the ability to move and breathe.&lt;/p&gt;

&lt;p&gt;Implementing this interface on "Bird", "Dog" and "Cat" ensures that they all have these common characteristics and can be used interchangeably in code that requires an "Animal" object. This allows the code to be more modular and scalable, as new animal types that conform to the "Animal" interface can be easily added without having to change existing code.&lt;/p&gt;

&lt;h1&gt;
  
  
  Importance
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;The interface design pattern has several benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Abstraction&lt;/strong&gt;: Interfaces allow defining a set of methods and properties that must be implemented by a class that implements them. This allows you to abstract the implementation of a class behind an interface, making your code easier to understand and maintain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separation of concerns&lt;/strong&gt;: By defining interfaces, you can clearly separate the user interface from the business logic. This allows the different parts of an application to communicate with each other through well-defined interfaces.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polymorphism&lt;/strong&gt;: Interfaces allow polymorphism, which means that a class that implements an interface can be treated as if it were of that type of interface. This allows classes that implement the same interface to be used interchangeably in different parts of the code, making it easier to reuse and maintain your code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Farewell
&lt;/h1&gt;

&lt;p&gt;(Remember) #DetectaLaLógica: The word "Interface" is defined as "zone of communication or action of one system on another". The Interface design pattern is so called because an interface is talking to a class to tell it what parameters that class should have. It's like a contract where the interface declares what components it has and the class must have those components as well.&lt;/p&gt;

&lt;p&gt;You can practice this topic in my GitHub repository (C# language code): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you very much for reading, if you have any questions you can comment and you can also follow me to see more posts of this style, thanks &amp;lt;3.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>english</category>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Interfaz | Explicación Completa (Definición, uso, estructura y ejemplo con C#)</title>
      <dc:creator>Daniela "Ingeniela" Barazarte</dc:creator>
      <pubDate>Tue, 27 Jun 2023 00:50:31 +0000</pubDate>
      <link>https://forem.com/ingeniela/interfaz-explicacion-completa-definicion-uso-estructura-y-ejemplo-con-c-5fd7</link>
      <guid>https://forem.com/ingeniela/interfaz-explicacion-completa-definicion-uso-estructura-y-ejemplo-con-c-5fd7</guid>
      <description>&lt;p&gt;Interfaz | Explicación Completa (Definición, uso, estructura y ejemplo con C#)&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducción
&lt;/h1&gt;

&lt;p&gt;Hola buenas, mi nombre es Daniela Barazarte y te quiero dar la bienvenida a esta explicación completa sobre la interfaz. Esta explicación será intuitiva y simple así como todas las explicaciones que forman parte de #DetectaLaLogica.&lt;/p&gt;

&lt;p&gt;Si prefieres los videos, aquí tienes un tutorial completo hecho por mí en YouTube, está en español pero también tiene subtítulos: &lt;a href="https://www.youtube.com/watch?v=UbZORJzMQec"&gt;https://www.youtube.com/watch?v=UbZORJzMQec&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Teoría&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Definición de cada palabra
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Patrón de diseño"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Patrón&lt;/strong&gt;: es un tipo de sucesos u objetos repetitivos
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8d84YcgD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8hizh9zs3bzgaimxs1n.png" alt="Patrón de diseño" width="498" height="63"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diseño&lt;/strong&gt;: actividad creativa que tiene por fin proyectar objetos que sean útiles y estéticos&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;"Interfaz"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interfaz&lt;/strong&gt;: zona de comunicación o acción de un sistema sobre otro
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FtyOCYts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvjfyhfzef7eu2ncla6t.png" alt="Lapiz y papel representando la Interfaz" width="198" height="198"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definición completa
&lt;/h2&gt;

&lt;p&gt;El patrón de diseño de interfaz es una especificación de métodos y propiedades que una clase debe proporcionar, y cualquier clase que implemente esa interfaz se compromete a proporcionar esos métodos y propiedades.&lt;/p&gt;

&lt;h2&gt;
  
  
  #DetectaLaLógica
&lt;/h2&gt;

&lt;p&gt;La palabra "Interfaz" se define como "zona de comunicación o acción de un sistema sobre otro". Al patrón de diseño de Interfaz se le llama así porque una interfaz se está comunicando con una clase para comunicarle que parámetros debe tener esa clase. Es como un contrato donde la interfaz declara que componentes tiene y la clase debe tener esos componentes también.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Uso&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Para qué
&lt;/h2&gt;

&lt;p&gt;La interfaz se utiliza para definir una interfaz común que puede ser implementada por varias clases diferentes. Este patrón permite a estas clases tener diferentes comportamientos mientras cumplen con una misma interfaz, lo que proporciona flexibilidad y modularidad a la aplicación.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cuando y cómo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Al tener múltiples clases que deben cumplir con un conjunto específico de comportamientos &lt;/li&gt;
&lt;li&gt;Al tener una estructura común para plugins o módulos externos que deben cumplir con un conjunto específico de comportamientos &lt;/li&gt;
&lt;li&gt;Al crear una aplicación que debe ser compatible con diferentes arquitecturas de sistemas distribuidos &lt;/li&gt;
&lt;li&gt;Al crear una aplicación que debe ser fácilmente extensible y modular&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;u&gt;Práctica&lt;/u&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Ejercicio
&lt;/h2&gt;

&lt;p&gt;Tienes que crear un proyecto de consola donde tengas varios animales y puedas escribir en consola el sonido que hacen cada uno de ellos&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Método: Interfaz&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SCcZsI6e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okqqp2esu4095a4742la.png" alt="Interfaz" width="378" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;La parte naranja (arriba):&lt;/strong&gt; es una interfaz de Animal&lt;br&gt;
&lt;strong&gt;La parte azul (abajo):&lt;/strong&gt; son implementaciones de esa interfaz, en este caso, 3 animales (gato, perro, pájaro)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface IAnimal
{
    void HacerSonido();
    void LlamarAmigo();
}

public class Perro : IAnimal
{
    public void HacerSonido()
    {
        Console.WriteLine("¡Guau! Woof!");
    }
    public void LlamarAmigo()
    {
        Console.WriteLine("¡Ven amigo perro!");
    }
}

public class Gato : IAnimal
{
    public void HacerSonido()
    {
        Console.WriteLine("¡Miau! Meow!");
    }
    public void LlamarAmigo()
    {
        Console.WriteLine("¡Ven amigo gato!");
    }
}
public class Pajaro : IAnimal
{
    public void HacerSonido()
    {
        Console.WriteLine("¡Pío Pío! Quququ!");
    }

    public void LlamarAmigo()
    {
        Console.WriteLine("¡Ven amigo pájaro!");
    }
}
public class Program
{
    public static void Main()
    {
        IAnimal miGato = new Gato();
        IAnimal miPerro = new Perro();
        IAnimal miPajaro = new Pajaro();

        miGato.HacerSonido();
        miGato.LlamarAmigo();

        miPerro.HacerSonido();
        miPerro.LlamarAmigo();

        miPajaro.HacerSonido();
        miPajaro.LlamarAmigo();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tener una interfaz "Animal" que implementa a "Pajaro", "Perro" y "Gato" es beneficioso porque proporciona una abstracción útil que permite un alto nivel de flexibilidad y extensibilidad en el diseño de software. Al definir una interfaz "Animal", se establecen ciertos comportamientos y características que todos los animales deben tener, como por ejemplo, la capacidad de moverse y respirar.&lt;/p&gt;

&lt;p&gt;Al implementar esta interfaz en "Pájaro", "Perro" y "Gato", se garantiza que todos ellos tengan estas características comunes y se puedan utilizar de manera intercambiable en el código que requiere un objeto "Animal". Esto permite que el código sea más modular y escalable, ya que se pueden agregar fácilmente nuevos tipos de animales que cumplan con la interfaz "Animal" sin tener que cambiar el código existente.&lt;/p&gt;

&lt;h1&gt;
  
  
  Importancia
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;El patrón de diseño interfaz tiene varios beneficios:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Abstracción&lt;/strong&gt;: Las interfaces permiten definir un conjunto de métodos y propiedades que deben ser implementados por una clase que las implemente. Esto permite abstraer la implementación de una clase detrás de una interfaz, lo que facilita la comprensión y el mantenimiento del código.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separación de preocupaciones&lt;/strong&gt;: Al definir interfaces, se puede separar claramente la interfaz de usuario de la lógica de negocio. Esto permite que las diferentes partes de una aplicación se comuniquen entre sí a través de interfaces bien definidas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polimorfismo&lt;/strong&gt;: Las interfaces permiten el polimorfismo, lo que significa que una clase que implementa una interfaz puede ser tratada como si fuera de ese tipo de interfaz. Esto permite que las clases que implementan la misma interfaz se utilicen de manera intercambiable en diferentes partes del código, lo que facilita la reutilización y el mantenimiento del código.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Despedida
&lt;/h1&gt;

&lt;p&gt;(Recuerda) #DetectaLaLógica: La palabra "Interfaz" se define como "zona de comunicación o acción de un sistema sobre otro". Al patrón de diseño de Interfaz se le llama así porque una interfaz se está comunicando con una clase para comunicarle que parámetros debe tener esa clase. Es como un contrato donde la interfaz declara que componentes tiene y la clase debe tener esos componentes también.&lt;/p&gt;

&lt;p&gt;Puedes practicar este tema en mi repositorio de GitHub (Código en lenguaje C#): &lt;a href="https://github.com/danielabarazarte/DetectaLaLogica"&gt;https://github.com/danielabarazarte/DetectaLaLogica&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Muchas gracias por leer, si tienes alguna duda puedes comentarla y también puedes seguirme para ver mas posts de este estilo, gracias &amp;lt;3.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>designpatterns</category>
      <category>español</category>
    </item>
  </channel>
</rss>
