hillford exam 2 chapter1

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/90

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

91 Terms

1
New cards

Only one of the queries does not change the database contents

True

2
New cards

Given the data in the Bank database, a select query for accounts with negative balances would return nothing.

TRue

3
New cards

The insert, select, update, and delete queries are the only types of commands necessary to interact with a database system.

False

4
New cards

An update query cannot update data that isn't in the database.

True

5
New cards

Account

ID Name Balance

831 Raul Lopez 3300

572Mai Shiraishi 2500

290 Ethan Carr 5000

What is Braden Smith's balance in the following INSERT statement?

INSERT INTO Account VALUES (800, 'Braden Smith', 200);

200

6
New cards

Account

ID Name Balance

831 Raul Lopez 3300

572Mai Shiraishi 2500

290 Ethan Carr 5000

Which name is retrieved by the following SELECT statement?

SELECT Name FROM Account WHERE Balance < 3000;

Mai Shiraishi

7
New cards

Whose balance does the following UPDATE statement change?

UPDATE Account

SET Balance = 850

WHERE ID = 290;

Raul Lopez

Mai Shiraishi

Ethan Carr

Ethan Carr

8
New cards

Whose balance does the following UPDATE statement change?

UPDATE Account

SET Balance = 850

WHERE ID = 290;

Who is deleted by the following DELETE statement?

DELETE FROM Account WHERE ID = 999;

No one

9
New cards

INT

integer values

10
New cards

DECIMAL

fractional numeric values.

11
New cards

VARCHAR

textual values

12
New cards

DATE

year, month, and day

13
New cards

The BirthDate column stores only a date and no time.

True

14
New cards

CountryCode Name Continent

ABW Aruba SouthAmerica

AFG Afghanistan Asia

AGO Angola Africa

ALB Albania Europe

AND Andorra Europe

SELECT Name

FROM Country

WHERE Continent IN ('Asia', 'Europe', 'North America');

No results

Afghanistan, Albania, Aruba

Afghanistan, Albania, Andorra

Afghanistan, Albania, Andorra

15
New cards

CountryCode Name Continent

ABW Aruba SouthAmerica

AFG Afghanistan Asia

AGO Angola Africa

ALB Albania Europe

AND Andorra Europe

SELECT Name FROM Country WHERE Code IN ('AGO', 'Aruba', 'Europe', NULL);

No results

Angola

Aruba

Angola

16
New cards

SELECT Name FROM Country WHERE Continent NOT IN ('Asia', 'Antarctica', 'Europe');

Aruba, Angola

17
New cards

The BETWEEN

operator provides an alternative way to determine if a value is between two other values

18
New cards

The expression Age BETWEEN 13 AND 19 is true when Age is 19.

TRUE

19
New cards

If the Name column has data type VARCHAR(20), then the expression Name BETWEEN 'Anele' AND 'Jose' is valid.

True

20
New cards

A query containing BETWEEN expression runs faster than a query containing an equivalent expression written with comparison operators.

False

21
New cards

LIKE

used in a WHERE clause, matches text against a pattern using the two wildcard characters % and _.

22
New cards

CountryLanguage

CountryCode Language IsOfficial Percentage

COK English F 0.0

COK Maori T 0.0

COL Arawakan F 0.1

COL Caribbean F 0.1

COL Chibcha F 0.4

Arawakan and Caribbean

LIKE '%r%n'

23
New cards

CountryLanguage

CountryCode Language IsOfficial Percentage

COK English F 0.0

COK Maori T 0.0

COL Arawakan F 0.1

COL Caribbean F 0.1

COL Chibcha F 0.4

Chibcha

LIKE %cha

24
New cards

CountryLanguage

CountryCode Language IsOfficial Percentage

COK English F 0.0

COK Maori T 0.0

COL Arawakan F 0.1

COL Caribbean F 0.1

COL Chibcha F 0.4

LIKE _cha

no matches

25
New cards

CountryLanguage

CountryCode Language IsOfficial Percentage

COK English F 0.0

COK Maori T 0.0

COL Arawakan F 0.1

COL Caribbean F 0.1

COL Chibcha F 0.4

LIKE %m_o%'

Maori

26
New cards

CountryLanguage

CountryCode Language IsOfficial Percentage

COK English F 0.0

COK Maori T 0.0

COL Arawakan F 0.1

COL Caribbean F 0.1

COL Chibcha F 0.4

LIKE BINARY '%E%'

English

27
New cards

SELECT Name, District, Population FROM City

City

ID Name CountryCode District Population

301EmbuBRASão Paulo2222233

02MossoróBRARio Grande do Norte214901

303VárzeaGrandeBRAMatoGrosso214435

304PetrolinaBRAPernambuco210540

305BarueriBRASão Paulo208426

Embu São Paulo 222223 Barueri São Paulo 208426 Mossoró Rio Grande do Norte 214901 Petrolina Pernambuco 210540 Várzea Grande Mato Grosso 214435

)RDER BY District DESC

28
New cards

Várzea Grande Mato Grosso 214435 Petrolina Pernambuco 210540 Mossoró Rio Grande do Norte 214901 Barueri São Paulo 208426 Embu São Paulo 222223

ORDER BY District, Population

29
New cards

Data Definition Language

CREATE TABLE City ( ID INTEGER, Name VARCHAR(15), Population INTEGER );

Data Definition Statements

30
New cards

Data Query Language

SELECT Name

FROM City

WHERE Population > 15000;

31
New cards

Data Manipulation Language

inserts, updates, and deletes data.

32
New cards

Data Transaction Language

manages transactions.

33
New cards

Data Control Language

specifies user access to data

34
New cards

DML

Insert a data row into table product.

35
New cards

DCL

Grant all permissions to user 'tester'.

36
New cards

DTL

Rollback database changes.

37
New cards

DDL

Create table Product.

38
New cards

DQL

Select all rows from table Product.

39
New cards

The INSERT statement adds a student to the Student table. How many clauses are in the INSERT statement?

INSERT INTO Student VALUES (888, 'Smith', 'Jim', 3.0);

2 The INSERT INTO clause is followed by the VALUES clause.

40
New cards

The SQL statement below is used to select students with the last name "Smith". What is wrong with the statement?

SELECT FirstName FROM Student WHERE LastName = Smith;

The literal "Smith" must be surrounded by single quotes or double quotes.

41
New cards

What is wrong with the SQL statement below?

SELECT FirstName

from Student

A terminating semicolon is missing.

42
New cards

Refer to the following simplified definition of SELECT syntax:

SELECT select_expr [, select_expr] ...

[FROM table_references]

[WHERE where_condition]

[ORDER BY {col_name | expr | position}]

select_expr is an expression that appears in a SELECT clause, and may not be blank.

1)

SELECT FROM City; is a valid statement.

False

43
New cards

Refer to the following simplified definition of SELECT syntax:

SELECT select_expr [, select_expr] ...

[FROM table_references]

[WHERE where_condition]

[ORDER BY {col_name | expr | position}]

select_expr is an expression that appears in a SELECT clause, and may not be blank.

SELECT 'Hello'; is a valid statement.

True

44
New cards

Refer to the following simplified definition of SELECT syntax:

SELECT select_expr [, select_expr] ...

[FROM table_references]

[WHERE where_condition]

[ORDER BY {col_name | expr | position}]

select_expr is an expression that appears in a SELECT clause, and may not be blank.

)

The FROM clause must contain table names only.

False

45
New cards

Refer to the following simplified definition of SELECT syntax:

SELECT select_expr [, select_expr] ...

[FROM table_references]

[WHERE where_condition]

[ORDER BY {col_name | expr | position}]

select_expr is an expression that appears in a SELECT clause, and may not be blank.

)

The ORDER BY keyword must be followed by a column name.

False

46
New cards

SQL/PSM

Extends SQL with programming elements such as loops and procedures.

47
New cards

Foundation

Covers DDL, DQL, DML, DCL, and DTL.

48
New cards

SQL/Schemata

Defines the information_schema database.

49
New cards

SQL/XML

Specifies the XML data type and related functions.

50
New cards

Framework

Introduces SQL concepts and terminology.

51
New cards

The statement CREATE DATABASE auto; creates a database called 'auto'.

True

52
New cards

The statement CREATE DATABASE university; creates a second university database.

False The university database already exists. Each database is uniquely named, so two databases named 'university' cannot exist.

53
New cards

The statement DROP DATABASE university; deletes the university database and all associated tables.

True

54
New cards

The statement DROP DATABASE nonprofit; deletes the nonprofit database.

non profit not exsit

55
New cards

SHOW DATABASES

lists all databases in the database system instance

56
New cards

SHOW TABLES

lists all tables in the default database. The optional clause FROM DatabaseName lists tables in a named database

57
New cards

SHOW COLUMNS FROM TableName

lists all columns in the TableName table of the default database.

58
New cards

SHOW CREATE TABLE TableName

shows the CREATE TABLE statement for the TableName table of the default database

59
New cards

Which statement shows all databases in a database system?

SHOW DATABASES;

60
New cards

Which statement must precede a SHOW TABLES statement to see the tables from the bikeStore database?

SHOW DATABASES;

USE bikeStore;

SHOW COLUMNS FROM bikeStore;

USE bikeStore;

61
New cards

Which statement shows all the columns in the Country table?

SHOW COLUMNS;

SHOW COLUMNS Country;

SHOW COLUMNS FROM Country;

SHOW COLUMNS FROM Country;

62
New cards

What are the components of a column?

Name and data type

63
New cards

Must a table have at least one row?

No

64
New cards

How does a database administrator specify column names and data types?

With the SQL language

65
New cards

_____ may appear in each cell.

Any number of values

Exactly one value

No values or one value

Exactly one value

66
New cards

here are duplicate column names allowed?

Within a single table.

In different tables.

Never.

In different tables.

67
New cards

What does the principle of data independence state?

The result of a database query is not affected by the physical organization of data on storage devices.

68
New cards

How can driver's license information be added to the Employee table?

By creating another column with a new name, such as ID2 or DriverLicense.

69
New cards

The statement DROP Employee; deletes the Employee table.

False since the keyword TABLE must appear after DROP: DROP TABLE Employee;

70
New cards

The DROP TABLE statement does not delete the table unless the table is empty.

False

71
New cards

ALTER TABLE

adds, deletes, or modifies columns on an existing table

72
New cards

dd a column called Description to the Department table.

ALTER TABLE Department

_______VARCHAR(50);

ADD Description

73
New cards

Rename column Description to ShortDesc.

ALTER TABLE Department

_______VARCHAR(50);

CHANGE Description ShortDesc

74
New cards

Change column ShortDesc to accept up to 80 characters.

ALTER TABLE Department

CHANGE_______

ShortDesc ShortDesc VARCHAR(80)

75
New cards

Delete the column ShortDesc.

ALTER______

TABLE Department

DROP ShortDesc

76
New cards

Using materialized views always improves database performance.

False

77
New cards

The performance of a query on a non-materialized view is identical to the performance of the corresponding merged query on base tables.

True

78
New cards

A view query can reference another view table.

True

79
New cards

In MySQL, two different queries that generate the same result table always have the same execution time.

False

80
New cards

Views can be used to hide rows as well as columns from database users.

True

81
New cards

Select

sigma

82
New cards

Project

II

83
New cards

Product

X

84
New cards

Join

multiplication symbol with vertical bars

85
New cards

Rename

p

86
New cards

Aggregate

gamma

87
New cards

Changing the order of operations can alter the result of an expression

True

88
New cards

Exactly one query execution plan is possible for each SQL query.

False

89
New cards

Query optimizers typically choose an optimal expression based on total number of rows processed.

False

90
New cards

The join operation is a low-level database action.

False

91
New cards

do 8.8 and keep on