Section 1

Preview this deck

51)One way to specify all of the columns of a table is to use the special character * after the keyword ________.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

5 years ago

Date created

Mar 1, 2020

Cards (60)

Section 1

(50 cards)

51)One way to specify all of the columns of a table is to use the special character * after the keyword ________.

Front

51)SELECT

Back

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'.

Front

62) SELECT Name, PhoneNum FROM CUSTOMER WHERE Name LIKE 'S%';

Back

52)Conditions after the ________ require quotes around values for Char and VarChar columns, but no quotes for Integer and Numeric columns.

Front

52)WHERE

Back

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.

Front

8)FALSE

Back

18)A subquery is appropriate if the final result contains only data from a single table.

Front

18)TRUE

Back

5)For a column to be defined as the primary key using table constraints, the column must have been given the property NULL.

Front

5)FALSE

Back

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) _______

Front

B)DROP TABLE STUDENT;

Back

11)In SQL, the WHERE clause is used to specify which columns will be included in the result.

Front

11)FALSE

Back

33)Conditions after the WHERE keyword require single quotes around the value for columns that have which data type? 33) _______

Front

E)both A and B A)Integer B)VarChar

Back

31)Which SQL keyword is used to eliminate duplicate rows in the results of a SQL SELECT query? 31) _______

Front

D)DISTINCT

Back

53)Multiple tables can be queried using either subqueries or ________.

Front

53)joins

Back

35)Which symbol is used in standard SQL as a wildcard to represent a single, unspecified character? 35) _______

Front

A)_ (underscore)

Back

7)Referential integrity constraints can be created using the ON DELETE phrase when the table is created using the CREATE TABLE statement.

Front

7)TRUE

Back

28)Which of the following cannot be done using the CONSTRAINT phrase?

Front

D)All of A, B and C can be done using the CONSTRAINT phrase

Back

17)Data from a maximum of three tables can be combined through the use of subqueries in SQL.

Front

17)FALSE

Back

49)A data type ________ would indicate a variable-length character with maximum length 75.

Front

49)VarChar(75)

Back

4)When using SQL to create a table, specifying a data type of Char(10) indicates a fixed length field of 10 characters.

Front

4) TRUE

Back

25)Which of the following is not a standard data type used in SQL? 25) _______

Front

B)text

Back

12)In SQL, to refer to a range in a WHERE clause, use the WITHIN keyword.

Front

12)FALSE

Back

10)To force the DBMS to remove duplicate rows from the results of a SQL SELECT query, the keyword DISTINCT must be used.

Front

10)TRUE

Back

9)The result for SELECT statements in SQL is a relation unless the result is a single number.

Front

9)FALSE

Back

26)Which of the following is not true about primary keys? 26) _______

Front

D)Primary keys must be a single attribute.

Back

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.

Front

3) False

Back

60)Explain the two methods for defining a primary key using SQL.

Front

60)A primary key may be defined by either the CREATE TABLE column description method or the CONSTRAINT phrase method. To create a primary key using the CREATE TABLE column description method, the primary key must be a single attribute. For the primary key attribute, the column property is specified to be PRIMARY KEY. There can be only one attribute specified as PRIMARY KEY with the CREATE TABLE column description method. This means that the creation of a composite key requires the use of the CONSTRAINT phrase method. Defining a primary key using the CONSTRAINT phrase requires that the column(s) that will serve as the primary key must have been defined as NOT NULL. Using the CONSTRAINT phrase method, the primary key is defined by adding a constraint to the table using a CONSTRAINT phrase after the table columns have been defined. The CONSTRAINT phrase names the column(s) that will be the table's primary key. The structure of the CONSTRAINT phrase is: CONSTRAINT constraintname PRIMARY KEY (column names)

Back

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.

Front

Update

Back

50)A data type ________ means that values consist of seven decimal numbers with two numbers assumed to the right of the decimal point.

Front

50)Numeric(7,2)

Back

14)In SQL, the order of the rows that result from a SELECT statement can be set using the SORT BY phrase.

Front

14)FALSE

Back

20)Using standard SQL, unmatched rows will not appear in the result of a join.

Front

20)TRUE

Back

30)The order of the columns returned by a SQL SELECT statement are determined by the: 30) _______

Front

E)order they are listed in following SELECT.

Back

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.

Front

6)TRUE

Back

36)Which symbol is used in standard SQL as a wildcard to represent a series of one or more unspecified characters? 36) _______

Front

C)% (percent sign)

Back

24)Which of the following data types used in SQL would define a numeric field of the pattern 99.99? 24) _______

Front

B)numeric(4,2)

Back

27)A composite primary key can be defined using the CONSTRAINT phrase in which SQL command? 27) _______

Front

D)CREATE TABLE

Back

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) _______

Front

E)WHERE Hours BETWEEN 10 AND 50

Back

22)The ON DELETE CASCADE referential integrity constraint does not apply when rows are deleted using the SQL DELETE command.

Front

22)FALSE

Back

19)The basic idea of a join is to combine the contents of two or more relations into a new relation.

Front

19)TRUE

Back

47)SQL was developed by the ________ in the late 1970s.

Front

47)IBM Corporation

Back

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.

Front

2) False

Back

48)The keyword(s) ________ means that a value must be supplied before a new row can be created.

Front

48)NOT NULL

Back

16)Standard SQL does not allow built-in functions to be used in a WHERE clause.

Front

16)TRUE

Back

21)Values of existing data can be changed using SQL through the CHANGE command.

Front

21)FALSE

Back

1)SQL is a data sublanguage, not a complete programming language.

Front

1) True

Back

23)Which of the following data types used in SQL would define a fixed-length text field of 10 characters? 23) _______

Front

B)char(10)

Back

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) _______

Front

B)WHERE

Back

)What are SQL built-in functions?

Front

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.

Back

15)The SUM built-in function in SQL is used to total the values in a numeric column.

Front

15)TRUE

Back

49)A data type ________ would indicate a variable-length character with maximum length 75.

Front

49)VarChar(75)

Back

13)In SQL, the LIKE keyword can be used to select partial values.

Front

13)TRUE

Back

54)When using SQL, there are three data modification operations: ________, ________,and ________.

Front

54)INSERT; MODIFY; DELETE

Back

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.

Front

61) SELECT Name, PhoneNum FROM CUSTOMER WHERE AcctBalance > 50;

Back

Section 2

(10 cards)

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? 38) _______

Front

E)ORDER BY Department DESC

Back

37)Which SQL keyword can be used in conjunction with wildcards to select partial values? 37) _______

Front

C)LIKE

Back

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? 41) _______

Front

E)WHERE AcctBalance > 50

Back

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? 43) _______

Front

D)OUTER JOIN

Back

46)_ Structured Query Language , or SQL, is not a complete programming language, but is rather a ________.

Front

Structured Query Language; data sublanguage

Back

39)Which of the following is not one of the five SQL built-in functions? 39) _______

Front

A)MODE

Back

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? 42) _______

Front

B)HAVING

Back

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? 44) _______

Front

A)INSERT INTO STUDENT (New Student Data) VALUES (123,'Jones','Smith');

Back

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? 45) _______

Front

B)UPDATE STUDENT SET Advisor = 'Smith';

Back

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? 40) _______

Front

B)SELECT Name, PhoneNum

Back