标签

 sql 

相关的文章:

京东科技开发者 -

手把手教你如何扩展(破解)mybatisplus的sql生成

一、Mybatisplus的常用CRUD方法众所周知,mybatisplus提供了强大的代码生成能力,它默认生成的常用的CRUD方法(例如插入、更新、删除、查询等)的定义,能够帮助我们节省很多体力劳动。他的BaseMapper中定义了这些常用的CRUD方法,我们在使用时,继承这个BaseMapper类就默认拥有了这些能力。如果我们的业务中,需要类似的通用Sql时,该如何实现呢?是每个Mapper中...

AI生成摘要 Mybatisplus provides powerful CRUD methods. To implement custom SQL, we can extend the BaseMapper class and define the SQL method and template. We can also add custom SQL injections and methods by extending the DefaultSqlInjector class. By inheriting the GyhBaseMapper, tables can automatically generate the SQL defined in the BaseMapper. Additionally, we can edit existing Mybatisplus SQL by creating a new class that extends the desired SQL method and injects the necessary configuration. By inheriting the GyhBaseMapper, tables can use the updated SQL method. These modifications can help simplify and optimize database operations.

相关推荐 去reddit讨论

解道jdon.com -

正则表达式与SQL数据库教程

使用正则表达式通过用例查询 Postgres 数据库: 正则表达式(又名 Regex) 正则表达式是一个强大的工具,广泛用于模式匹配和文本操作。 几乎所有编程语言都支持它们,并且经常用于文本提取、搜索和匹配文本等用例。 正则表达式匹配以“^”字符开头,以“$”字符结尾。 例子  假设我们要验证给定的字符串是否是有效的 Visa 信用卡号。 输入字符串为“4111111111111111”。 我们的正则表达式为:“4[0–

AI生成摘要 正则表达式是一种强大的工具,可用于模式匹配和文本操作。在Postgres数据库中,可以使用正则表达式进行动态化的SQL查询,提高性能。通过正则表达式可以查询信用卡号和电子邮件等信息。例如,可以通过正则表达式查询Visa信用卡号和不匹配特定模式的电子邮件。

相关推荐 去reddit讨论

Planet PostgreSQL -

Bruce Momjian: Is SQL Good?

The Postgres mailing lists are full of practical discussions, but two years ago there was a 77-email thread titled "The tragedy of SQL" that questioned the utility of the SQL query language; t is worth a review. While opening with "A fun philosophical discussion," it states: The world's economic output would be substantially higher (5%?) if our industry had settled on almost anything other than SQL for relational databases. It disparages object-relational mappers and suggests Datalog as an alternative query language. Continue Reading »

AI生成摘要 这篇博客是关于我在Postgres开源数据库上的工作,并发布在Planet PostgreSQL上。PgLife可以监控所有Postgres社区活动。邮件列表中有一篇77封邮件的讨论,标题为“sql的悲剧”,质疑了sql查询语言的实用性。有人提到了Datalog作为替代查询语言。总的来说,sql在数据存储方面非常强大,学习sql比学习其他编程语言更有价值。

相关推荐 去reddit讨论

Devart Blog -

How to Connect to Azure SQL Database

This article explores connecting to Azure SQL Database with such solutions as SSMS, Visual Studio, Power BI, dbForge Studio for SQL Server, and PowerShell. The post How to Connect to Azure SQL Database appeared first on Devart Blog.

AI生成摘要 文章介绍了如何使用不同的工具连接到Azure SQL数据库。首先,需要获取Azure连接凭据并配置防火墙。然后,可以使用SQL Server Management Studio、dbForge Studio for SQL Server、Visual Studio、Power BI或PowerShell等工具连接到Azure SQL数据库,并进行查询、管理和分析数据。其中,dbForge Studio for SQL Server是一个功能强大的SQL Server IDE,完全支持Azure。

相关推荐 去reddit讨论

MongoDB -

Why Leading Insurer Manulife Ditched SQL For MongoDB

Manulife, one of the largest life insurance companies in the world, is in the midst of a digital transformation. Earlier this year, Harry Cheung, Chief Architect of Manulife Asia, spoke to industry experts and developers at MongoDB.local in Hong Kong, outlining the transformation journey so far and what’s next for Manulife. Better experiences, happier customers Manulife, like many large enterprises, is under pressure to get new digital products to market, fast. In addition, the insurer is constantly looking for ways to better connect with and serve customers, in real time, by broadening their digital capabilities and further personalizing the interactions customers have with Manulife. Manulife’s existing data infrastructure, however, was becoming a drag on innovation. Traditional relational databases limited how fast the Manulife team could bring new digital products to market. In particular, Manulife’s developers, the architects of these new digital products and services, faced issues working with the existing data infrastructure, including the need to constantly optimize the database, deal with data normalization issues, and work with slow querying of data. From Relational to NoSQL to MongoDB From the outset, Manulife knew that they would build their new digital experience on a NoSQL database. NoSQL is core to our strategy of building our digital experience. The flexible data model [for NoSQL] means you’re not limited by the schema. Harry Cheung, Chief Architect, Manulife Asia After deciding to go the NoSQL, Manulife was won over to MongoDB for several reasons, including: The document data model: MongoDB's document data model means no rigid schemas to slow down development. This allows for faster iterations when building new digital products. From on-premises to the cloud: Moving from a MongoDB on-premises deployment to MongoDB Atlas in the cloud was easy for the Manulife team. Scalability: MongoDB can easily scale horizontally to meet spikes in demand. Enterprise-ready & mature: MongoDB is used by the world’s largest insurers, offering greater flexibility alongside the sorts of core requirements you would expect from an RDBMS, such as ACID transactions. MongoDB Support: Assistance with projects like data migration from on-premises to cloud services on MongoDB Atlas made the transition smoother. A pay-as-you-go model: MongoDB’s elastic scaling capabilities and flexible pricing model keep costs down. On and offline functionality: MongoDB Atlas has built-in mobile device synchronization capabilities, speeding up the development of offline-first insurance applications. Built with MongoDB: Four Use Cases for Manulife MOVE, a Health-Focused App: MOVE is a digital app that encourages users to meet fitness goals, with daily steps linked to insurance premium discounts. MongoDB's JSON-based document model simplified app development and data management. Secondly, Manulife started running the MOVE app on-premises. When they wanted to migrate the app to a public cloud of their choice (from MongoDB to MongoDB Atlas) the process was seamless. Sales Assistance App: Used by 90% of agents, this app helps Manulife agents in the field service customers and complete applications. One area where MongoDB Atlas was particularly helpful was mitigating issues with mobile connectivity and data synchronization. Agents in the field often suffer from internet service interruptions, such as a dropped mobile signal. When the agent’s sales app reconnects, the data from the app has to be synchronized with the backend MongoDB database. Building apps that can handle such offline/online data synchronization, also known as offline-first apps, can significantly eat into development time, slowing time to value for organizations developing robust offline-first apps. MongoDB Atlas Device Sync solves this issue with native offline to online synchronization capabilities to enable uninterrupted client interactions, even in low connectivity areas. Using Atlas Device Sync, the sales app can store customer, proposal, application, and document metadata on the local device (using MongoDB’s dedicated mobile device database), and then synchronize that data and the customer application to the main MongoDB database when connected to the internet. Manulife launched their sales app's offline mode in just 2 months with MongoDB Atlas Device Sync Policy Life Cycle Management: Traditional relational databases spread policy data across multiple tables. With MongoDB, a single document can encapsulate an entire policy, streamlining querying access and enhancing performance. MongoDB is now the system of record for policy servicing and life cycle management. This new system was met with overwhelming approval from Manulife’s developers. In the past, we were using a traditional relational database, with more than 500 core tables. With MongoDB, when I asked developers who had previously used our traditional [RDBMS] database, ‘You have a choice, do you want to use MongoDB or go back to the traditional [database]?’ all our developers said MongoDB. Harry Cheung, Chief Architect, Manulife Asia Claims Processing: MongoDB's capability to handle structured and unstructured data simplified integration with partners, especially in Optical Character Recognition (OCR) for claim processes. Looking ahead Manulife is set on expanding its use of NoSQL databases, with MongoDB identified as the go-to solution for such projects. MongoDB is our internal standard. MongoDB is our strategic partner for NoSQL development. Harry Cheung, Chief Architect, Manulife Asia About Manulife Manulife Financial Corporation is one of the largest life insurance companies in the world. The company provides insurance and financial services to millions of customers in Asia, Canada, and the United States. Manulife operates under different brand names: Manulife in North America and Asia, and John Hancock in the U.S. It's recognized for its long-standing presence in Hong Kong, with a focus on life insurance, mutual funds, and other financial products. In addition to life insurance, Manulife offers a wide range of financial services including wealth and asset management, group benefits, and retirement services. Learn more about our work with the world's leading insurers on our MongoDB for Insurance page.

AI生成摘要 WeLab汇立集团与阿里云合作,使用MongoDB数据库解决业务挑战。WeLab汇立集团是亚洲领先的金融科技集团,提供金融科技服务。他们选择MongoDB数据库,因为它能处理复杂的数据结构和多元的应用场景。MongoDB还提供高并发、高可用和海量存储易扩展的功能。数据库升级后,WeLab的写入性能提升超过50%。阿里云和MongoDB团队提供了专业的技术支持,降低了运维成本和学习成本。

相关推荐 去reddit讨论

华为云官方博客 -

详解数据库SQL中的三个语句:DROP、TRUNCATE 、DELETE

本文以GaussDB数据库为平台,将详细介绍SQL中DROP、TRUNCATE和DELETE等语句的含义、使用场景以及注意事项,帮助读者更好地理解和掌握这些常用的数据库操作命令。

AI生成摘要 本文介绍了GaussDB数据库中的DROP、TRUNCATE和DELETE语句的含义、使用场景和注意事项。DROP语句可以删除整个表,包括表结构和数据;TRUNCATE语句可以快速删除表中的所有数据,但不删除表结构;DELETE语句可以删除表中的数据,不包括表结构。文章还给出了DROP TABLE、TRUNCATE和DELETE命令的语法和示例,并提到了它们的应用场景和注意事项。无论选择哪种删除方式,都需要考虑数据的备份和安全性。

相关推荐 去reddit讨论

Tony Bai -

关系代数、SQL语句和Go语言示例

本文永久链接 – https://tonybai.com/2023/11/15/relational-algebra-and-sql-with-go-examples 近些年,数据库领域发展日新月异,除传统的关系型数据库外,还出现了许多新型的数据库,比如:以HBase、Cassandra、MongoDB为代表的NoSQL数据库,以InfluxDB、TDEngine为代表的时序数据库,以Neo4J、Dgraph为代表的图数据库,以Redis、Memcached等为代表的内存数据库,以Milvus为代表的向量数据库,以CockroachDB、TiDB为代表的HTAP融合数据库以及云原生数据库等。各类型数据库都有自己的优势,开发者可以根据应用场景选择最合适的数据库。 不过,关系型数据库依旧是当今最流行的数据库管理系统,广泛应用于企业应用,也是大多数数应用开发人员日常接触最多的一种数据库类型。关系型数据库通过关系模型和关系代数的理论基础,实现了对关系数据的高效组织和操作。但许多开发人员在使用SQL进行数据库开发时,往往感到关系代数晦涩难懂,对SQL语句的语义理解不透彻,这给数据库应用开发带来了困难。 在这篇文章中,我们就来研究一下关系模型和关系代数,探究其与SQL语句的对应关系,并用Go语言代码示例实现相关查询,期望能帮助读者增进对关系数据库的理解,减轻数据库开发痛点,提高数据库应用能力。 1. 关系模型(Relational Model) 20世纪70年代,IBM研究员E.F. Codd在“A Relational Model of Data for Large Shared Data Banks”这篇论文中提出了关系模型的概念。随后,E.F.Codd又陆续发表了多篇文章,用数学理论奠定了关系数据库的基础,为关系数据库建立了一个数据模型 —— 关系数据模型。 关系模型基于谓词逻辑和集合论,有严格的数学基础,提供了高级别的数据抽象层次,并不规定数据存取的具体过程,而是交由DBMS(数据库管理系统)自己实现。 关系模型之所以成为DBMS领域的主流模型,正是由于其非常简单(相较于更早的网络模型(network model)和层次模型(hierarchical model)),下面是关系模型中定义的一些概念: 关系(Relation) E.F.Codd的论文对关系(Relation)的定义是这样的:“这里的关系是指公认的数学意义上的关系。给定集合S1, S2, … ,Sn(不一定互不相关),如果 R是由n元组(n-tuples)组成的集合,其中每个元组的第一个元素来自S1,第二个元素来自S2,以此类推,那么R就是这n个集合(S1~Sn)上的一个关系”。 不用你说,我也知道这段文字太过抽象!下面我尽力用一个图来呈现一下Relation的含义: 我们看到,关系(Relation)是一个集合,实质上是一个“二维表格结构”,把上图中不属于R中的元组去掉,看起来可能更清晰一些: 这个结构中的每一行就是1个n元组(n-tuples),列则是S1到Sn,一共n个列。n元组中的数据依次分别来自S1、S2、…Sn。 元组(Tuple) 关系(Relation)这个“二维表格结构”中的每一个n元组,即每一行,被称作元组(Tuple)。 属性(Attribute) 关系(Relation)这个“二维表格结构”中的每一列(Sn)被称作一个属性(Attribute)。 域(Domain) 属性可能取值的范围被称为该属性的域,以图中属性S3为例,S3-e1、S3-e2一直到S3-ek都在该属性的域中,显然{S3-e1, S3-e2, …, S3-ek}这个集合是属性S3的域的一个子集。有个特殊的值null是所有域的一个成员,它一般表示值为”unknown”。 论文在定义关系模型时,还定义了一些模型的额外特征,比如: 元组的顺序是不重要的; 所有的元组(行)是不同的; … … 有了关系模型的定义,接下来就可以在模型基础上定义以关系操作对象的运算了,这种运算的集合就构成了关系代数。 2. 关系代数(Relational Algebra) 关系代数由一系列操作组成,这些操作将一个或两个关系作为输入,并产生一个新的关系作为结果。概括来说就是关系代数的运算通过输入有限数量的关系进行运算,运算结果仍为关系。 关系代数定义了一些基本关系运算和扩展关系运算,其中基本关系运算包括: [...]

AI生成摘要 本文介绍了关系代数和SQL的对应关系,以及关系代数在Go语言中的实现。关系代数是关系数据库的理论基础,通过选择、投影、连接、交、并、积等运算来操作关系数据。通过理解关系代数与SQL的对应关系,可以更好地使用SQL语言操作关系型数据库。本文提供了Go语言的示例代码。

相关推荐 去reddit讨论

Planet MySQL -

How to Import/Export MySQL Data to SQL Azure: Using ODBC Driver for Data Migration

In this article, we'll briefly review some advantages of SQL Azure, a Microsoft cloud-based SQL database service, and explore how to export and import data between Azure SQL and MySQL server using a universal ODBC driver for SQL Azure and a powerful MySQL tool - dbForge Studio for MySQL. The post How to Import/Export MySQL Data to SQL Azure: Using ODBC Driver for Data Migration appeared first on Devart Blog.

AI生成摘要 本文介绍了如何在Azure SQL和MySQL服务器之间迁移数据。Azure SQL是一种云数据库服务,可以存储、管理和处理数据。Azure SQL具有可调整资源、按需付费、高可用性、易于迁移等优势。使用dbForge Studio for MySQL和ODBC驱动程序可以方便地导出和导入数据。导出数据到CSV文件时,可以选择导出格式、源数据、输出设置、数据格式等。使用ODBC驱动程序将数据导入Azure SQL时,需要选择MySQL源数据和ODBC驱动程序,并进行数据类型映射。最后,可以直接将数据导入数据库。

相关推荐 去reddit讨论

京东科技开发者 -

【慢SQL性能优化】 一条SQL的生命周期

一、 一条简单SQL在MySQL执行过程一张简单的图说明下,MySQL架构有哪些组件和组建间关系,接下来给大家用SQL语句分析例如如下SQL语句SELECT department_id FROM employee WHERE name = 'Lucy' AND age > 18 GROUP BY department_id其中name为索引,我们按照时间顺序来分析一下1.客户端:如My...

AI生成摘要 本文通过一张架构图详细解析了MySQL查询的执行过程,包括单表查询和表关联查询。从客户端发送SQL查询到MySQL服务器,经过连接器、查询缓存、解析器、优化器、执行器和存储引擎等组件的协作,最终返回查询结果给客户端。文章还介绍了查询SQL关键字的执行顺序,以及表关联查询的执行过程。通过这些解析,开发者可以更好地理解和优化SQL查询。

相关推荐 去reddit讨论

Databricks -

Named Arguments for SQL Functions

Today, we introduce the new availability of named arguments for SQL functions. With this feature, you can invoke functions in more flexible ways...

AI生成摘要 SQL函数现支持命名参数,提高了函数调用的灵活性。此特性对于SQL用户定义函数(UDFs)和内置函数均有效,简化了参数指定,尤其在参数列表较长时更显便利。Databricks Runtime 14.1和Apache Spark 3.5已实现此功能,使得SQL代码更易读、更简洁。

相关推荐 去reddit讨论

热榜 Top10
...
LigaAI
...
Dify.AI
...
eolink
...
ShowMeBug
...
白鲸技术栈
...
天勤数据
...
观测云
推荐或自荐