Grad dbms final

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

1/113

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.

114 Terms

1
New cards

Which one is NOT true?

  • DECIMAL data type is used to store a fractional value.

  • Auto-increment is usually applied to primary key columns.

  • In MySQL command line, semicolon (;) is used for ending a command

  • Delete cascade is an example of a relational rule

  • Delete cascade is an example of a relational rule

2
New cards

when a user interacts with a database, they can use a _______ to modify data with commands

Query Language

3
New cards

database _______ role focuses on database storage, response times, and optimization

designer

4
New cards

_______ links a host programming language to a database system

API

5
New cards

Please briefly explain five functional components that consist of any Database systems. 

query processor

storage manager

transaction manager

log

catalog

6
New cards

Which one is NOT true?

  • The statement DROP table Employee; deletes the Employee table regardless of records existing in the table

  • SQL database system is optimized for big data.

  • CHAR(1) is good for storing a student's assigned letter grade, like A or C.

  • The VARCHAR data type represents a variable string of characters.

  • SQL database system is optimized for big data.

7
New cards

Which is Not True about the functions of transaction management? 

  • Once a transaction completes, transaction results must always be saved on storage media, regardless of application or computer failures.

  • When concurrent transactions occur, DBMS will prevent multiple transactions with the same data at the same time

  • In MySQL, database programmer must put start transaction and commit commands manually to save each statement's result into DB storage.

  • If a database system is processing three queries as part of a transaction and the third query fails, the successful query results are reversed, and the transaction is canceled.

  • In MySQL, database programmer must put start transaction and commit commands manually to save each statement's result into DB storage.

8
New cards

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

  • RETRIEVE, UPDATE

  • SELECT, INSERT

  • RETRIEVE, INSERT

  • SELECT, UPDATE

SELECT, UPDATE

9
New cards

Which principle defines data independence?

 

  • Modification of indexes generates different results.

  • Tuning query performance requires application modifications.

  • Logical design maintains schema integrity.

  • Physical design never affects query results.

Physical design never affects query results.

10
New cards

In the following ER diagram, which is Not True?

  • Fname is an attribute which will be implemented as a record

  • ID in Album entity will become a primary key of Album table.

  • Records is a relationship which can be implemented as a foreign key located at Album table (assuming one to many relationship)

  • Artist is an entity and will be implemented as Artist table.

Fname is an attribute which will be implemented as a record

11
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 creates a copy of the database onlineShop as onlineShop_1.

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

  • The statement replaces onlineShop with a new onlineShop database.

  • The statement is ignored.

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

12
New cards

Which is Not True?

 

  • Table diagram is the result of physical design.

  • ER diagram is the result of conceptual design.

  • Implementation of database requirements as tables, keys, and columns in a specific database system is called logical design.

  • Specification of database requirements without regard to implementation is called conceptual design.

Table diagram is the result of physical design.

13
New cards

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

 

USE _____;
SHOW _____;

 

 

  • onlineShop, TABLES

  • DATABASE, COLUMNS

  • DATABASE, CREATE TABLE

  • onlineshop, TABLE

  • onlineShop, TABLES

14
New cards

Which SQL statement change column name Fax to FaxNumber  which has the same data type, Varchar(30), to the Supplier table?

 

ALTER TABLE Supplier
CHANGE Fax FaxNumber VARCHAR(30);

 

ALTER TABLE Supplier
ADD FaxNumber VARCHAR(30);

 

ALTER Supplier
CHANGE Fax FaxNumber;

 

ALTER TABLE Supplier
Rename FaxNumber VARCHAR(30);

ALTER TABLE Supplier
CHANGE Fax FaxNumber VARCHAR(30);

15
New cards

(10 % 4 + 10 < 15) AND True

 

True

 

False

True

16
New cards

A database designer wants to create three tables: Supplier, Product, and Country. The Supplier table has a CountryID column with values that must appear in the Country table's CountryID column. The Product table has a ProductID column. Which table's CREATE TABLE statement(s) must specify a FOREIGN KEY?

 

  • Product

  • Supplier 

  • Country

  • Supplier and Country

  • Supplier 

17
New cards

Which is not True?

 

  • The result of TRUE AND NULL is FALSE

  • COMMIT is a DTL statement that saves a transaction to the database.

  • CREATE is a DDL statement that creates a table.

  • In a table, columns are ordered and rows are not ordered.

The result of TRUE AND NULL is FALSE

18
New cards

Which is not True?

  • In the relational model, an unnamed tuple of values is a record

  • SQL stands for Structured Query Language

  • INT data type can store negative numbers

  • BLOB data type stores float values

  • BLOB data type stores float values

19
New cards

Choose the best data types to replace XXX and YYY.

 

CREATE TABLE Employee (
   ID INT,
   Name XXX,
   Salary YYY
);

 

 

  • CHAR(50), INT

  • VARCHAR(50), DECIMAL(8, 2)

  • CHAR(50), FLOAT

  • VARCHAR(50), DATE

  • VARCHAR(50), DECIMAL(8, 2)

20
New cards

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

 

SELECT ProductName FROM Product
WHERE Quantity < 15 AND UnitPrice <= 20.00;

 

 

  • Sunsuit, Shorts set, Romper

  • Onesies set, Pajama set

  • Sunsuit, Shorts set

  • No products

  • Sunsuit, Shorts set

21
New cards

What should be added so NULL values are not allowed in ProductName?

 

CREATE TABLE Product (
   ProductId INT,
   ProductName _____,
   UnitPrice DECIMAL(5,2),
   SupplierId INT
);

 

 

  • VARCHAR(50) NOT NULL

  • NOT NULL

  • VARCHAR(50 NOT NULL)

  • NOT NULL VARCHAR(50)

  • VARCHAR(50) NOT NULL

22
New cards

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

 

  • A single INSERT statement can only add one row.

  • The column names can be omitted in an INSERT statement.

  • The VALUES order must match the column order in the INTO clause.

  • The INSERT statement is used to add new values to a table.

A single INSERT statement can only add one row.

23
New cards

Which one is True?

 

  • Two rows may have identical values in all columns

  • Duplicate column names are not allowed in different tables

  • Minimal means that all primary key columns are necessary for uniqueness

  • A primary key must be unique and it can have NULL

Minimal means that all primary key columns are necessary for uniqueness

24
New cards

In the Reservation table below, a room may be reserved several times, so the RoomNumber column is not unique. To ensure that a room can only be reserved by only one guest for the day, the minimal primary key consists of which columns?

image.png

 

  • (RoomNumber, DateOfStay, Guest)

  • (RoomNumber, Guest, ModeOfPayment)

  • (RoomNumber, ModeOfPayment)

  • (RoomNumber, DateOfStay)

(RoomNumber, DateOfStay)

25
New cards

A ___________ is a simple or composite column that is unique and minimal.

Candidate Key

26
New cards

Physical design never affects query results

Data Independence

27
New cards

Foreign key value must match a candidate key value of some tuple in its home relation or must be wholly null.

Referential integrity

28
New cards

________ contains “data about the data” or meta data

catalog

29
New cards

Which two rules apply to primary keys?

 

  • Values must be unique and may not be NULL

  • Values must be unique and can be NULL

  • Values can have duplicates and can be NULL

  • Values can have duplicates and may not be NULL

Values must be unique and may not be NULL

30
New cards

Refer to the Teacher and Class tables. The action ON UPDATE CASCADE  is specified for the TeacherID foreign key. What is the result when Rosa Lopez's TeacherID is changed to 12333?

 

  • The change is rejected.

  • The TeacherID for Databases and Programming are changed to 12333.

  • The TeacherID for Rosa Lopez is set to NULL

  • The Databases and Programming courses are deleted.

The TeacherID for Databases and Programming are changed to 12333.

31
New cards

Which is Not True?

 

  • In a many-many relationship, a new table contains two foreign keys, referring to the primary keys of the related tables.

  • In a one-one relationship, the foreign key is placed in the table with less rows.

  • The primary key of a table that implements a many-many relationship is composite.

  • In a many-one relationship, foreign key goes in the table on the 'one' side of the relationship

In a many-one relationship, foreign key goes in the table on the 'one' side of the relationship

32
New cards

A model has Shipment, Product, and Shipper entities. The Shipment entity has no unique attributes. Each shipment is identified by ProductNumber, ShipperCode, and ShipmentDate. Shipment is a(n) _____ entity.

 

  • identifying

  • subtype

  • strong

  • weak

weak

33
New cards

What is the greatest number of instances of one entity that can relate to a single instance of another entity?

 

  • Maximum

  • Minimum

  • One

  • Many-many

Maximum

34
New cards

Each course must be offered by at least one department. In the Department-Offers-Course relationship, Department is a(n) _____ entity.

 

  • singular

  • required

  • optional

  • plural

required

35
New cards

The EmployeeWorkspace table has a composite key of (EmployeeID, WorkspaceID). WorkHours depends on (EmployeeID, WorkspaceID), and EmployeeLastName depends on EmployeeID. Which column must be removed so EmployeeWorkspace is in second normal form?

 

  • WorkspaceID

  • EmployeeID

  • EmployeeLastName

  • WorkHours

EmployeeLastName

36
New cards

What is Not True about denormalization? 

 

  • It is achievable by merging tables

  • Denormalization typically improves performance of join queries.

  • Denormalization is a process of intentionally introducing redundancy.

  • Denormalization never results in second-normal-form tables

Denormalization never results in second-normal-form tables

37
New cards

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

 

  • Programmer

  • Designer

  • Administrator

  • User

Designer

38
New cards

Which is NOT true?

  • NULL value represent missing data or unavailable data

  • In table, columns are ordered and rows are unordered

  • INT data type can store positive and negative numbers

  • BLOB data type can store textual data in a structured format

BLOB data type can store textual data in a structured format

39
New cards

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

 

  • Through the reversal of a whole or partial transaction due to a failure.

  • Preventing multiple transactions with the same data at the same time.

  • By ensuring authorized users only access permissible data.

  • Documenting any lost transactions by always recording results.

Preventing multiple transactions with the same data at the same time

40
New cards

Each school has at least some graduates. Some students have not yet graduated from any school.

Determine the below relationship minima? 

Student-GraduatesFrom-School

  • one-zero

  • zero-one

  • zero-zero

  • one-one

one-zero

41
New cards

Which one is Not True?

  • Maxima and minima usually depend on business rules.

  • A required attribute becomes a column that is never NULL

  • NoSQL database system is optimized for big data.

  • Primary keys should contain descriptive information to convey meanings to users

Primary keys should contain descriptive information to convey meanings to users

42
New cards

What is Not True?

 

  • Attributes of the supertype apply to all subtypes

  • All weak entities are subtype entities.

  • In an entity-relationship diagram, attributes are documented within an entity rectangle.

  • If a plural attribute has a small, fixed maximum, it can be implemented as multiple columns in the initial table

All weak entities are subtype entities.

43
New cards

A table has:

• columns A, B, C, D

• candidate key (A, B, C)

• primary key (A, B, C)

• dependency D → B (in addition to dependencies on candidate keys)

What is the normal form of the table? 

 

  • first NF

  • second NF

  • boyce-codd NF

  • third NF

third NF

44
New cards

A ____ is a SELECT statement that combines data from two tables, known as the left table and right table, into a single result.

join

45
New cards

Which columns can be compared in a join?

any columns with comparable data types

46
New cards

In a join, what are the first and second tables in the FROM clause called?

left table and right table

47
New cards

selects only matching left and right table rows.

INNER JOIN

48
New cards

selects all left and right table rows, regardless of match

FULL JOIN

49
New cards

In a FULL JOIN result table, unmatched left table rows appear with

NULL values in right table columns, and vice versa

50
New cards

The join clause appears between a

FROM clause and an ON clause

51
New cards

The FROM clause specifies the

left table

52
New cards

The INNER JOIN or FULL JOIN clause specifies

the right table

53
New cards

The ON clause specifies the

join columns

54
New cards

MySQL supports INNER JOIN but not

FULL JOIN

55
New cards

selects all left table rows, but only matching right table rows

LEFT JOIN

56
New cards

selects all right table rows, but only matching left table rows

RIGHT JOIN

57
New cards

any join that selects unmatched rows, including left, right, and full joins

outer join

58
New cards

MySQL supports both LEFT JOIN and RIGHT JOIN (t/f)

True

59
New cards

compares columns of two tables with the = operator

equijoin

60
New cards

Most joins are equijoins (t/f)

true

61
New cards

compares columns with an operator other than =, such as < and >

non-equijoin

62
New cards

Which join clauses can be used in a non-equijoin query?

All join clauses

63
New cards

joins a table to itself

self-join

64
New cards

A self-join can compare any columns of a table, as long as the columns have

comparable data types

65
New cards

If a foreign key and the referenced primary key are in the same table, a self-join commonly compares

those key columns

66
New cards

In a self-join, aliases are

necessary to distinguish left and right tables.

67
New cards

combines two tables without comparing columns

cross-join

68
New cards

A cross-join uses a CROSS JOIN clause without an

ON clause

69
New cards

A view table is a table name associated with a SELECT statement, called the

view query

70
New cards

A table specified in the view query's FROM clause is called a

base table

71
New cards

Unlike base table data, view table data is not

normally stored

72
New cards

a view for which data is stored at all times

materialized view

73
New cards

Advantages of views

  • Protect sensitive data.

  • Save complex queries

  • Save optimized queries

74
New cards

Using materialized views always improves database performance.(t/f)

false

75
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. (t/f)

true

76
New cards

A view query can reference another view table.(t/f)

true

77
New cards

Views can be used to hide rows as well as columns from database users. (t/f)

true

78
New cards

View tables are commonly used in

SELECT statements

79
New cards

the database rejects inserts and updates that do not satisfy the view query WHERE clause. Instead, the database generates an error message that explains the violation.

WITH CHECK OPTION

80
New cards

Imperative languages

contain control flow statements that determine the execution order of program steps

81
New cards

Procedural languages

composed of procedures, also called functions or subroutines.ex: C and CBOL

82
New cards

Object-oriented languages

organize code into classes. A class combines variables and procedures into a single construct

83
New cards

Declarative languages

do not contain control flow statements. Each statement declares what result is desired, using logical expressions, rather than how the result is processed ex: SQL HTML

84
New cards
85
New cards

Declarative language is commonly used for database queries for two reasons

Easier programming
Faster execution

86
New cards

Database programming presents two challenges:

Syntax gap
Paradigm gap

87
New cards

Embedded SQL

codes SQL statements directly in a program written in another language.

88
New cards

Procedural SQL

extends the SQL language with control flow statements, creating a new programming language.

89
New cards

An application programming interface, or API

is a library of procedures or classes

90
New cards

Embedded SQL was the earliest database programming technique, developed along with SQL in the 1980s. Procedural SQL emerged soon after embedded SQL in the late 1980s. The first widely used database API, ODBC, was released in 1992 (T/F)

true

91
New cards

Different database programming techniques cannot be combined in one application. (t/f)

False

92
New cards

The EXEC SQL keyword is used in procedural SQL.(t/f)

false

93
New cards

Procedural SQL is specified in the SQL standard. (t/f)

true

94
New cards

The ODBC API for the Java language consists of Java classes. (t/f)

true

95
New cards

Disadvantages of Embedded SQL

Gaps. Compile steps, Network Traffic

96
New cards

Advantages of Procedural SQL

Gaps. Compile steps, Network Traffic, Optimization level

97
New cards

Advantages of API

Gaps, Application, Database Independence

98
New cards

SQL/Persistent Stored Modules (SQL/PSM) is

a standard for procedural SQL that extends the core SQL standard.

99
New cards

cursor

a special variable that identifies an individual row of a result table

100
New cards

trigger is like a stored procedure or a stored function, with two differences:

Triggers have neither parameters nor a return value
Triggers are not explicitly invoked by a CALL statement or within an expression.

Explore top flashcards