Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/59

Click to flip

59 Cards in this Set

  • Front
  • Back
1) SQL is a data sublanguage, not a complete programming language.
True
2)When using SQL to create a table, a column is defined by declaring, in the following order, the items: data type, column name, and properties.
False
3) 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.
False
4)When using SQL to create a table, specifying a data type of Char(10) indicates a fixed length field of 10 characters.
True
5)For a column to be defined as the primary key using table constraints, the column must have been given the property NULL.
false
6)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.
True
7)Referential integrity constraints can be created using the ON DELETE phrase when the table is created using the CREATE TABLE statement.
True
8)Referential integrity constraints using the ON DELETE NO ACTION phrase must be explicitly stated when the table is created using the CREATE TABLE statement.
false
9)The result for SELECT statements in SQL is a relation unless the result is a single number.
False
10)To force the DBMS to remove duplicate rows from the results of a SQL SELECT query, the keyword DISTINCT must be used.
True
11)In SQL, the WHERE clause is used to specify which columns will be included in the result.
false
12)In SQL, to refer to a range in a WHERE clause, use the WITHIN keyword.
false
13)In SQL, the LIKE keyword can be used to select partial values.
True
14)In SQL, the order of the rows that result from a SELECT statement can be set using the SORT BY phrase.
False
15)The SUM built-in function in SQL is used to total the values in a numeric column.
True
16)Standard SQL does not allow built-in functions to be used in a WHERE clause.
True
17)Data from a maximum of three tables can be combined through the use of subqueries in SQL.
false
18)A subquery is appropriate if the final result contains only data from a single table.
True
19)The basic idea of a join is to combine the contents of two or more relations into a new relation.
True
20)Using standard SQL, unmatched rows will not appear in the result of a join.
true
21)Values of existing data can be changed using SQL through the CHANGE command.
False
22)The ON DELETE CASCADE referential integrity constraint does not apply when rows are deleted using the SQL DELETE command.
false
23)Which of the following data types used in SQL would define a fixed-length text field of 10 characters? 23) _______
B)char(10)
24)Which of the following data types used in SQL would define a numeric field of the pattern 99.99? 24) _______
B)numeric(4,2)
25)Which of the following is not a standard data type used in SQL? 25)
B)text
26)Which of the following is not true about primary keys? 26) _______
D)Primary keys must be a single attribute.
27)A composite primary key can be defined using the CONSTRAINT phrase in which SQL command? 27) _______
D)CREATE TABLE
28)Which of the following cannot be done using the CONSTRAINT phrase? 28)
D)All of A, B and C can be done using the CONSTRAINT phrase.
29)Which of the following SQL commands would be used to remove both the data and the table structure of a table named STUDENT? 29) _______
B)DROP TABLE STUDENT;
30)The order of the columns returned by a SQL SELECT statement are determined by the: 30) _______
E)order they are listed in following SELECT.
31)Which SQL keyword is used to eliminate duplicate rows in the results of a SQL SELECT query? 31) _______
D)DISTINCT
32)Which SQL keyword is used to specify a condition that rows must meet to be included in the results of an SQL SELECT query? 32) _______
B)WHERE
33)Conditions after the WHERE keyword require single quotes around the value for columns that have which data type? 33) _______
A)Integer
B)VarChar
34)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? 34) _______
E) WHERE Hours BETWEEN 10 AND 50
35)Which symbol is used in standard SQL as a wildcard to represent a single, unspecified character? 35) _______
A)_ (underscore)
36)Which symbol is used in standard SQL as a wildcard to represent a series of one or more unspecified characters? 36) _______
C)% (percent sign)
37)Which SQL keyword can be used in conjunction with wildcards to select partial values? 37) _______
C) LIKE
38)Which of the following is the correct SQL clause to sort the results of a SELECT query in reverse-alphabetic order using the Department field?
E)ORDER BY Department DESC
39)Which of the following is not one of the five SQL built-in functions?
A) MODE
40) Given the table CUSTOMER(CustID, Name, PhoneNum, AcctBalance), what is the standard SQL query phrase to retrieve the Name and Phone Number of customers?
B) SELECT Name, PhoneNum
41)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?
E)WHERE AcctBalance > 50
42)Which SQL keyword is used to apply conditions to restrict groups that appear in the results of a SELECT query that uses GROUP BY?
B)HAVING
43)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?
D) OUTER JOIN
44)Given the table STUDENT(StudentID, Name, Advisor), which of the following SQL statements would be used to add new student data to the STUDENT table?
A) INSERT INTO STUDENT (New Student Data) VALUES (123,'Jones','Smith');
45)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?
B)UPDATE STUDENT SET Advisor = 'Smith';
46)_ Structured Query Language , or SQL, is not a complete programming language, but is rather a ________.
Structured Query Language; data sublanguage
47)SQL was developed by the ________ in the late 1970s.
IBM Corporation
48)The keyword(s) ________ means that a value must be supplied before a new row can be created
48)NOT NULL
49)A data type ________ would indicate a variable-length character with maximum length 75.
49)VarChar(75)
50)A data type ________ means that values consist of seven decimal numbers with two numbers assumed to the right of the decimal point
50)Numeric(7,2)
51)One way to specify all of the columns of a table is to use the special character * after the keyword ________.
51)SELECT
52)Conditions after the ________ require quotes around values for Char and VarChar columns, but no quotes for Integer and Numeric columns.
52)WHERE
53)Multiple tables can be queried using either subqueries or ________.
53)joins
54)When using SQL, there are three data modification operations: ________, ________,and ________.
54)INSERT; MODIFY; DELETE
55)The values of existing data can be modified using the powerful SQL ________ command, which can be used to change several column values at once.
55)UPDATE
61)Given the table CUSTOMER(CustID, Name, PhoneNum, AcctBalance), write the standard SQL query to retrieve the Name and Phone Number of customers with a balance greater than 50.
61) SELECT Name, PhoneNum
FROM CUSTOMER
WHERE AcctBalance > 50;
62)Given the table CUSTOMER(CustID, Name, PhoneNum, AcctBalance), write the standard SQL query to retrieve the Name and Phone Number of customers whose name begins with 'S'.
62) SELECT Name, PhoneNum
FROM CUSTOMER
WHERE Name LIKE 'S%';
63)What are SQL built-in functions?
63)SQL built-in functions manipulate the results of a SQL SELECT statement. The built-in functions for standard SQL are COUNT, SUM, AVG, MAX, and MIN. The COUNT function counts the number of rows in the result. The SUM function totals the values in a number-oriented field. The AVG function calculates the mean of the values in a number-oriented field. The MAX function determines the highest value, and the MIN function determines the lowest value, in a number-oriented field.
64)Distinguish between the HAVING clause and the WHERE clause.
64)The HAVING clause and the WHERE clause differ in that the WHERE clause is used to identify rows that satisfy a stated condition. The HAVING clause is used to identify groups,