CTS 2433 Exam 1

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/167

flashcard set

Earn XP

Description and Tags

Chapter's 1, 2 and 3

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

168 Terms

1
New cards

What design consideration would apply to a database that has special performance requirements?

Structuring data properly on storage media.

2
New cards

A user creates a table by using a SQL statement. The data type VARCHAR(11) is part of the statement. What does the value of (11) represent?

The number of characters allowed for the data type.

3
New cards

Which concept relates to software that reads and writes data in a database?

Management system

4
New cards

What links a host programming language to a database system?

API

5
New cards

A database management system reads and writes data in a database, and _____.

ensures consistency and availability

6
New cards

The analysis phase of database design includes which process?

Specifying requirements that are not dependent on a specific database system.

7
New cards

A database administrator creates a MySQL statement with incorrect syntax. What does MySQL Workbench display when the statement is executed?

Error code

8
New cards

When using the MySQL Command-Line Client, which character ends a command?

;

9
New cards

Which role focuses on creating software that interacts with a database?

Programmer

10
New cards

A database administrator uses which two SQL statements to view and then modify existing customer balances with a late fee?

SELECT, UPDATE

11
New cards

Which type of database system is optimized for big data?

NoSQL

12
New cards

When a user interacts with a database, they can use a _____ to modify data with commands.

query language

13
New cards

Which principle defines data independence?

Physical design never affects query results.

14
New cards

A database designer installs MySQL Community Edition to create a database. Which account does the designer use to gain full control of MySQL?

Root

15
New cards

If a database system is processing three queries as part of a transaction and the third query fails, what happens to the transaction?

The successful query results are reversed, and the transaction is canceled.

16
New cards

A column, or group of columns, that serves as the unique identifier in a relational database table is called a/an _____.

primary key

17
New cards

A _____ constraint specifies a column value that is used when no value is provided in an INSERT statement.

DEFAULT

18
New cards

Choose the best data types to replace XXX and YYY.

CREATE TABLE Product ( ProductId INT, ProductName XXX, UnitPrice YYY );

VARCHAR(50), DECIMAL(8, 2)

19
New cards

Which statement creates a primary key constraint on the ID column of the Employee table?

ALTER TABLE Employee ADD PRIMARY KEY (ID);

20
New cards

What foreign key action should be added to ensure that if a supplier is removed from the Supplier table, the products associated with the same supplier are also removed?

CREATE TABLE Product ( ProductId INT NOT NULL AUTO_INCREMENT, ProductName VARCHAR(50), UnitPrice DECIMAL(5,2), SupplierId INT, PRIMARY KEY (ProductId), FOREIGN KEY (SupplierId) REFERENCES Supplier(SupplierId) _____ );

ON DELETE CASCADE

21
New cards

In the following statement, the UNIQUE clause is a _____ constraint.

CREATE TABLE Employee ( ID SMALLINT UNSIGNED, FullName VARCHAR(60), Extension CHAR(4), UNIQUE (ID, Extension), PRIMARY KEY (ID) );

table

22
New cards

Refer to the Teacher and Class tables. The action ON UPDATE SET NULL is specified for the TeacherID foreign key. What is the result when Bryan McNeal's TeacherID is changed to 45672?

The TeacherID for Web Development is set to NULL.

23
New cards

Which language defines statements used for creating and dropping tables?

Data Definition Language

24
New cards

How many columns are created by the SQL statement below?

CREATE TABLE Supplier ( SupplierId INT, CompanyName VARCHAR(40), ContactName VARCHAR(50), City VARCHAR(40), Country VARCHAR(40), Phone VARCHAR(30) );

6

25
New cards

What is the result of a relational operation?

table

26
New cards

A database system has a database called onlineShop. What is the result of a CREATE statement that tries to create onlineShop a second time?

The statement produces an error that indicates the database already exists.

27
New cards

In MySQL, what is the result of TRUE AND NULL?

NULL

28
New cards

Which of the following is not true about the INSERT statement?

A single INSERT statement can only add one row.

29
New cards

ShipPartCode is a foreign key in the Shipment table. ShipPartCode refers to the primary key PartCode of the Part table. What replaces XXX in the following statement?

CREATE TABLE Shipment ( ShipNumber INT UNSIGNED, ShipPartCode CHAR(3) NOT NULL, Quantity SMALLINT UNSIGNED, PRIMARY KEY (ShipNumber), XXX );

FOREIGN KEY (ShipPartCode) REFERENCES Part (PartCode)

30
New cards

The statement below is an example from which SQL sublanguage?

SELECT ProductName FROM Product;

Data Query Language

31
New cards

Refer to the Employee table:

How many rows are in the table defined by the following relational algebra expression?

σ(Salary > 50000)(ρ(Department,Salary)( DepartmentγSUM(Salary)(Employee)))

2

32
New cards

The following table lists parts. Many parts are contained in another part, called an assembly, and tracked in the AssemblyID column. If a part is not contained in another part, the AssemblyID is NULL.

CREATE TABLE Part ( PartID SMALLINT, PartName VARCHAR(30), AssemblyID SMALLINT, PRIMARY KEY (PartID), FOREIGN KEY (AssemblyID) REFERENCES Part(PartID) );

The following self-join selects one row for each part. Each row contains the names of the part and the assembly, if any, containing the part. What XXX completes the query?

SELECT P.PartName AS Part, A.PartName AS Assembly FROM Part P XXX;

LEFT JOIN Part A ON P.AssemblyID = A.PartID

33
New cards

What does the following statement return?

SELECT ROUND(12.439, 1);

12

34
New cards

When a database stores view data, it uses a _____ that depends on data in a corresponding _____.

materialized view, base table

35
New cards

In the relational algebra, compatible tables have the same _____.

number of columns and data types

36
New cards

Which statement is NOT an advantage of using a view table?

The creation of a new base table is always up to date.

37
New cards

Refer to the tables. Which products are returned by the query below?

SELECT ProductName FROM Product P WHERE NOT EXISTS (SELECT * FROM Sales WHERE ProductID = P.ProductID);

(It's asking to find what isn't currently in the Sales table PRODUCTID.)

Romper, Pajama set

38
New cards

What does the following statement return?

​​SELECT DATEDIFF('2020-11-04', '2020-11-09');

-5

39
New cards

Refer to the Product table. Which products are selected by the query below?

SELECT ProductName FROM Product WHERE Quantity > (SELECT MIN(Quantity) FROM Product);

Onesies set, Sunsuit, Pajama set, Shorts set

40
New cards

Complete the ORDER BY clause to sort the Products by ProductName alphabetically, then in decreasing Quantity.

SELECT ProductName, Size, Quantity, SupplierId FROM Product ORDER BY _____ ;

ProductName, Quantity DESC

41
New cards

What does the following statement return?

SELECT SUBSTRING('Excellent', 3, 4);

cell

42
New cards

Refer to the tables. Which products are selected by the query below?

SELECT ProductName FROM Product WHERE SupplierID IN (SELECT SupplierID FROM Supplier WHERE CountryID = 2);

Onesies set, Sunsuit, Romper

43
New cards

Refer to the Customer table. Which query returns the result table below?

SELECT State, COUNT() FROM Customer GROUP BY State HAVING COUNT() > 1;

44
New cards

In the SQL query below, the Teacher table is the _____.

SELECT LastName, FirstName, CourseTitle FROM Teacher INNER JOIN Class ON Teacher.TeacherID = Class.TeacherID;

Left table

45
New cards

Refer to the tables. What should be added to the SELECT caluse to produce the result table below?

SELECT _____ AS TotalSales FROM Sales S INNER JOIN Product P ON S.ProductId = P.ProductId;

SUM(P.UnitPrice * S.Quantity)

46
New cards

When data is produced and stored as numeric, textual, or visual information, it varies in _____.

Format

47
New cards

What does a user that interacts with a database use to read and write data?

Query Language

48
New cards

Which role focuses on creating software that interacts with a database?

Programmer

49
New cards

Which database role focuses on database storage, response times, and optimization?

Designer

50
New cards

Which concept relates to software that reads and writes data in a database?

Management System

51
New cards

A database management system reads and writes data in a database, and ________.

ensures consistency and availability

52
New cards

If a database system is processing three queries as part of a transaction and the third query fails, what happens to the transaction?

The successful query results are reverse and the transaction is canceled

53
New cards

How does a database system protect data when concurrent transactions occur?

preventing multiple transactions with the same data at the same time

54
New cards

In terms of database architecture, which component translates the query processor instructions into low-level file-system commands and is responsible for indexing the data?

Storage manager

55
New cards

Which type of database system is optimized for big data?

NoSQL

56
New cards

When a user interacts with a database, they can use a _____ to modify data with commands.

Query Language

57
New cards

The _______ SQL statement does not alter any database data.

SELECT

58
New cards

When using a SQL statement to create a table, which data type is used to store a fractional value?

DECIMAL

59
New cards

A database administrator uses which two SQL statements to view and modify existing customer balance with a late fee?

SELECT, UPDATE

60
New cards

A user creates a table by using a SQL statement. The data type VARCHAR(11) is part of the statement. What does the value of (11) represent?

The number of characters allowed for the data type

61
New cards

The analysis phase of database design includes which process?

Specifying requirements that are not dependent on a specific database system.

62
New cards

A database ______ is the implementation of database requirements in SQL with CREATE TABLE statements.

schema

63
New cards

Which principle defines data independence?

Physical design never affects query results.

64
New cards

What links a host programming language to a database system?

API

65
New cards

In the following ER diagram, what does 'AlbumTitle' represent?

Attribute

66
New cards

A database designer installs MySQL Communicty Edition to create a database. Which account does the designer use to gain full control of MySQL?

Root

67
New cards

When using the MySQL Workbench GUI, which icon will execute an SQL statement?

Lightning Bolt

68
New cards

When using the MySQL Command-Line Client, which character ends a command line?

;

69
New cards

Which option is found on the Schemas tab in the MySQL Workbench?

A list of available datbaases

70
New cards

A database administrator creates a MySQL statement with incorrect syntax. What does MySQL Workbench display when the statement is executed?

Error Code

71
New cards

In the relational model, an unnamed tuple of values is a ______.

row

72
New cards

What is the result of a relational operation?

Table

73
New cards

In a relational model, a column is _______.

A name and a data type

74
New cards

A ______ is a collection of values with no inherent order.

set

75
New cards

_____ is not a relational algebra operation

Merge

76
New cards

What does SQL stand for?

Structured Query Language

77
New cards

UPDATE, SELECT, and ORDER BY are ____ in an SQL Statement

keyword

78
New cards

In the SQL below, which of the following is an identifier?

UPDATE Product

SET UnitPrice = 9.50

WHERE ProductId = 20;

Product

79
New cards

What language defines statements used for creating and dropping tables?

Data definition language

80
New cards

The statement below is an example from which SQL sublanguage?

SELECT ProductName

FROM Product;

Data Query Language

81
New cards

What is the correct statement for creating a database called reservationDB?

CREATE DATABASE reservationDB;

82
New cards

A database system has a database called onlineShop. What is the result of a CREATE statement that tries to create onlineShop a second time.

The statement produces an error that indicates the database already exists.

83
New cards

What is the correct statement for deleting a database?

DROP DATABASE DatabaseName;

84
New cards

What should be added to the SQL statements to produce the Result table below?

USE ______;

SHOW _________;

Result:

Tables_in_onlineShop

blah

blah

blah

blah

onlineShop

TABLES

85
New cards

In a table, columns are _____ and rows are ______.

ordered

not ordered

86
New cards

Data independence means

rows of a table have no inherent order

87
New cards

How many columns are created by the SQL statement below?

CREATE TABLE Supplier (

SupplierId INT,

CompanyName VARCHAR(40),

ContactName VARCHAR(50),

City VARCHAR(40),

Country VARCHAR(40),

Phone VARCHAR(30)

);

6

88
New cards

Which SQL statement deletes the table supplier?

DROP TABLE Supplier;

89
New cards

Which SQL statement adds a new column Fax to the Supplier table?

ALTER TABLE Supplier

ADD Fax VARCHAR(30);

90
New cards

Which SQL Statement deletes the City column from the Supplier table?

ALTER TABLE Supplier

DROP City;

91
New cards

What data type stores binary values?

BLOB

92
New cards

Which data type should a database use to store negative numbers?

INT

93
New cards

Choose the best data types to replace XXX and YYY.

CREATE TABLE Product (

ProductId INT,

ProductName XXX,

UnitPrice YYY

);

VARCHAR(50)

DECIMAL(8,2)

94
New cards

A value that is used in a computation is known as a/an ______.

operand

95
New cards

What is the correct order of operator precedence in SQL (high to low)?

* + = NOT AND OR

96
New cards

Which statement selects all rows and just the ProductName and Size columns from the Product table?

SELECT ProductName, Size

FROM Product;

97
New cards

Refer to the product table. Which columns are preset in the query's result table?

SELECT * FROM Product;

all columns are present

98
New cards

Refer to the product table. Which columns are preset in the query's result table?

SELECT ProductName FROM Product WHERE Quantity >= 10;

onesies set, sunsuit, pj set

99
New cards

Refer to the Product table. Which products are selected by the query below?

SELECT * FROM Product WHERE Quantity > 5 AND UnitPrice <= 15.00;

onsies set, pj set, shorts set

100
New cards

In mySQL what is the result of TRUE AND NULL?

NULL