Database Fundamentals exam Flashcards
You need to store product quantities, and you want to minimise the amount of storage space that is used. Which data type should you use?
Integer
Which Statement will result in the creation of an index?
CREATE TABLE Employee
EmployeeID INTEGER PRIMARY KEY
You need to store product names that vary from three to 30 characters, while minimising the storage spaced 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
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 can you use?
SELECT
Which constraint ensures a unique value in the ID column for each user?
PRIMARY KEY
The component that holds information for a single entry in a table is called a:
Row
Which keyword would you use in a select statement to return tows that meet a specific condition?
WHERE
What command should you use to remove a table from a database?
DROP TABLE
You need to store contact information for each student in your school database. You should store each student’s information in a:
Row
Which category of SQL statements is used to add, remove, and modify database structures?
Data definition language (DDL)
Data is a database is stored in:
Tables
Denormalization is performed in order to:
Improve query performance
How do you make a search by unique ID more efficient?
An index
Which two keys establish a relationship between two tables?
Foreign and Primary
One difference between a function and a stored procedure is that a function:
Must return a value
Which keyword must be included in a create view statement?
SELECT
You need to remove a view named EmployeeView from your database Which statement should you use?
DROP VIEW EmployeeView
A named group of SQL statements that can be executed in a database is called a:
Stored procedure
A view can be used to:
Limit access to specific rows or columns of data in a database
On which database structure does an update statement operate?
Table
You delete rows in a table named Order. The corresponding row in the OrderItem table are automatically deleted. This process is an example of a/an:
Cascade delete
What defines the amount of storage space that is allocated to a value in a column?
Data type
You are creating a table to store customer data. The AccountNumber column uses values that always consist of one letter and four digits. Which data type should you use for the AccountNumber column?
CHAR
What is one difference between an update statement and a delete statement?
An update statement does not remove rows from a table
You have a Department table and an Employee table in your database.
You need to ensure that an employee can be assigned to only an existing department. What should you apply to the Employee table?
A foreign key
You need to store the first name, last name, and student ID for 100 students. This information will be stored as a:
100 rows and three columns
What are three valid data manipulation language commands?
INSERT, DELETE, UPDATE