W3Schools SQL Quiz
W3Schools SQL Quiz
| SQL QUIZ | Points: 25 out of 25 |
|---|
1. What does SQL stand for?
You answered:
Structured Query Language
Correct Answer!
2. Which SQL statement is used to extract data from a database?
You answered:
SELECT
Correct Answer!
3. Which SQL statement is used to update data in a database?
You answered:
UPDATE
Correct Answer!
4. Which SQL statement is used to delete data from a database?
You answered:
DELETE
Correct Answer!
5. Which SQL statement is used to insert new data in a database?
You answered:
INSERT INTO
Correct Answer!
6. With SQL, how do you select a column named "FirstName" from a table named "Persons"?
You answered:
SELECT FirstName FROM Persons
Correct Answer!
7. With SQL, how do you select all the columns from a table named "Persons"?
You answered:
SELECT * FROM Persons
Correct Answer!
8. With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
You answered:
SELECT * FROM Persons WHERE FirstName='Peter'
Correct Answer!
9. With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
You answered:
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
Correct Answer!
10. The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
You answered:
True
Correct Answer!
11. With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
You answered:
SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
Correct Answer!
12. With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
You answered:
SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
Correct Answer!
13. Which SQL statement is used to return only different values?
You answered:
SELECT DISTINCT
Correct Answer!
14. Which SQL keyword is used to sort the result-set?
You answered:
ORDER BY
Correct Answer!
15. With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
You answered:
SELECT * FROM Persons ORDER BY FirstName DESC
Correct Answer!
16. With SQL, how can you insert a new record into the "Persons" table?
You answered:
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
Correct Answer!
17. With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
You answered:
INSERT INTO Persons (LastName) VALUES ('Olsen')
Correct Answer!
18. How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
You answered:
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
Correct Answer!
19. With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
You answered:
DELETE FROM Persons WHERE FirstName = 'Peter'
Correct Answer!
20. With SQL, how can you return the number of records in the "Persons" table?
You answered:
SELECT COUNT(*) FROM Persons
Correct Answer!
21. What is the most common type of join?
You answered:
INNER JOIN
Correct Answer!
22. Which operator is used to select values within a range?
You answered:
BETWEEN
Correct Answer!
23. The NOT NULL constraint enforces a column to not accept null values.
You answered:
True
Correct Answer!
24. Which operator is used to search for a specified pattern in a column?
You answered:
LIKE
Correct Answer!
25. Which SQL statement is used to create a table in a database?
You answered:
CREATE TABLE
Correct Answer!
W3Schools SQL Quiz的更多相关文章
- W3Schools Quizzes
W3Schools Quizzes Test your skills https://www.w3schools.com/quiztest/default.asp Quiz HOME Quiz HTM ...
- 如何成为QTP专家
关键字:QTP 自动化测试 专家地址:http://www.cnblogs.com/txw1958/archive/2012/11/20/how-to-become-qtp-guru.html Wou ...
- SQL Quick Reference From W3Schools
SQL Statement Syntax AND / OR SELECT column_name(s)FROM table_nameWHERE conditionAND|OR condition AL ...
- SQL指南-SELECT语句
SELECT 语句 SELECT 语句用于从表中筛选数据.列表结果存储于一个结果表中(称作result-set) 语法 SELECT column_name(s)FROM table_name 注意: ...
- SQL基础语法笔记教程整理
PS:本文适用SQL Server2008语法. 一.关系型数据库和SQL 实际上准确的讲,SQL是一门语言,而不是一个数据库. 什么是SQL呢?简而言之,SQL就是维护和使用关系型数据库中的的数据的 ...
- SQL语法的重要知识点总结
好几年没写SQL语句了.现在到了新的team,需要用到数据库.作为QA的话时常需要使用客户端工具连接到数据库中找寻或修改数据.这么长时间没使用,一些SQL的使用技巧都忘得差不多了.晚上看了一些资料,花 ...
- [IT学习]sql 入门及实例
sql 是一种数据库查询语言,可以让你很快的查询到数据.其实一般情况下,你也可以采用excel来查询数据库数据. 但是人们通常认为sql会更加灵活和方便一些. sql学习的入门网站: http://w ...
- SQL语句 & 查询表结构
[group by] 对结果集进行分组,常与汇总函数一起使用. SELECT column,SUM(column) FROM table GROUP BY column HAVING 通常与 GROU ...
- oracle 常用SQL语法手册
Select 用途: 从指定表中取出指定的列的数据 语法: SELECT column_name(s) FROM table_name 解释: 从数据库中选取资料列,并允许从一或多个资料表中,选取一或 ...
随机推荐
- win7解压的软件开机自启动
win7让你一个可执行程序开机启动. 运行-->regedit-->HKEY_LOCAL_MACHINE-->SOFTWARE-->Microsoft-->Windows ...
- Android LCD
Android LCD(一):LCD基本原理篇Android LCD(二):LCD常用接口原理篇Android LCD(三):Samsung LCD接口篇Android LCD(四):LCD驱动调试篇
- JSONP跨站访问
js中几种实用的跨域方法原理详解 这里说的js跨域是指通过js在不同的域之间进行数据传输或通信,比如用ajax向一个不同的域请求数据,或者通过js获取页面中不同域的框架中(iframe)的数据.只要协 ...
- 《网络攻防》Web安全基础实践
20145224陈颢文 <网络攻防>Web安全基础实践 基础问题回答 SQL注入攻击原理,如何防御: 部分程序员在编写代码的时候,没有对用户输入数据的合法性进行判断,黑客利用这个bug在数 ...
- C++结构体定义和C的区别
对于C来说,struct定义的结构体不是一种数据类型,所以每次声明的时候需要加上struct让编译器知道这是结构体,为了不每次都加上struct关键字,可以在定义结构体的时候加上typedef关键字: ...
- Mysql 语句单表查询
一基本查询 -- 创建商品表 CREATE TABLE products( pid INT PRIMARY KEY AUTO_INCREMENT, pname VARCHAR(20), price D ...
- 编程练习赛11B 物品价值(装压dp)
题意:每个物品有m(m<=10)种属性和一个价格,你有n种物品从中任意选择一些物品,让每种属性恰好有奇数个物品拥有,输出满足条件的最大价值和 题解:一看就是明显的01背包问题,但是价格乘以个数的 ...
- windows系统下载地址大全&大白菜下载和教程
win10的 Windows10 64位纯净系统下载(不建议,后面的有原版) http://cjxt.sysdaa.com/down.php?post=win10-64&action=bend ...
- 从reduce函数说起...
reduce函数: 方法接收一个函数作为累加器(accumulator),数组中的每个值(从左到右)开始缩减,最终为一个值, 最终返回的要看函数内部return的内容. 1. 累加器: var ar ...
- SQL优化之列裁剪和投影消除
列裁剪 对于没用到的列,则没有必要读取它们的数据去浪费无谓的IO 比如我们有一张表table1,它含有四列数据(a,b,c,d).当我们执行查询select a from table1 where c ...