sqlite gui
Solving problems is one of the best ways to learn and reinforce new concepts. In this case, we’ll be applying the most common clauses of the Structured Query Language (SQL), using a relational database (i.e. SQLite), and a graphical user interface (GUI) such as TablePlus to solve business-related questions.
解决问题是学习和强化新概念的最佳方法之一。 在这种情况下,我们将使用关系数据库(即SQLite)和图形用户界面(GUI)(如TablePlus)来应用结构化查询语言(SQL)的最常见子句,以解决与业务相关的问题。
Before we get started, there are a couple of housekeeping items we need to address.
在开始之前,我们需要解决几个内务处理项目。
- Download the sample SQLite database. 下载示例SQLite数据库。
- Install TablePlus or another compatible GUI. 安装TablePlus或另一个兼容的GUI。
Download a sample SQLite database
下载示例SQLite数据库
The database we’ll be using is a sample from the SQLite tutorial website.
我们将使用的数据库是SQLite教程网站中的示例。
By taking a closer look at the schema, a blueprint of the construction of a database, we are able to gain a visual sense of what a database contains. SQLite is an example of a relational database, and we can see relations by observing the connections formed between the keys of different tables. I’ll explain this in a little more detail later on, however for now, the most important thing is to grasp some visual understanding of what the database is comprised of (i.e. Tables that hold varying columns of different data types and relationships between tables.).
通过仔细查看架构(数据库构建的蓝图),我们可以直观地了解数据库包含的内容。 SQLite是关系数据库的一个示例,我们可以通过观察不同表的键之间形成的连接来查看关系。 我将在稍后更详细地解释这一点,但是现在,最重要的是要对数据库的组成有一些直观的了解(即,表包含不同数据类型的不同列以及表之间的关系。 )。
The download of the sample database I’ll be using can be found here. About halfway through, you should find a link for downloading the sample SQLite database. Click it when you’ve found it.
我将使用的示例数据库的下载可在此处找到。 大约过了一半,您应该找到下载示例SQLite数据库的链接。 找到它后,单击它。
After downloading the database, you’ll notice that it’s in a ZIP format. If you don’t already have a preferred software for unzipping a file, 7-zip is a free service recommended by the SQLite Tutorial website.
下载数据库后,您会注意到它为ZIP格式。 如果您还没有首选的软件来解压缩文件,则7-zip是SQLite教程网站推荐的免费服务。
Once you’ve unzipped the file, it’s helpful to move it to a place that’s easy to access. For example, I chose to move the unzipped file to my desktop.
解压缩文件后,将其移动到易于访问的位置很有帮助。 例如,我选择将解压缩的文件移动到桌面上。
Install TablePlus or another compatible GUI
安装TablePlus或其他兼容的GUI
From here we need the assistance of a program that will help us open and connect to the SQLite database. I’ve chosen to use TablePlus, a modern GUI tool for relational databases. TablePlus is available for download on both Windows and Mac devices, and offers a free tier with plenty of functionality for our purposes. After downloading and opening TablePlus on your device, a window with the below information should appear.
从这里开始,我们需要一个程序的帮助,该程序将帮助我们打开并连接到SQLite数据库。 我选择使用TablePlus ,这是一种用于关系数据库的现代GUI工具。 TablePlus可在Windows和Mac设备上下载,并提供免费层,其中包含用于我们目的的大量功能。 在设备上下载并打开TablePlus后,将出现一个包含以下信息的窗口。
(Note: There may be some slight design differences between the Mac and Windows TablePlus applications. I happen to be using a Windows device.)
(注意:Mac和Windows TablePlus应用程序之间可能会有一些细微的设计差异。我恰好在使用Windows设备。)
If you’re using TablePlus for the first time, your window should look just like the above. You’ll see that there aren’t any preexisting connections which is to be expected. That’s all about to change though. 😃
如果您是第一次使用TablePlus,则窗口应与上面的一样。 您会看到没有任何预先存在的连接是可以预期的。 但这一切都会改变。 😃
We now have our two primary housekeeping items complete.
现在,我们完成了两个主要的客房整理项目。
✔ Downloaded SQLite database.
✔下载SQLite数据库。
✔ Installed compatible GUI (i.e. TablePlus).
✔安装了兼容的GUI(即TablePlus)。
Connect the SQLite database using TablePlus
使用TablePlus连接SQLite数据库
Given that the database is SQLite, we’ll want to select the SQLite option when creating a new connection within TablePlus.
鉴于数据库是SQLite,在TablePlus中创建新连接时,我们将要选择SQLite选项。