Module 2 Flashcards

1
Q

The following table, OrderLine, represents a single line item on a grocery store receipt. OrderID is the identifier for the entire order. OrderLineNumber is the number of an entry on your receipt, such as 1 for the first line on the receipt, and 2 for the second line on the receipt. Select all statements that are true about this table.

A) There can be multiple different products in a row of the OrderLine table.
B) OrderID would make a good primary key.
C) ProductID could be a foreign key linked to a Product table.
D) Any attribute in this table would be a good choice as the primary key.

A

C)

Yes. The only information is the ID number, so it’s likely it’s linked to a Product table that contains more information about the product,
such as its name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following are true about SELECT command?

A) The GROUP BY clause in a SELECT command groups tables with matching columns.
B) The WHERE clause can be used to see if a field is empty.
C) The SELECT command has several optional clauses, including the WHERE clause.
D) The WHERE clause of a SELECT command can be used to compare different values so you can limit the result set.

A

B) C) D)

Yes, the WHERE clause can be used to see if a field is empty, i.e. check for nulls.

Yes. The WHERE clause is optional in the SELECT command.

Yes. One of the purposes of the WHERE clause is to compare the value of a #eld to a di”erent value or constant. The WHERE clause condition will limit the result set of a query so only records that match the WHERE clause condition are displayed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of these statements are true about the SQL language?

A) The SQL language is only supported by a few RDBMS products.
B) REVOKE is a valid SQL command.
C) The SQL language includes the Data Definition Lanaguage (DDL) which is used to create tables and other database objects.
D) SQL has been around for many years and the acronym SQL is short for “Structured inQuery Language”.
E) PL/SQL is slowly replacing SQL as it is much more powerful.

A

B) C)

Yes, REVOKE is a valid SQL command.

Yes, DDL includes the CREATE, DROP, and ALTER commands, which are used to create, delete, and change database objects.

While SQL has indeed been around for many years, the SQL Feedback: acronym stands for Structured Query Language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a DBMS provide data recovery?

A) The RDBMS has a backup mechanism that can be used for data recovery if needed.
B) Data changes are recorded in logs as they are made.
C) Users can make backups or copies of a database.
D) Indexes are used by a DBMS to aid in the data recovery process.

A

A) B)

The DBMS permits administrators to create backups of the database.

The DBMS splits updates into individual transactions, uses the individual transactions to modify the data, and maintains a log of these transactions.

The RDBMS permits administrators to create backups of the database. Users don’t have rights to do this operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following statements correctly describe databases in an organization?

A) Over the past two decades, object oriented databases have prevailed as the leading model for databases.
B) Today many organizations use IT activities such as data mining to streamline their operations and achieve competitive advantages.
C) A database is inherently secure so extra security measures are not necessary for databases.
D) Databases are becoming obsolete in organizations as new technology takes their place.

A

B)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of these statements are true about relational databases?

A) A primary key uniquely identifies a row in a table.
B) A modern standard RDBMS stores metadata about the database, such as names and data types, in a special part of the database called the system catalog.
C) Tables in RDBMS represent only business entities such as customers or products.
D) Attributes in an RDBMS table correspond to rows in a spreadsheet such as Excel.

A

A) B)

Yes. Some features of of object-oriented models., such as specialization-generalization and references, are so useful that they have been added to RDBMS products such as Oracle, and the recent ANSI and ISO standards are object-relational.

Answer Yes. Any changes that are made to the data definitions and their relationships are automatically recorded in the system catalog.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following statements regarding an RDBMS and a spreadsheet application are true?

A) An RDBMS supports indexes to quickly find requested data items, while a spreadsheet does not.
B) An RDBMS requires an additional statement to save the updates, while a spreadsheet saves changes instantly.
C) Both an RDBMS and spreadsheets support referential integrity.
D) A spreadsheet organizes data into rows and columns, whereas an RDBMS does not.

A

A)

Yes. An RDBMS can support indexes based on a key. A spreadsheet application does not have this ability.

No. An RDBMS may or may not require an additional statement (COMMIT) to save the changes to the data, but a spreadsheet requires you to save the workbook or the data changes will be lost.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following are true about the DELETE command?

A) The DELETE command can delete part of a record and leave the rest of the record intact.
B) It can be difficult to recover data deleted by the DELETE command.
C) The DELETE command deletes both the table and the data in that table.
D) The DELETE command will not make any changes to the table if the WHERE clause is missing.
E) The DELETE command allows you to specify a condition so that only certain data is deleted from the table when the command is issued.

A

B) E)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is true about a composite key?

A) It is a primary key and a foreign key combined.
B) It is two or more attributes in one table that are combined to form a key.
C) It is a key made of two different data types.
D) When a composite primary key is defined, multiple attributes together uniquely identify each record.

A

B) D)

Yes. This is the definition of a composite key.

Answer The definition of a composite primary key is two or more attributes which together uniquely determine (or identify) a record.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the following statements are true regarding keys?

A) Each row in a table must have a different value for the primary key.
B) A table can have no key, one key or several keys.
C) Relationships are created through the use of primary keys.
D) Relationships are created through the use of foreign keys.

A

A) B) D)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following are true about data control language (DCL)?

A) To set up referential integrity, you would use DCL commands.
B) DCL commands are part of the way an RDBMS handles security.
C) DCL commands include GRANT and REVOKE.
D) DCL commands include INSERT, UPDATE, and DELETE.

A

B) C)

Yes. DCL commands specify who can access data in the database and which operations they can perform.

Yes. DCL commands include GRANT and REVOKE.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following are true about DDL commands?

A) DDL commands are part of the SQL language.
B) DDL commands are used to create and modify table structures.
C) DDL commands include CREATE, UPDATE and ALTER.
D) DDL commands can only be issued when the database is first created.

A

A) B)

Yes. The SQL language consists of a data description language (DDL), a data manipulation language (DML) and a data control language (DCL).

Yes. The DDL commands are used to create and modify table structures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following are true about the ALTER TABLE command?

A) The ALTER TABLE command allows you to delete a column from a table based on a condition in the WHERE clause of the command.
B) ALTER TABLE command allows you to add a constraint to an existing table.
C) The ALTER TABLE command allows you to modify the data type of a column in an existing table.
D) The ALTER TABLE command allows you to add a new column to an existing table.
E) The ALTER TABLE command allows you to change data in a record after it has been inserted.

A

B) C) D)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following are true about programming for databases?

A) Database programming can be useful for extending security in a database application.
B) Most RDBMS include a programming language that allows the programmer to execute SQL commands integrated with conventional programming constructs.
C) A database program can be useful for loading a data warehouse.
D) A database programmer can write code that will execute different commands based on different conditions.

A

A) B) C) D)

Yes. This is one of the purposes of a database program.

Yes. This is one of the uses of a database program.

Yes. It is possible to use conditional clauses in database programming. A conditional clause might depend on the values of different data items. For instance, you might have a program that says if the student is an online student, set the value of the classroom attribute to “Online”, but if the student is not an online student, set the value of the classroom attribute to a room number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Select all statements that are true about data types in SQL RDBMS.

A) The VARCHAR data type can store strings of characters of varying lengths, such as might occur for people’s names.
B) Modern SQL DBMS support data types that store dates and times.
C) Each row has a specific data type.
D) The number 6.25 could be stored in a variable of type INTEGER.

A

A) B)

Yes. A CHAR data type stores a fixed length of characters. The VARCHAR data type stores a variable length of characters.

Answer Yes. There are specific data types for date and time, including the stand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following are true about the SQL language?

A) SQL is a procedural language, which means that it can create stored procedures.
B) SQL is a language that allows you to access and manipulate data in databases.
C) The SQL language can define access rights to the database.
D) SQL has a vocabulary set of less than a hundred words, which is why the initials SQL stand for “Simplified Query Language.”

A

B) C)

Yes. SQL is by far the most common database access language.

Yes. The SQL language has three parts, a data definition language, a data manipulation language, and a data control language. It is the data control language (DCL) that contains the commands GRANT and REVOKE that enable a database administrator to establish the security levels for the database.

17
Q

Which of the following are true about jobs in the database feild?

A) Database administrators need to understand the details of the particular DBMS with which they work.
B) There is only one kind of job that requires database skills.
C) A data administrator needs strong technical skills in specific DBMSs.
D) A database modeler gathers requirements and creates a data model.

A

A) D)

Yes. And because of this, a database administrator needs strong technical skills.

No. A data administrator works at a higher level than a database administrator, so while they should be familiar with the abilities of different database models and vendors, they do not need to be as technically strong as a database administrator.

The Modeler’s primary responsibility is gathering the data requirements and representing them in the data model.

18
Q

Which of the following are true about spreadsheets?

A) Multiple values can be entered into a cell of a spreadsheet.
B) A spreadsheet assumes a data type based on the first value you type into a cell.
C) Each of the rows of a spreadsheet usually represent related data about a particular entity.
D) Height and Age are spreadsheet data types.

A

A) B) C)

Yes. If you type in letters, for example, it assumes the data type for that column is text.

19
Q

Which of the following are true regarding primary and foreign keys in an RDBMS table?

A) A key is an object.
B) An RDBMS table can have multiple unique keys.
C) If a record that you’re trying to add to a table has a value for the primary key, but no value for the foreign key, the RDBMS, because of referential integrity, will prevent you from inserting it.
D) Both primary and foreign keys play roles in referential integrity.

A

B) D)

Yes, while there can be only one primary key in an RDBMS table, it is possible to have multiple unique keys.

Yes. Referential integrity ensures that the value for a foreign key equates to the value of a primary key in its referenced table.

20
Q

Which of the following are true about DML commands?

A) DML commands update the structure of tables in the database.
B) A SELECT command is a valid DML command.
C) To create a report from existing tables, you would use DML commands.
D) DML commands are used to update and retrieve data in the database.

A

B) C) D)

Yes. A SELECT command is a DML command, used for accessing the data.

Yes. To create a report, you need to retrieve data, so you would use DML commands to accomplish this.

Yes. This is the purpose of DML commands.

21
Q

What is a RDBMS schema?

A) project plan
B) a scenario
C) a database plan
D) a set of entities

A

C)

22
Q

What would you use to load a data warehouse?

A) log file
B) a macro
C) a C script
D) SQL
E) a system catalog

A

D)

23
Q

In terms of an RDBMS, what is metadata?

A) Data of a mathematical nature
B) Extremely large volumes of data
C) Data definitions and relationships
D) Data of the restrictive data types, such as date and currency

A

C)

24
Q

What is a tuple?

A) a column
B) a row
C) an attribute
D) a data type

A

B)

25
Q

Which of the following are true about creating a join?

A) An inner join usually combines two columns of the same table.
B) The RDBMS may require the column names in a join to be prefixed by the table name.
C) The JOIN phrase is used with the SELECT command.
D) Only two tables can be joined in one SQL command.

A

B) C)

Yes. The RDBMS needs to know which table each value comes from, so it requires the table name if the same name is used for an attribute in different tables.

26
Q

Which of the following are a leading RDBMS today?

A) MS Excel Macros
B) VB
C) Sybase
D) UDB
E) MySQL

A

C) D) E)
Sybase, MySQL and UDB are all leading
RDBMS’.

27
Q

Which of the following are true about the DELETE command?

A) The DELETE command only deletes data from the table specified.
B) The DELETE command deletes an entire record of data at a time.
C) The WHERE clause is a mandatory part of the DELETE command.
D) The SET clause of a DELETE command lets you specify which attribute you want to delete.

A

A) B)

Yes, the purpose of the DELETE command is to delete data from the table. It doesn’t delete the table itself.

Yes, you must delete data from a table as a whole record. You can’t delete part of a record.

28
Q

Which of the following are true about the DROP TABLE command?

A) The ALTER TABLE…DROP command can achieve the same result as the DROP TABLE command.
B) Once a table is dropped, it no longer exists in the system catalog.
C) The DELETE command must be used in conjunction with the DROP TABLE command to delete the data in a table before it is dropped.
D) The DROP TABLE command is a DDL command.
E) The DROP TABLE command allows you to specify a condition whereby only certain data is deleted.

A

B) D)

The DROP TABLE command is a DDL command that deletes the table structure and all of the table data. Once dropped, a table no longer exists in DBMS system catalog. The DROP TABLE command doesn’t have an optional WHERE clause because it is an all or nothing operation. The DROP TABLE command is different from the DELETE command because it allows you to delete the entire table structure as well as the data it contains while the DELETE command only allows you to delete the table’s data.

29
Q

Which of the following access privileges are provided by an RDBMS?

A) User access to specific tables in the database.
B) User access to specific operations on specific attributes of specific tables in the database.
C) User access to specific operations on specific tables in the database.
D) User access to specific cells in the database.
E) User access to the entire database.

A

A) B) C) E)

30
Q

What is a relational database model.

A

Most commonly used
Founded in 1970
Basis is relational algebra and calculus

Examples
Oracle, Microsoft SQL server, IBM DB2, Sybase, MySQL

31
Q

Which of the following are aspects of both spreadsheets and databases?

A) data storage
B) set roles and privileges
C) Password security
D) Programing language interface
E) Data independence

A

A) C) D)

These are the only ones listed as being shared. The others and many more are features only of Databases.

32
Q

A fundamental aspect of the relational DBMS model is that every table MUST have a primary key, and that the column(s) chosen must be unique AND not null. (T/F)

A

TRUE

33
Q

A foreign key in one table will match a primary key in a separate table OR be null (T/F)

A

True

Allows for two tables to interact and improves referential integrity.

34
Q

SQL is a non-procedural language, with <100 words, and three language types (T/F)

A

True:

The three language types are
DDL ( Data Definition Language)
DML (Data Manipulation)
DCL (Data Control)

35
Q

What are the three commands of DDL language in SQL?

A

CREATE
ALTER
DROP

36
Q

What are the three commands of DML language in SQL?

A

SELECT
INSERT
UPDATE
DELETE

37
Q

What are two commands in DCL language in SQL?

A

GRANT
REVOKE