1.
What are three valid data manipulation language DML Comands choose three
Correct Answer(s)
A. Insert
C. Delete
E. Update
Explanation
The question asks for three valid data manipulation language (DML) commands. The correct answer is insert, delete, and update. These are indeed valid DML commands used to manipulate data in a database. The insert command is used to add new records to a table, the delete command is used to remove records from a table, and the update command is used to modify existing records in a table. The other options, commit and output, are not DML commands and are not used for data manipulation.
2.
You need to store the contact information for each student in your school database.
You should store each student's information in
Correct Answer
A. Row
3.
You need to rename a column in a data base table
Which Data Definition Language ( DDL ) statement should you use ?
Correct Answer
A. Alter
Explanation
To rename a column in a database table, you should use the ALTER statement. The ALTER statement allows you to modify the structure of a table, including renaming columns. The INSERT statement is used to add new rows of data into a table. The CREATE statement is used to create a new table. The UPDATE statement is used to modify existing data in a table, but it does not allow you to rename columns.
4.
You have a table named Customer. You need to add a new column named District.
Which statement should you use?
Correct Answer
D. Option D
Explanation
Option D is the correct answer because it suggests using the ALTER TABLE statement to add a new column named District to the Customer table. The ALTER TABLE statement is used to modify an existing table by adding, modifying, or deleting columns.
5.
You are writing a SQL statement to retreive rows from a table which Data Manipulation Language DML Command should you use ?
Correct Answer
A. Select
Explanation
The correct answer is "select" because the "select" command is used in SQL to retrieve rows from a table. It allows you to specify the columns you want to retrieve and apply conditions to filter the results if needed.
6.
You are writing a T - SQL statement that perform a long complex query the statement then send
the result in an email you want to be able to manually call the code anytime you need to .
which Database objects can you use to store the code ?
Correct Answer
A. Stored procedure
Explanation
A stored procedure is a type of database object that can be used to store the T-SQL code. It allows you to define a set of SQL statements that can be executed as a single unit. By creating a stored procedure, you can easily call and execute the complex query whenever needed, such as when sending the result in an email.
7.
Which permission does a user need in order to run a stored procedure?
Correct Answer
A. EXECUTE
Explanation
In order to run a stored procedure, a user needs the EXECUTE permission. This permission allows the user to execute or run the stored procedure. The other options, ALLOW, CALL, and RUN, are not valid permissions for running a stored procedure.
8.
Check the correct answer
Correct Answer(s)
A. You can delete data by using stored procedure
B. A function must have a return value
Explanation
A stored procedure is a set of SQL statements that can be executed to perform a specific task, such as deleting data from a database. Therefore, the statement "You can delete data by using stored procedure" is a correct answer. On the other hand, a function is also a set of SQL statements, but it must have a return value. This means that a function is used to perform a specific task and return a value, while a stored procedure is used to perform a task without necessarily returning a value.
9.
One different between A function and a stored procedure
Correct Answer
A. Must return a value
Explanation
A function is a subprogram that must return a value after performing a specific task. It is used to perform calculations or manipulate data and is typically called within an expression or statement. On the other hand, a stored procedure is a set of SQL statements that are executed as a single unit. Unlike a function, a stored procedure does not necessarily need to return a value. It can be used to perform various tasks such as inserting or updating data, generating reports, or executing multiple SQL statements. Therefore, the difference between a function and a stored procedure is that a function must return a value, whereas a stored procedure may or may not return a value.
10.
You develop a database to store data about text books the data must be stored to process at a later time
Which database object should you use to store the data
Correct Answer
A. Stored procedure
Explanation
A stored procedure is the correct answer because it is a database object that allows you to store a set of SQL statements that can be executed at a later time. It can be used to store and process data in a database, making it suitable for storing data about textbooks that can be processed at a later time. A stored procedure can be called and executed whenever needed, providing a convenient way to store and retrieve data efficiently.
11.
This question requires that you evaluate the underlined text to determined if its correct
Views are database objects that contain all of the data in database
Instruction Review the underline text if it makes the statement correct select No change is needed if the statement is incorrect
Correct Answer
A. Tables
Explanation
The underlined text states that "Views are database objects that contain all of the data in the database." This statement is incorrect. Views in a database are virtual tables that display data from one or more tables in the database. They do not contain all of the data in the database, but rather provide a way to organize and present data in a specific way. Therefore, the correct answer is "No change is needed" as the underlined text is incorrect.
12.
Which two elements are required to define a column ??
Correct Answer(s)
A. Name
B. A data type
Explanation
To define a column, two elements are required: a name and a data type. The name serves as the identifier for the column, while the data type specifies the type of data that can be stored in the column (e.g., text, number, date). An index and a key are not necessary to define a column, as they are optional features used for optimizing database performance and enforcing data integrity, respectively.
13.
What defines the amount of storage space that is allocated to a value in a column
Correct Answer
A. Data type
Explanation
The amount of storage space allocated to a value in a column is determined by its data type. Different data types require different amounts of storage space. For example, a numeric data type may require more storage space compared to a string data type. The data type also determines the range of values that can be stored in the column and the operations that can be performed on it.
14.
Check the correct answer
Correct Answer
C. The INT data type contains only whole numbers
Explanation
The explanation for the given correct answer is that the INT data type is specifically designed to store whole numbers. It does not allow for decimal values or any other type of data. Therefore, any value assigned to an INT data type will be a whole number.
15.
You need to store the first name , Last name and Student ID for 100 students
This information will be stored in a table as :
Correct Answer
A. 100 row and three columns
Explanation
The correct answer is "100 row and three columns" because in a table, each row represents a different student and each column represents a different attribute or piece of information about the student. In this case, there are 100 students, so there would be 100 rows, and there are three attributes (first name, last name, and student ID), so there would be three columns.
16.
You have a table named student that contains 100 rows , some of the row have a NULL value in The first name column
You execute the following statement
Delete from student
What is the result ??
Correct Answer
A. All rows in the table will be deleted
Explanation
The correct answer is that all rows in the table will be deleted. The statement "Delete from student" does not specify any conditions or criteria for deletion, so it will delete all rows in the table, regardless of the values in the first name column.
17.
First normal form requires that a database excludes
Correct Answer
A. Repeating groups
Explanation
First normal form (1NF) is a fundamental principle in database design that requires eliminating repeating groups in a database. Repeating groups refer to multiple occurrences of the same set of attributes within a single table. By removing repeating groups, the database becomes more organized and efficient. Foreign keys and composite keys are not excluded in 1NF; they are used to establish relationships between tables and ensure data integrity. Duplicate rows, on the other hand, are not allowed in 1NF as they can lead to data inconsistency and redundancy. Therefore, the correct answer is "Repeating groups."
18.
You assign User1 a set of permissions that include the WITH GRANT OPTION.
The WITH GRANT OPTION enables User1 to:
Correct Answer
A. Create new database users
Explanation
The correct answer is "create new database users". When the WITH GRANT OPTION is assigned to User1, it allows User1 to create new database users. This means that User1 has the ability to grant permissions to other users and control their access to the database.
19.
You need to populate a table named Employee Copy with data from an existing table named Employee. Which statement should you use?
Correct Answer
A. INSERT into Employee Copy
Select *
FROM Employee
Explanation
The correct statement to use is "INSERT into Employee Copy SELECT * FROM Employee". This statement will insert all the data from the existing table named Employee into the table named Employee Copy.
20.
You have a table that contains the following data.
You break the table into the following two tables
This process is referred to as
Correct Answer
C. Normalization
Explanation
Normalization is the process of organizing data in a database to eliminate redundancy and improve data integrity. It involves breaking a table into multiple tables, each with a specific purpose and related to each other through relationships. This helps to minimize data duplication and ensures efficient storage and retrieval of data. By normalizing the table, the data is structured in a logical and organized manner, making it easier to manage and maintain in the long run.
21.
You have a table that contains the following data
Which database term is used to describe the relationship between ProductID and ProductCategory
Correct Answer
C. Functionally dependent
Explanation
Functionally dependent is the correct answer because it describes the relationship between ProductID and ProductCategory in the table. In a functional dependency, the value of one attribute (ProductID) determines the value of another attribute (ProductCategory). In this case, the value of ProductID uniquely determines the value of ProductCategory, indicating a functional dependency between the two attributes.
22.
Which key uniquely identifies a row in a table?
Correct Answer
A. Primary
Explanation
The primary key uniquely identifies a row in a table. It is a column or a combination of columns that have a unique value for each row in the table. This key is used to ensure data integrity and to establish relationships between tables in a database.
23.
Which statement creates a composite key?
Correct Answer
D. Option D
Explanation
Option D creates a composite key. A composite key is a key that consists of two or more columns in a database table. In this case, Option D is the only option that suggests the creation of a composite key.
24.
You have the following table definition:
CREATE TABLE Road -
(Road ID INTEGER NOT NULL,
Distance INTEGER NOT NULL)
The Road table contains the following data:
You execute the following statement:
INSERT INTO Road VALUES (1234, 36)
What is the result?
Correct Answer
B. A new row in the table
Explanation
The given statement "INSERT INTO Road VALUES (1234, 36)" is a valid SQL statement that inserts a new row into the Road table. The values provided for the Road ID and Distance columns are not NULL, so there will be no error stating that NULL values are not allowed. Since the table definition does not specify any constraints on duplicate IDs, there will be no error stating that duplicate IDs are not allowed. As the statement is syntactically correct, there will be no syntax error. Therefore, the result of executing this statement will be a new row added to the table.
25.
In SQL, an insert statement is used to add a
Correct Answer
B. Row of data to a table.
Explanation
An insert statement in SQL is used to add a row of data to a table. This means that when we want to add new information to an existing table, we use the insert statement to specify the values for each column in a new row. By doing so, we can effectively add new data to the table without altering its structure or adding new columns.
26.
The component that holds information for a single entry in a table is called a:
Correct Answer
B. Row
Explanation
A row is the correct answer because it represents a single entry in a table. In a database, a table is made up of rows and columns, with each row containing specific information related to a particular entry. Therefore, a row holds information for a single entry in a table.
27.
Which command should you use to add a column to an existing table? Which one do you like?
Correct Answer
A. ALTER.
Explanation
To add a column to an existing table, the ALTER command should be used. The ALTER command allows for the modification of the structure of a table, including adding, modifying, or deleting columns. In this case, the ALTER command would be used to add a new column to the existing table. INSERT, CHANGE, MODIFY, and UPDATE are not appropriate commands for adding a column to a table.
28.
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?
Correct Answer
D. 3
Explanation
The statement "SELECT Name FROM Product WHERE Quantity IS NOT NULL" will return 3 rows. This is because it is selecting the "Name" column from the "Product" table where the "Quantity" column is not null. Since there are 3 rows in the table where the "Quantity" column is not null, those 3 rows will be returned as the result.
29.
Which keyword would you use in a select statement to return rows that meet a specific condition?
Correct Answer
A. WHERE
Explanation
The keyword "WHERE" is used in a select statement to filter the rows and return only those that meet a specific condition. It allows you to specify criteria that the rows must meet in order to be included in the result set.
30.
A database contains two tables named Customer and Order.
You execute the following statement:
DELETE FROM Order -
WHERE Customer ID = 209 -
What is the result?
Correct Answer
A. All orders for Customer ID 209 are deleted from the Order table.
Explanation
The statement "DELETE FROM Order - WHERE Customer ID = 209 -" will delete all orders for Customer ID 209 from the Order table.
31.
You have a table that contains information about all students in your school.
Which SQL keyword should you use to change a student's first name in the table?
Correct Answer
A. UPDATE
Explanation
The correct answer is UPDATE. The UPDATE keyword is used in SQL to modify or change existing records in a table. In this case, if you want to change a student's first name in the table, you would use the UPDATE keyword along with the appropriate syntax to specify the table, column, and new value for the first name.
32.
Which command should you use to remove a table from a database?
Correct Answer
A. DROP TABLE
Explanation
The command "DROP TABLE" should be used to remove a table from a database. This command allows the user to delete a table and all its associated data from the database. It is specifically designed for removing tables and is the correct choice for this task.
33.
You have a table named Product. The Product table has columns for Product Description and Product Category.
You need to change the Product Category value for all the spoons in the Product table to 43.
Which statement should you use?
Correct Answer
A. Option A
Explanation
Option A is the correct answer because it suggests using an UPDATE statement to change the Product Category value for all the spoons in the Product table to 43.
34.
You have a table named Employee that includes the following columns:
Employee ID -
Smp1oyeeName -
Which statement should you use to return the number of rows in the table?
Correct Answer
D. Select Count *
From Employee
Explanation
The correct answer is "Select Count * From Employee". This statement uses the COUNT function to return the number of rows in the table "Employee". The "*" inside the COUNT function means that it will count all rows in the table.
35.
The Product table contains the following data.
You execute the following statement:
SELECT COUNT(*)
FROM Product WHERE Quantity > 18
What is the value returned by this statement?
Correct Answer
C. 3
Explanation
The value returned by the statement is 3. This is because the statement is counting the number of rows in the Product table where the Quantity is greater than 18. So, it is returning the count of products that have a quantity greater than 18, which is 3.
36.
21 - Which category of SQL statements is used to add, remove, and modify database structures?
Correct Answer
A. Data definition language (DDL)
Explanation
The correct answer is Data definition language (DDL). DDL statements are used to add, remove, and modify database structures such as tables, indexes, and constraints. Examples of DDL statements include CREATE, ALTER, and DROP. DCL statements are used to control access and permissions to the database. DML statements are used to manipulate data within the database, such as INSERT, UPDATE, and DELETE. DAL is not a recognized category of SQL statements.
37.
Data in a database is stored in:
Correct Answer
D. Tables
Explanation
Data in a database is stored in tables. Tables are the basic structure used to organize and store data in a database. Each table consists of rows and columns, where each row represents a record and each column represents a field or attribute of that record. Tables provide a structured way to store and retrieve data efficiently, making them a fundamental component of any database system.
38.
Which two keys establish a relationship between two tables? (Choose two.)
Correct Answer(s)
A. Primary
D. Foreign
Explanation
Primary and foreign keys are used to establish relationships between two tables in a relational database. The primary key is a unique identifier for each record in a table and is used to ensure data integrity and enforce referential integrity. The foreign key is a field in one table that refers to the primary key in another table, creating a link between the two tables. This allows for the establishment of relationships and the ability to retrieve related data from multiple tables using join operations.
39.
You have a table named Product that contains the following data.
The PrcducrID column is the primary key. The CategoryID column is a foreign key to a separate table named Category.
You execute the following statement:
INSERT INTO Product -
VALUES (3296, 'Table', 4444)
What is the result?
Correct Answer
A. A primary key constraint violation
Explanation
The given statement is trying to insert a new row into the "Product" table with a ProductID of 3296, a ProductName of 'Table', and a CategoryID of 4444. However, the ProductID column is defined as the primary key in the table, which means it must be unique for each row. Since there is already a row in the table with a ProductID of 3296, the statement will result in a primary key constraint violation.
40.
Which keyword must be included in a create view statement?
Correct Answer
D. SELECT
Explanation
The keyword that must be included in a create view statement is SELECT. This is because the SELECT keyword is used to specify the columns and data that will be included in the view. The SELECT statement is essential in defining the data that will be displayed when the view is queried.
41.
You need to remove a view named EmployeeView from your database.
Which statement should you use?
Correct Answer
D. DROP VIEW EmployeeView
Explanation
To remove a view named EmployeeView from the database, the correct statement to use is "DROP VIEW EmployeeView". The DROP VIEW command is used to delete a view from the database. The other options, DELETE VIEW EmployeeView, DELETE EmployeeView, and DROP EmployeeView, are incorrect as they do not follow the correct syntax for removing a view.
42.
A named group of SQL statements that can be executed in a database is called a:
Correct Answer
A. Stored procedure
Explanation
A stored procedure is a named group of SQL statements that can be executed in a database. It is a precompiled collection of SQL statements that can be called by name to perform a specific task or set of tasks. Stored procedures are commonly used to encapsulate complex logic and calculations, improve performance by reducing network traffic, and enhance security by controlling access to the underlying data. They can be called from various applications and can accept input parameters and return output values.
43.
You need to list the name and price of each product, sorted by price from highest to lowest.
Which statement should you use ?
Correct Answer
A. Option A
Explanation
Option A is the correct answer because it suggests using a statement or code that will allow you to list the name and price of each product, sorted by price from highest to lowest. This is the desired outcome according to the question prompt. Without any further information or context, it is difficult to provide a more specific explanation.
44.
You delete rows in a table named Order. The corresponding rows in the OrderItem table are automatically deleted. This process is an example of a/an:
Correct Answer
A. Cascade delete
Explanation
The process described in the question, where deleting rows in the "Order" table automatically deletes the corresponding rows in the "OrderItem" table, is known as a cascade delete. This refers to the cascading effect of the deletion, where the deletion operation propagates to related tables to maintain data integrity.
45.
You have a table named Employee that includes four columns.
You execute the following statement:
SELECT *
FROM Employee -
Which columns are returned?
Correct Answer
A. All columns
Explanation
When the statement "SELECT *" is executed, it retrieves all the columns from the table named Employee. Therefore, all columns from the Employee table will be returned as a result of this query.
46.
Which statement deletes the rows where the employee's phone number is not entered?
Correct Answer
A. Option A
Explanation
Option A is the correct answer because it implies that there is a statement that specifically targets and deletes the rows where the employee's phone number is not entered. This suggests that there is a condition or criteria being used to filter out the rows that do not have a phone number entered for the employee.
47.
You need to insert two new products into the Product table. The first product is named Book and has an ID of 125. The second product is named Movie and has an ID of 126.
Which statement should you use?
Correct Answer
B. Option B
Explanation
Option B is the correct statement to use for inserting the two new products into the Product table. It is likely that Option B contains the appropriate SQL syntax for inserting new records into the table, specifying the product names and IDs. However, without the actual content of Option B, it is not possible to provide a more specific explanation.
48.
What is one difference between an update statement and a delete statement?
Correct Answer
C. An update statement does not remove rows from a table.
Explanation
An update statement modifies the data in one or more rows of a table, but it does not remove any rows from the table. It allows for changing the values of specific columns in the existing rows. On the other hand, a delete statement is used to remove one or more rows from a table based on a specified condition. Therefore, the given answer correctly states that an update statement does not remove rows from a table.
49.
You need to delete a database table.
Which data definition language (DDL) keyword should you use?
Correct Answer
A. Drop
Explanation
To delete a database table, the correct DDL keyword to use is "Drop." The "Drop" keyword is used to remove an entire table from the database. It permanently deletes the table and all the data stored within it. This is different from other options like "Alter," which is used to modify the structure of a table, "Truncate," which is used to remove all the data from a table but keeps the structure intact, and "Delete," which is used to remove specific rows from a table but does not delete the entire table.
50.
On which database structure does an update statement operate?
Correct Answer
A. Table
Explanation
An update statement operates on a database structure called a table. A table is a collection of data organized in rows and columns. It is the primary structure used to store and manipulate data in a relational database. The update statement allows users to modify existing data in the table by changing the values of specific columns or rows.