SQL
SQL
Câu 1: Which of the following column properties would be used to specify that cells in a column must
contain a monetary value that is less than another monetary value in the same row?
A. Null status B. Default value C. Data constraints D. Data type
Câu 2: The SQL keyword BETWEEN is used:
A. to limit the columns displayed. B. as a wildcard.
C. for ranges. D. None of the above is correct.
Câu 3: The keyword LIKE can be used in a WHERE clause to refer to a range of values.
A. True B. False
Câu 4: The XML family of standards is very important in database processing today.
A. True B. False
Câu 5: One of the reasons why OODBMSs have not been widely used for business information systems is
that OOP is obsolete.
A. True B. False
Câu 6: You have run an SQL statement that asked the DBMS to display data in a table named
USER_TABLES. The results include columns of data labeled "TableName," "NumberOfColumns" and
"PrimaryKey." You are looking at ________.
A. user data. B. indexes C. A report D. metadata
Câu 7: A unique, DBMS-supplied identifier used as the primary key of a relation is called a(n):
A. primary key. B. composite key. C. surrogate key. D. foreign key.
Câu 8: Which of the following statements is true concerning routines and triggers?
A. Both are stored in the database. B. Both have to be called to operate.
C. Both run automatically. D. Both consist of procedural code.
Câu 9: Because it contains a description of its own structure, a database is considered to be ________.
A. described B. an application program
C. metadata compatible D. self-describing
Câu 10: A CASE SQL statement is which of the following?
A. way to establish a data definition in SQL.
B. A way to establish a loop in SQL.
C. A way to establish an IF-THEN-ELSE in SQL.
C. All of the above.
Câu 11: The SQL command to create a table is:
A. ALTER TABLE. B. CREATE TABLE. C. MAKE TABLE. D. DEFINE TABLE.
Câu 12: Data manipulation language (DML) commands are used to define a database, including creating,
altering, and dropping tables and establishing constraints.
A. True B. False
Câu 13: Scalar aggregate are multiple values returned from an SQL query that includes an aggregate
function.
A. True B. False
Câu 14: The identifier of an entity will become the ________ of the new table.
A. primary key B. identity key C. foreign key D. main attribute
Câu 15: Which of the following data constraints would be used to specify that the value of a cell in one
column must be less than the value of a cell in another column in the same row of the same table?
A. An intrarelation constraint B. A range constraint
C. A domain constraint D. An interrelation constraint
Câu 16: Indexes may be created or dropped at any time.
A. True B. False
Câu 17: Views constructed from SQL SELECT statements that conform to the SQL-92 standard may not
contain:
A. GROUP BY. B. WHERE. C. ORDER BY. D. FROM.
Câu 18: DISTINCT and its counterpart, ALL, can be used more than once in a SELECT statement.
A. True B. False
Câu 19: The relational database model was created by E.F. Codd.
A. True B. False
Trang 1/13 - Mã đề thi 027
Câu 20: SQL can be used to:
A. modify database data only. B. create database structures only.
C. query database data only. D. All of the above can be done by SQL.
Câu 21: What is the best data type definition for SQL Server when a field is alphanumeric and has a fixed
length?
A. CHAR B. VARCHAR2 C. LONG D. NUMBER
Câu 22: In a one-to-many relationship, the entity that is on the one side of the relationship is called a(n)
________ entity.
A. child B. instance C. parent D. subtype
Câu 23: Which of the following is true concerning systems information in an RDBMS?
A. This information can be accessed using SQL.
B. This information often cannot be updated by a user.
C. RDBMS store database definition information in system-created tables.
D. All of the above.
Câu 24: Entities of a given type are grouped into a(n):
A. ERD. B. entity class. C. database. D. attribute.
Câu 25: Applications are programs that interact directly with the database.
A. True B. False
Câu 26: The purpose of a database is to help people stop using spreadsheets.
A. True B. False
Câu 27: A recursive relationship is a relationship between an entity and ________.
A. a subtype entity B. itself C. an archetype entity D. an instance entity
Câu 28: Which of the following situation requires the use of ID-dependent entities?
A. Archetype/instance relationships only B. Multivalued attributes only
C. Association relationships only D. All of the above use ID dependent entities
Câu 29: The command to eliminate a table from a database is:
A. UPDATE TABLE CUSTOMER; B. DELETE TABLE CUSTOMER;
C. REMOVE TABLE CUSTOMER; D. DROP TABLE CUSTOMER;
Câu 30: If you are going to use a combination of three or more AND and OR conditions, it is often easier
to use the NOT and NOT IN operators.
A. True B. False
Câu 31: A view is which of the following?
A. A base table that cannot be accessed via SQL commands
B. A base table that can be accessed via SQL commands
C. A virtual table that cannot be accessed via SQL commands
D. A virtual table that can be accessed via SQL commands
Câu 32: A DBMS that combines a DBMS and an application generator is ________.
A. IBM's DB2 B. Microsoft's Access
C. Oracle Corporation's Oracle D. Microsoft's SQL Server
Câu 33: Which type of entity represents an actual occurrence of an associated generalized entity?
A. Instance entity B. Subtype entity C. Archetype entity D. Supertype entity
Câu 34: What is an SQL virtual table that is constructed from other tables?
A. A view B. Just another table C. Query results D. A relation
Câu 35: Which of the following column properties would be used to specify that cells in a column must be
immediately filled with a monetary value of $10,000?
A. Default value B. Data constraints C. Null status D. Data type
Câu 36: SELECT DISTINCT is used if a user wishes to see duplicate columns in a query.
A. True B. False
Câu 37: The following are functions of a DBMS except ________.
A. creating databases B. processing data
C. creating and processing forms D. administrating databases
Câu 38: The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID,
ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T ;
A. Natural join B. Equi-join C. Outer join D. Cartesian join
Câu 39: Entities can be associated with one another in which of the following?
A. Identifiers B. Entities C. Relationships D. Attributes
Trang 2/13 - Mã đề thi 027
Câu 40: Which of the three possible types of triggers does SQL Server support?
A. BEFORE only B. INSTEAD OF and AFTER only
C. AFTER only D. INSTEAD OF only
Câu 41: The SQL keyword(s) ________ is used with wildcards.
A. NOT IN only B. IN and NOT IN C. IN only D. LIKE only
Câu 42: Which of the following refers to something that can be identified in the users' work environment,
something that the users want to track?
A. Identifier B. Attribute C. Entity D. Relationship
Câu 43: A database is called "self-describing" because it contains a description of itself.
A. True B. False
Câu 44: A primary key should be defined as:
A. NULL. B. NOT NULL.
C. Either of the above can be used. D. None of the above are correct.
Câu 45: An on-line commercial site such as Amazon.com is an example of a(n) ________.
A. multiuser database application B. single-user database application
C. data mining database application D. e-commerce database application
Câu 46: Which of the following are the five built-in functions provided by SQL?
A. SUM, AVG, MIN, MAX, NAME B. SUM, AVG, MIN, MAX, MULT
C. COUNT, SUM, AVG, MAX, MIN D. SUM, AVG, MULT, DIV, MIN
Câu 47: The result of a SQL SELECT statement is a(n) ________.
A. report B. file C. table D. form
Câu 48: A database design may be based on existing data.
A. True B. False
Câu 49: A ________ is a program that performs some common action on database data and that is stored
in the database.
A. pseudofile B. None of the above is correct.
C. trigger D. stored procedure
Câu 50: Which of the following columns is(are) are required in a table?
A. An alternate key B. A foreign key C. A primary key D. A surrogate key.
Câu 51: Which of the following data constraints would be used to specify that the value of cells in a column
must be one of a specific set of possible values?
A. An intrarelation constraint B. An interrelation constraint
C. A range constraint D. A domain constraint
Câu 52: ON UPDATE CASCADE ensures which of the following?
A. Normalization B. Data Integrity C. Materialized Views D. All of the above.
Câu 53: Which of the following improves a query's processing time?
A. Write complex queries. B. Combine a table with itself.
C. Query one query within another. D. Use compatible data types.
Câu 54: Which of the following statements is true concerning subqueries?
A. Does not start with the word SELECT.
B. Cannot return the same result as a query that is not a subquery.
C.Involves the use of an inner and outer query.
C. All of the above.
Câu 55: Which of the following is valid SQL for an Index?
A. CREATE INDEX ID; B. REMOVE INDEX ID;
C. CHANGE INDEX ID; D. ADD INDEX ID;
Câu 56: Which of the following indicates the minimum number of entities that must be involved in a
relationship?
A. Greater Entity Count (GEC) B. Maximum cardinality
C. ERD D. Minimum cardinality
Câu 57: What type of join is needed when you wish to return rows that do have matching values?
A. Outer join B. Equi-join C. Natural join D. All of the above.
Câu 58: What is an advantage of placing computations in SQL views?
A. To ensure that the results are consistent.
B. To save users from having to write an expression.
C.To accomplish both of the above.
Trang 3/13 - Mã đề thi 027
D.None of the above is correct - computations cannot be placed in a view.
Câu 59: Which of the following is one of the basic approaches for joining tables?
A. Natural join B. Subqueries C. Union Join D. All of the above
Câu 60: If a denormalization situation exists with a many-to-many or associative binary relationship, which
of the following is true?
A. All fields are stored in four relations. B. All fields are stored in one relation.
C. All fields are stored in two relations. D. All fields are stored in three relations.
Câu 61: A database has data and relationships.
A. True B. False
Câu 62: A UNION query is which of the following?
A.Combines the output from multiple queries and must include the same number of columns.
B.Combines the output from no more than two queries and must include the same number of columns.
C.Combines the output from no more than two queries and does not include the same number of
columns.
D.Combines the output from multiple queries and does not include the same number of columns.
Câu 63: The SELECT command, with its various clauses, allows users to query the data contained in the
tables and ask many different questions or ad hoc queries.
A. True B. False
Câu 64: The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the
same value in a column.
A. True B. False
Câu 65: The benefits of a standard relational language include which of the following?
A. Increased dependence on a single vendor B. Reduced training costs
C. Applications are not needed. D. All of the above.
Câu 66: To sort the results of a query use:
A. SORT BY. B. ORDER BY.
C. GROUP BY. D. None of the above is correct.
Câu 67: In the relational model, relationships between relations or tables are created by using:
A. composite keys. B. determinants. C. candidate keys. D. foreign keys.
Câu 68: The following are components of a database except ________.
A. user data B. metadata C. indexes D. reports
Câu 69: In a database, data is stored in spreadsheets which have rows and columns.
A. True B. False
Câu 70: Which of the following is the original purpose of SQL?
A. To specify the syntax and semantics of SQL data definition language
B. To specify the syntax and semantics of SQL manipulation language C.
To define the data structures
D. All of the above.
Câu 71: Table is synonymous with the term:
A. field. B. column. C. record. D. relation.
Câu 72: What mode of authentication does SQL Server NOT provide?
A. SQL Server only security B. Mixed security
C. Windows-only security D. Both SQL Server and Windows-only security
Câu 73: Microsoft Access has become ubiquitous, and being able to program in Access is a critical skill.
A. True B. False
Câu 74: To establish a range of values, < and > can be used.
A. True B. False
Câu 75: If a relationship has a cascade updates constraint, then if ________ in the parent table is changed,
then the same change will automatically be made to any corresponding foreign key value.
A. a foreign key B. the primary key C. any alternate key D. a surrogate key
Câu 76: Which of the following is a correlated subquery?
A. Uses the result of an inner query to determine the processing of an outer query.
B. Uses the result of an inner query to determine the processing of an inner query.
C. Uses the result of an outer query to determine the processing of an inner query.
C. Uses the result of an outer query to determine the processing of an outer query.