SELECT basics - SQLZOO

world表

在这里插入图片描述

The example uses a WHERE clause to show the population of ‘France’. Note that strings (pieces of text that are data) should be in ‘single quotes’;
Modify it to show the population of Germany

select population from world where name='Germany';

在这里插入图片描述

Checking a list The word IN allows us to check if an item is in a list. The example shows the name and population for the countries ‘Brazil’, ‘Russia’, ‘India’ and ‘China’.
Show the name and the population for ‘Sweden’, ‘Norway’ and ‘Denmark’.

select name,population from world where name in ('Sweden','Norway','Denmark');

在这里插入图片描述

Which countries are not too small and not too big? allows range checking (range specified is inclusive of boundary values). The example below shows countries with an area of 250,000-300,000 sq. km. Modify it to show the country and the area for countries with an area between 200,000 and 250,000.

select name,area from world where area between 200000 and 250000;

在这里插入图片描述

获取一个 Git 仓库是开始使用 Git 的第一步。这可以通过两种主要方式实现:**初始化一个新的本地仓库**或**克隆一个已经存在的远程仓库**。下面详细介绍这两种方法及其相关的命令和注意事项。 --- ### 方法一:初始化一个新的本地仓库 (Init) 当你有一个尚未受版本控制保护的项目文件夹时,可以将其转换为一个 Git 仓库。以下是步骤: 1. **进入目标目录** 首先打开终端(Terminal),导航至你想添加版本控制的那个文件夹路径下。 ```bash cd /path/to/your/project ``` 2. **运行 `git init` 命令** 输入以下命令以初始化新仓库: ```bash git init ``` 此操作会在该目录内创建一个名为 `.git` 的隐藏文件夹,里面包含了所有必要的配置信息和数据库结构用于后续的操作如跟踪修改、记录提交等。 3. **检查状态** 初始化完成后可通过以下指令查看当前的工作树状况: ```bash git status ``` 4. **首次提交** 将现有文件加入索引区(stage)然后完成第一次commit ```bash git add . git commit -m "Initial commit" ``` > 注意事项: 如果不想让某些特定类型的文档被列入追踪列表(例如临时编译产物),那么应该事先建立.gitignore文本档来排除它们. --- ### 方法二:克隆已有远程仓库 (Clone) 如果需要复制一份来自某个服务器端共享出来的公开资源库或者私人协作型储存空间里的完整资料集到个人机器上来参与编辑维护活动,则需要用到 clone 指令。 基本语法形式如下所示: ```bash git clone <repository-url> ``` 例如要下载 github.com 上面某开源项目的全部源码的话只需指定相应网址即可 ```bash git clone https://github.com/user/repo-name.git ``` 上述过程会自动为你执行这几项任务: - 创建同名的新文件夹存放提取下来的档案; - 设置 origin alias 映射关联原始地址链接方便未来推送变动结果回去原处; - 默认检出 master 分支供即时测试体验用途。 另外还有几个常用的选项可供自定义行为模式: | 参数 | 描述 | |---------------|--------------------------------------------| | --depth N | 只抓取最新的N层commits的历史纪录加快速度 | | --bare | 不包含working directory只保留裸仓 | --- 综上所述,无论是想从零构建专属的代码管理环境还是快速接入他人的现成方案,Git都提供了简单直接却又功能齐全的方式满足需求.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值