Hamster
Search
Open menu
熟悉傳統數據庫概念及 SQL
1. Each record in the products table has a product ID and a product name. How to list the products sorted by their names?
A.
sort products by name
B.
select from products sorted by name
C.
select products by name
D.
select * from products order by name
2. Each record in the products table has a product ID, a product name and a price. How to calculate the numbers of products whose prices are greater than $100?
A.
select sum(*) from products where price > 100;
B.
select total(*) from products if price > 100;
C.
select total(*) from products for price > 100;
D.
select count(*) from products wehre price > 100;
3. In creating a database, this is the process of organizing it into tables in such a way that the results of using the database are always unambiguous.
A.
data modeling
B.
virtual organization
C.
probability
D.
normalization
4. Which of the following is not a many-to-many relationship?
A.
Husband and wife
B.
Student and Teacher
C.
Patient and Doctor
D.
Customer and Restaurant
5. How to create a table?
A.
create table ( id integer primary key; name varchar(20));
B.
create table { id integer; name varchar(20)}
C.
create table ( id integer primary key, name varchar(20));
D.
class table { id: integer; name: String; }
6. Which of the following may be a valid SQL statement?
A.
select students if name='paul' && age>20;
B.
get students where name='paul' and age>20;
C.
select * from students where name='paul' and age>20;
D.
choose name, id from students if name='paul' && age>20;
7. Each record in the products table has a product ID, a product name and a price. How to double the prices of all products?
A.
update products set price = 2*price;
B.
update price = 2*price from products;
C.
update products price = 2*price;
D.
update products by price = 2*price;
8. Create an index when? (choose two)
A.
The table is updated frequently
B.
A column contains a large number of null values
C.
Most queries are expected to retrieve more than 2% to 4% of the rows in the table.
D.
A column contains a wide range of values
9. Which of the following may be a valid SQL statement?
A.
select * from students where name='paul' and age>20;
B.
choose name, id from students if name='paul' && age>20;
C.
get students where name='paul' and age>20;
D.
select students if name='paul' && age>20;
10. Which of the following is suitable to use index?
A.
Columns often be used in ORDER BY clause
B.
Table with many modifications but few actual queries
C.
Table with few rows
D.
Many duplicate rows