SQL基础知识测试
1 . SQL 指的是?
Strong Question Language
Structured Question Language
Structured Query Language
2 . 哪个SQL 语句用于从数据库中提取数据?
EXTRACT
SELECT
OPEN
GET
3 . 哪条SQL 语句用于更新数据库中的数据?
MODIFY
SAVE AS
UPDATE
SAVE
4 . 哪条SQL 语句用于删除数据库中的数据?
COLLAPSE
DELETE
REMOVE
5 . 哪条SQL 语句用于在数据库中插入新的数据?
INSERT NEW
ADD RECORD
ADD NEW
INSERT INTO
6 . 通过SQL,您如何从 "Persons"表中选取 "FirstName" 列?
SELECT Persons.FirstName
SELECT FirstName FROM Persons
EXTRACT FirstName FROM Persons
7 . 通过SQL,您如何从 "Persons"表中选取所有的列?
SELECT [all] FROM Persons
SELECT Persons
SELECT * FROM Persons
SELECT *.Persons
8 . 通过SQL,您如何从 "Persons"表中选取 "FirstName" 列的值等于"Peter" 的所有记录?
SELECT [all] FROM Persons WHEREFirstName='Peter'
SELECT * FROM Persons WHERE FirstName LIKE'Peter'
SELECT [all] FROM Persons WHERE FirstNameLIKE 'Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
9 . 通过SQL,您如何从 "Persons"表中选取 "FirstName" 列的值以"a" 开头的所有记录?
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
SELECT * FROM Persons WHERE FirstName='a'
SELECT * FROM Persons WHERE FirstName LIKE'%a'
SELECT * FROM Persons WHERE FirstName='%a%'
10 . 请判断下列说法是否正确:当所列出的某个条件为true 时,OR 运算符会显示记录。当列出的所有条件为true 时,AND 运算符会显示记录。
正确
错误
11 . 通过SQL,您如何在表 Persons 中选择FirstName 等于 Thomas 而LastName 等于 Carter 的所有记录?
SELECT * FROM Persons WHERE FirstName LIKE'Thomas' AND LastName LIKE 'Carter'
SELECT FirstName='Thomas',LastName='Carter' FROM Persons
SELECT * FROM Persons WHERE FirstName='Thomas' AND LastName='Carter'
12 . 通过SQL,您如何按字母顺序选取 Persons表中 LastName 介于 Adams 和 Carter 的所有记录?
SELECT * FROM Persons WHERE LastName BETWEEN 'Adams' AND'Carter'
SELECT * FROM Persons WHERELastName>'Adams' AND LastName
SELECT LastName>'Adams' AND LastName
13 . 哪条SQL 语句可返回唯一不同的值?
SELECT DIFFERENT
SELECT DISTINCT
SELECT UNIQUE
14 . 哪个SQL 关键词用于对结果集进行排序?
ORDER
SORT BY
SORT
ORDER BY
15 . 通过SQL,您如何根据 "FirstName"列降序地从 "Persons" 表返回所有记录?
SELECT * FROM Persons SORT 'FirstName' DESC
SELECT * FROM Persons ORDER BY FirstName DESC
SELECT * FROM Persons ORDER FirstName DESC
SELECT * FROM Persons SORT BY 'FirstName'DESC
16 . 通过SQL,您如何向 "Persons"表插入新的记录?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT VALUES ('Jimmy', 'Jackson') INTOPersons
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
17 . 通过SQL,您如何向 "Persons"表中的 "LastName" 列插入"Wilson" ?
INSERT INTO Persons (LastName) VALUES ('Wilson')
INSERT ('Wilson') INTO Persons (LastName)
INSERT INTO Persons ('Wilson') INTOLastName
18 . 您如何把"Persons" 表中 "LastName" 列的 "Gates"改为 "Wilson" ?
MODIFY Persons SET LastName='Wilson' WHERELastName='Gates'
UPDATE Persons SET LastName='Wilson' WHERE LastName='Gates'
UPDATE Persons SET LastName='Wilson' INTOLastName='Gates'
MODIFY Persons SET LastName='Wilson' INTOLastName='Gates'
19 . 通过SQL,您如何在 "Persons"表中删除 "FirstName" 等于"Fred" 的纪录?
DELETE FROM Persons WHERE FirstName = 'Fred'
DELETE FirstName='Fred' FROM Persons
DELETE ROW FirstName='Fred' FROM Persons
20 . 通过SQL,您如何返回 "Persons"表中记录的数目?
SELECT COLUMNS() FROM Persons
SELECT COLUMNS(*) FROM Persons
SELECT COUNT() FROM Persons
SELECT COUNT(*) FROM Persons