Database Chapter 3

25 July 2022
4.7 (114 reviews)
65 test answers

Unlock all answers in this set

Unlock answers (61)
question
SQL is a data sublanguage, not a complete programming language (T/F).
answer
True
question
When using SQL to create a table, a column is defined by declaring, in this order: data type, column name, and optional constraints (T/F).
answer
False
question
When using SQL to create a table, specifying the NULL property for a column indicates that only null values may be stored in that column (T/F).
answer
False
question
When using SQL to create a table, specifying a data type of Char(10) indicates a fixed length field of 10 characters (T/F).
answer
True
question
For a column to be defined as the primary key using table constraints, the column must have been given the property null (T/F).
answer
False
question
If you need to create a primary key that is a composite key using SQL, the key may be defined when the table is created using the CREATE TABLE statement (T/F).
answer
True
question
Referential integrity constraints can be created using the ON DELETE phrase when the table is created using the CREATE TABLE statement (T/F).
answer
True
question
Referential integrity constraints using the ON DELETE NO ACTION phrase may be explicitly stated when the table is created using the CREATE TABLE statement (T/F).
answer
True
question
Data is added to a table using the SQL INSERT command (T/F).
answer
True
question
The result for SELECT statements in SQL is a relation unless the result is a single number (T/F).
answer
False
question
To force the DBMS to remove duplicate rows for the results of an SQL SELECT query, the keyword DISTINCT must be used (T/F).
answer
True
question
In SQL, the WHERE clause is used to specify which columns will be included in the result (T/F).
answer
False
question
In SQL, multiple conditions in the WHERE clause can be combined by using the SQL AND keyword (T/F).
answer
True
question
In SQL, to refer to a range of values in a WHERE clause, use the WITHIN keyword (T/F).
answer
False
question
In SQL, the NOT keyword can be combined with the IN keyword to form the NOT IN condition for selecting values (T/F).
answer
True
question
In SQL, the LIKE keyword can be used to select only partial values (T/F).
answer
True
question
In SQL, the LIKE keyword can be combined with the NOT keyword to form the NOT LIKE condition for selecting values (T/F).
answer
True
question
In SQL, the IS NULL keyword can be used to select on records containing NULL values in a particular column (T/F).
answer
True
question
In SQL, the order of the rows that result from a SELECT statement can be set using the SORT BY phrase (T/F).
answer
False
question
The SUM built-in function in SQL is used to total the values in a numeric column (T/F).
answer
True
question
The TOP built-in function in SQL is used to find the maximum value in a numeric column (T/F).
answer
False
question
Standard SQL does not allow built-in functions to be used in a WHERE clause (T/F).
answer
True
question
The SQL GROUP BY keyword can be used to group rows by common values (T/F).
answer
True
question
Built-in SQL functions cannot be applied to data combined using the GROUP BY keyword (T/F).
answer
False
question
Data from a maximum of three tables can be combined through the use of subqueries in SQL (T/F).
answer
False
question
A subquery is appropriate only if the final result contains only data from a single table (T/F).
answer
True
question
The basic idea of a join is to combine the contents of two or more relations into a new relation (T/F).
answer
True
question
Using standard SQL, unmatched rows will not appear in the result of a join (T/F).
answer
True
question
Values of existing data can be changed using SQL through the CHANGE command (T/F).
answer
False
question
The ON DELETE CASCADE referential integrity constraint does not apply when rows are deleted using the SQL DELETE command (T/F).
answer
False
question
Microsoft Access SQL commands are run within the SQL View of a Query window (T/F).
answer
True
question
Microsoft Access can run QBE queries, but not SQL queries (T/F).
answer
False
question
To open a new Microsoft Access Query window, click the Query Design button on the Create command tab (T/F).
answer
True
question
Microsoft Access SQL supports and will correctly implement the numeric data type with (m,n) notation (T/F).
answer
False
question
In Microsoft Access, default values must be set as a field property while the table is in Design View (T/F).
answer
True
question
Which of the following data types used in SQL would define a fixed-length text field of 10 characters? A. text(10) B. char(10) C. varchar(10) D. fixed (10) E. length (10)
answer
B
question
Which of the following data types used in SQL would define a numeric field of the pattern 99.99? A. integer (2,2) B. integer (5,2) C. numeric (2,2) D. numeric (4, 2) E. numeric (5, 2)
answer
C
question
Which of the following is not a standard data type used in SQL? A. Text B. Char C. Varchar D. Integer E. Numeric
answer
A
question
Which of the following is not true about primary keys? A. Primary keys cannot be null B. Primary keys must be unique C. Primary keys must be a single attribute D. Primary keys are used to represent relationships E. Primary keys can be defined using an SQL CONSTRAINT phrase.
answer
C
question
A composite primary key can be defined using the CONSTRAINT phrase in which SQL command? A. MODIFY TABLE B. CHANGE TABLE C. CREATE TABLE D. SET TABLE E. BUILD TABLE
answer
C
question
Which of the following cannot be done using the CONSTRAINT phrase? A. Create a single attribute primary key B. Define a foreign key C. Establish a referential integrity constraint D. All of the above can be done using the CONSTRAINT phrase E. None of the above
answer
D
question
Given the table STUDENT(StudentID, Name, Advisor), which of the following SQL statement would be used to add new student data to the STUDENT table? A. INSERT DATA STUDENT SET StudentID=123, Name='Jones', Advisor='Smith'; B. INSERT INTO STUDENT VALUES (123, 'Jones', 'Smith'); C. INSERT INTO STUDENT (New Student Data) VALUES (123, 'Jones', 'Smith'); D. INPUT DATA STUDENT SET StudentID=123, Name=' Jones', Advisor='Smith'; E. INPUT INTO STUDENT (123, 'Jones', 'Smith');
answer
B
question
The order of the columns returned by an SQL SELECT statement is determined by the: A. ORDER BY clause B. SORT BY clause C. order they are listed in following the SELECT D. order they are listed in following the WHERE E. order they are listed in following FROM
answer
C
question
Which SQL keyword is used to eliminate duplicate rows in the result of an SQL SELECT query? A. UNIQUE B. SORT C. ORDER BY D. DISTINCT E. REDUCE
answer
D
question
Which SQL keyword is used to specify a condition that rows must meet to be included in the result of an SQL SELECT query? A. SELECT B. FROM C. WHERE D. ORDER BY E. GROUP BY
answer
C
question
Conditions after the WHERE keyword require single quotes around values for columns that have which data type? A. Char B. VarChar C. Integer D. Numeric E. Both A and B
answer
E
question
Which of the following is the correct SQL clause to restrict the results of a SELECT query to only records that have a value in the range of 10 to 50 in the Hours column? A. WHERE Hours = MIN(10) and MAX(50) B. WHERE Hours IN [10, 50] C. WHERE Hours = 10 and Hours = 50 D. WHERE Hours BETWEEN 10 AND 50 E. WHERE Hours RANGE 10 TO 50
answer
D
question
Which symbol is used in standard SQL as a wildcard to represent a single, unspecified character? A) % (percent sign) B) ! (exclamation mark) C) _ (underscore) D) ? (question mark) E) ; (semi-colon)
answer
C
question
Which symbol is used in standard SQL as a wildcard to represent a series of one or more unspecified characters? A) % (percent sign) B) ! (exclamation mark) C) _ (underscore) D) ? (question mark) E) ; (semi-colon)
answer
A
question
Which SQL keyword can be used in conjunction with wildcards to select partial values? A) SELECT B) SEARCH C) FIND D) SUBSTRING E) LIKE
answer
E
question
Which of the following is the correct SQL clause to sort the results of a SELECT query in reverse-alphabetical order using the department field? A) SORT BY Department B) REVERSE Department C) ORDER BY Department DESC D) SORT BY Department DESC E) SORT BY Department REVERSE
answer
C
question
Which of the following is not one of the five SQL built-in functions? A) MODE B) SUM C) COUNT D) MAX E) AVG
answer
A
question
Given the table CUSTOMER(CustID, Name, PhoneNum, AcctBalance) what is the standard SQL query phrase to retrieve the Name and Phone Number of customers? A) SELECT CUSTOMER-Name AND CUSTOMER-PhoneNum B) SELECT (CUSTOMER-Name AND CUSTOMER-PhoneNum) C) SELECT Name, PhoneNum D) SELECT (Name, PhoneNum) E) SELECT *
answer
C
question
Given the table CUSTOMER(CustID, Name, PhoneNum, AcctBalance) what is the standard SQL query phrase to retrieve data for customers with an account balance greater than 50? A) WHERE CUSTOMER-AcctBalance > 50 B) WHERE (CUSTOMER-AcctBalance > 50) C) WHERE AcctBalance > 50 D) WHERE (AcctBalance > 50) E) HAVING AcctBalance > 50
answer
C
question
Which SQL keyword is used to apply conditions to restrict groups that appear in the results of a SELECT query that uses GROUP BY? A) WHERE B) HAVING C) LIKE D) SORT E) DISTINCT
answer
B
question
Given the tables STUDENT(StudentID, StudentName, AdvisorID) ADVISOR(AdvisorID, AdvisorName, Office, Phone) which of the following SQL statements would be used to implant a join between the two tables? A) WHERE STUDENT MATCH ADVISOR B) WHERE STUDENT.AdvisorID MATCH ADVISOR.AdvisorID C) WHERE STUDENT = ADVISOR D) WHERE STUDENT JOIN ADVISOR E) WHERE STUDENT JOIN ADVISOR ON STUDENT.AdvisorID = ADVISOR.AdvisorID
answer
E
question
Which type of join, although not included in standard SQL, was created to allow unmatched rows to appear in the result of a join operation? A) ODD JOIN B) OPEN JOIN C) OUTER JOIN D) INNER JOIN E) COMBINE JOIN
answer
C
question
Given the table STUDENT(StudentID, Name, Advisor), which of the following SQL statements would be used to change the value of the Advisor field to 'Smith' for all rows in the STUDENT table? A) UPDATE STUDENT SET Advisor = 'Smith'; B) MODIFY STUDENT SET Advisor = 'Smith'; C) MODIFY Advisor SET STUDENT = 'Smith'; D) UPDATE Advisor = 'Smith'; E) SET STUDENT Advisor = 'Smith';
answer
A
question
Which of the following SQL commands would be used to remove only the data from a table named STUDENT while leaving the table structure intact? A) DROP TABLE STUDENT; B) DELETE TABLE STUDENT; C) REMOVE TABLE STUDENT; D) SELECT * FROM STUDENT THEN DROP; E) DELETE FROM STUDENT;
answer
E
question
Which of the following SQL commands would be used to remove both the data and the table structure of a table named STUDENT? A) DROP TABLE STUDENT; B) DELETE TABLE STUDENT; C) REMOVE TABLE STUDENT; D) SELECT * FROM STUDENT THEN DROP; E) DELETE FROM STUDENT;
answer
A
question
Microsoft Access SQL commands are run in: A) the SQL window. B) the QBE window. C) the Query View of an SQL window. D) the Design View of a Query window. E) the SQL View of a Query window.
answer
E
question
To open a new Microsoft Access Query window: A) click the New button on the Home command tab. B) click the New Query button on the Home command tab. C) click the Create Query button on the Create command tab. D) click the New Query in Design view button on the Create command tab. E) click the Query Design button on the Command tab.
answer
E
question
In Microsoft Access, tables are added to a Query window by: A) selecting the tables from the Use Table dialog box. B) selecting the tables from the Show Table dialog box. C) selecting the tables from the Tables section of the Navigation Pane. D) selecting the tables from the Queries section of the Navigation Pane. E) selecting the tables from the Relationships window.
answer
B
question
Which of the following standard SQL data types is not supported in Microsoft Access SQL? A) Integer B) Char(25) C) VarChar(35) D) Numeric(5,3) E) DateTime
answer
D
question
In Microsoft Access, standard SQL table creation syntax items not supported by Access SQL can generally be implemented by: A) setting the Data Types in Access table Design View. B) setting the field properties in Access table Design View. C) setting the relationship properties in the Edit Relationship dialog box. D) setting the referential integrity properties in the Edit Relationship dialog box. E) running an ALTER TABLE query in Access SQL.
answer
B