Pytania i odpowiedzi Flashcards
The terms “bitmap,” “b-tree,” and “hash” refer to which type of database structure?
Index
One reason to add an index is to:
Improve performance of select statements.
You have a table that contains the following data.
You break the table into the following two tables.
This process is referred to as:
Normalization
You have a table that contains the following data.
Which database term is used to describe the relationship between ProductID and ProductCategory?
Functionally dependent
Which key uniquely identifies a row in a table?
primary
At 3:00 P.M. (1500 hours), you create a backup of your database. At 4:00 P.M. (1600 hours), you create a table named Customer and import data into the table.
At 5:00 P.M. (1700 hours), your server fails.
You run a script to apply only the 3:00 P.M. backup to your database. What is the result of the script?
The Customer table no longer exists.
In which situation do you need to perform a restore on a database?
when data becomes corrupted in the database
Which command should you use to give a user permission to read the data in a table?
GRANT SELECT
You need to enable a new employee to authenticate to your database.
Which command should you use?
CREATE USER
Which keyword can be used in a create table statement?
UNIQUE
You need to store product quantities, and you want to minimize the amount of storage space that is used. Which data type should you use?
INTEGER
You need to store product names that vary from three to 30 characters. You also need to minimize the amount of storage space that is used.
Which data type should you use?
VARCHAR (30)
One reason to create a stored procedure is to:
Improve performance.
Which permission does a user need in order to run a stored procedure?
EXECUTE
You have a table named Product. You create a view that includes all the products from the Product table that are in the Furniture category.
You execute a statement on the Product table that deletes all the products in the Furniture category.
After you execute the statement, the result set of the view is:
Empty
In SQL, an insert statement is used to add a:
Row of data to a table.
You have two tables. Each table has three rows.
How many rows will be included in the Cartesian product of these two tables?
9
You are writing an SQL statement to retrieve rows from a table.
Which data manipulation language (DML) command should you use?
SELECT
Which constraint ensures a unique value in the ID column for each customer?
PRIMARY KEY
The component that holds information for a single entry in a table is called a:
Row
You execute the following statement:
SELECT EmployeeID, FirstName, DepartmentName
FROM Employee, Department -
This type of operation is called a/an:
Cartesian product
Which command should you use to add a column to an existing table?
ALTER
You have the following table definition:
CREATE TABLE Product - (ID INTEGER PRIMARY KEY, Name VARCHAR(20), Quantity INTEGER) The Product table contains the following data.
You execute the following statement:
SELECT Name FROM Product WHERE Quantity IS NOT NULL
How many rows are returned?
3
You are writing a select statement to find every product whose name contains a specific character.
Which keyword should you use in your where clause?
LIKE