0% found this document useful (0 votes)
7 views

ITS_DATABSE_43Qs

The document contains a series of questions and answers related to database concepts, SQL commands, and data manipulation. Key topics include defining columns, data types, indexing, normalization, and SQL commands such as INSERT, UPDATE, and DELETE. The answers provide insights into best practices for managing and querying databases effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

ITS_DATABSE_43Qs

The document contains a series of questions and answers related to database concepts, SQL commands, and data manipulation. Key topics include defining columns, data types, indexing, normalization, and SQL commands such as INSERT, UPDATE, and DELETE. The answers provide insights into best practices for managing and querying databases effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1.Which two elements are required to define a column? (Choose two.

)
A. A name
B. A key
C. An index
D. A data type
Answer : A D

2. What defines the amount of storage space that is allocated to a value in a column?

A. format
B. key
C. data type
D. validator
Answer : C

3. 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?
A. CHAR
B. BYTE
C. DOUBLE
D. SMALLINT
Answer : A

4. What is one difference between an update statement and a delete statement?


A. An update statement can change only one row.
B. A delete statement cannot use a where clause.
C. An update statement does not remove rows from a table.
D. A delete statement works only within a stored procedure.
Answer : C

5.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. A primary key
B. An index
C. A foreign key
D. A unique constraint
E. A data type
Answer : C

6. You need to store the first name, last name, and student ID for 100 students.
This information will be stored in a table as:
A. 100 items and three cells.
B. 100 rows and three columns.
C. three rows and 100 columns.
D. three items and 100 cells.
Answer : B
7. What are three valid data manipulation language (DML) commands? (Choose three.)
A. INSERT
B. COMMIT
C. DELETE
D. OUTPUT
E. UPDATE
Answer : ACE
Explanation:
Data manipulation languages have their functional capability organized by the initial word in a statement,
which is almost always a verb. In the case of SQL, these verbs are:
✑ SELECT ... FROM ... WHERE ...
✑ INSERT INTO ... VALUES ...
✑ UPDATE ... SET ... WHERE ...
✑ DELETE FROM ... WHERE ...

8. You assign User1 a set of permissions that include the WITH GRANT OPTION.
The WITH GRANT OPTION enables User1 to:

A. request a log of permission use.


B. delegate permissions to other users.
C. create new database users.
D. view other users' permissions.
Answer : C

9. Which type of index changes the order in which the data is stored in a table?
A. non-sequential
B. sequential
C. non-clustered
D. clustered
Answer : A

10. Which statement should you use to remove a foreign key?


A. ALTER TABLE
B. DELETE TABLE
C. DELETE FOREIGN KEY
D. ALTER FOREIGN KEY
Answer : A

11. First normal form requires that a database excludes:


A. Foreign keys
B. Composite keys
C. Duplicate rows
D. Repeating groups
Answer : D
12. You execute a statement inside a transaction to delete 100 rows from a table. The transaction fails
after only 40 rows are deleted.

What is the result in the database?


A. The table will be corrupted.
B. Forty (40) rows will be deleted from the table.
C. The transaction will restart.
D. No rows will be deleted from the table
Answer : D

13.You have a table that contains product IDs and product names.
You need to write an UPDATE statement to change the name of a specific product to glass.
What should you include in the update statement?

A. SET ProductName = 'glass'


B. LET ProductName = 'glass'
C. EXEC ProductName = 'glass'
D. ASSIGN ProductName = 'glass'

14.Your database contains a table named Customer. You need to delete the record from the Customer
table that has a CusromerID of 12345.
Which statement should you use?

A. Option A
B. Option B
C. Option C
D. Option D
15. On which database structure does an insert statement operate?
A. Role
B. Trigger
C. User
D. Stored procedure
E. Table
Answer : E

16. The terms "bitmap," "b-tree," and "hash" refer to which type of database structure?
A. View
B. Function
C. Index
D. Stored procedure
E. Trigger
Answer : C

17. One reason to add an index is to:


A. Decrease storage space.
B. Increase database security.
C. Improve performance of select statements.
D. Improve performance of insert statements.
Answer : C

18. You have a table that contains the following data.

You break the table into the following two tables.

This process is referred to as:


A. defragmentation
B. normalization
C. fragmentation
D. denormalization
Answer : B
19. You have a table that contains the following data.

Which database term is used to describe the relationship between ProductID and ProductCategory?
A. Cohort
B. Relationally dependent
C. Deterministic
D. Functionally dependent
E. Compositional
Answer : D

20. Which key uniquely identifies a row in a table?


A. foreiqn
B. primary
C. local
D. superkey
Answer : B

21. Which statement creates a composite key?

A. Option A C. Option C
B. Option B D. Option D Answer : D
22. 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?

A. The Customer table no longer exists.


B. The Customer table is unaffected.
C. The Customer table exists but has no data.
D. The script fails.
Answer : A

22. In which situation do you need to perform a restore on a database?

A. when data becomes corrupted in the database


B. when you need to roll back a transaction
C. when you encounter an error in your application
D. when data needs to be deleted from the database
Answer : A

23. Which command should you use to give a user permission to read the data in a table?
A. ALLOW SELECT
B. LET READ
C. PERMIT READ
D. GRANT SELECT
Answer : D

24. You need to enable a new employee to authenticate to your database.


Which command should you use?
A. ALLOW USER
B. CREATE USER
C. ADD USER
D. INSERT USER
E. ALTER USER
Answer : B

25. Which keyword can be used in a create table statement?


A. ORDER BY
B. DISTINCT
C. GROUP BY
D. UNIQUE
Answer : D

26. 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?
A. INTEGER
B. DOUBLE
C. COUNT
D. FLOAT Answer : A
27.Which statement will result in the creation of an index?

A. Option A
B. Option B
C. Option C
D. Option D
Answer : A

28. CREATE TABLE Road -


(RoadID 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?
A. an error stating that NULL values are not allowed
B. a new row in the table
C. an error stating that duplicate IDs are not allowed
D. a syntax error
Answer : B

29. 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?
A. VARCHAR (3, 30)
B. CHAR (3, 30)
C. VARCHAR (30)
D. CHAR (30)
Answer : C
30. One reason to create a stored procedure is to:
A. Improve performance.
B. Minimize storage space.
C. Bypass case sensitivity requirements.
D. Give the user control of the query logic.
Answer : A

31. Which permission does a user need in order to run a stored procedure?
A. EXECUTE
B. ALLOW
C. CALL
D. RUN
Answer : A

31. 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:
A. Empty
B. Deleted
C. Unchanged
D. Archived
Answer : A

32.In SQL, an insert statement is used to add a:


A. User to a database.
B. Row of data to a table.
C. Table to a database.
D. Column to a table definition.
Answer : B

33. You have two tables. Each table has three rows.
How many rows will be included in the Cartesian product of these two tables?
A. 0
B. 3
C. 6
D. 9
Answer : D

34. You are writing an SQL statement to retrieve rows from a table.
Which data manipulation language (DML) command should you use?
A. READ
B. SELECT
C. OUTPUT
D. GET
Answer : B
35. Which constraint ensures a unique value in the ID column for each customer?
A. DISTINCT
B. FOREIGN KEY
C. SEQUENTIAL
D. PRIMARY KEY
Answer : D

36. The component that holds information for a single entry in a table is called a:
A. Data type
B. Row
C. Column
D. View
Answer : B

37. You execute the following statement: SELECT EmployeeID, FirstName, DepartmentName FROM
Employee, Department -
This type of operation is called a/an:
A. Intersection
B. Outer join
C. Equi-join
D. Cartesian product
Answer : D

38. Which command should you use to add a column to an existing table?
A. MODIFY
B. ALTER
C. UPDATE
D. INSERT
E. CHANGE
Answer : B

39. 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?

A. 0 E. 4
B. 1
C. 2 Answer : D
D. 3
40. 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?
A. FIND
B. BETWEEN
C. INCLUDES
D. LIKE
Answer : D

41. A database contains two tables named Customer and Order.


You execute the following statement:
DELETE FROM Order -
WHERE CustomerID = 209 –
What is the result?

A. The first order for CustomerID 209 is deleted from the Order table.
B. All orders for CustomerID 209 are deleted from the Order table, and CustomerID 209 is deleted from
the Customer table.
C. All orders for CustomerID 209 are deleted from the Order table.
D. CustomerID 209 is deleted from the Customer table.
Answer : C

42. You have a table named Product. The Product table has columns for ProductDescription and
ProductCategory.
You need to change the ProductCategory value for all the spoons in the Product table to 43.
Which statement should you use?

A. Option A C. Option C
B. Option B D. Option D Answer : A
43. 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?
A. UPDATE
B. CHANGE
C. SELECT
D. INSERT
Answer : A

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy