In: Computer Science
You are the DBA in the service of the British Royal Museum. You need to update the database of all Britons that have been knighted in the past. You want to build in a validation of the data to find all these people.
Which of the following metacharacter combinations would you use?
A. |
'Sir .' |
|
B. |
'Sir +' |
|
C. |
'Sir ?1' |
|
D. |
'Sir EG*1' |
ou query the database with this SQL statement:
SELECT *
FROM transaction;
For which purpose was this statement created?
A. |
to insert data into the TRANSACTION table |
|
B. |
to view the data in the TRANSACTION table |
|
C. |
to review the structure of the TRANSACTION table |
|
D. |
to delete selected data from the TRANSACTION table |
The four phases that indicate the different phases of SQL statement execution are as follows:
1. execute
2. fetch
3. parse
4. bind
Which option represents the correct sequence of events while executing a statement?
a. |
1, 2, 3, 4 |
|
b. |
2, 3, 4, 1 |
|
c. |
3, 4, 1, 2 |
|
d. |
4, 3, 1, 2 |
Which three statements about constraints are true? (Choose three.)
A. |
Constraints only enforce rules at the table level. |
|
B. |
Constraints prevent rows with dependencies from being deleted. |
|
C. |
You must provide a name for each constraint at the time of its creation. |
|
D. |
Constraint names are not required to follow the standard object-naming rules. |
|
E. |
Constraints can be created at the same time as the table or after the table is created. |
QUESTION 1 :
You are the DBA in the service of the British Royal Museum. You need to update the database of all Britons that have been knighted in the past. You want to build in a validation of the data to find all these people.
Which of the following metacharacter combinations would you use?
A. 'Sir .'
B. 'Sir +'
C. 'Sir ?1'
D. 'Sir EG*1'
Answer : Option A - 'Sir .'
Explanation : The option A is correct because to update Britons who have been knighted in the past that persons are represented with 'Sir .' So to find all these people in database metacharacter combination 'Sir .' is used to build the dat as valid.
QUESTION 2 :
ou query the database with this SQL statement:
SELECT *
FROM transaction;
For which purpose was this statement created?
A. to insert data into the TRANSACTION table
B. to view the data in the TRANSACTION table
C. to review the structure of the TRANSACTION table
D. to delete selected data from the TRANSACTION table
Answer : Option B - to view the data in the TRANSACTION table
Explanation : The Option B is correct because to view the data of entire table , "SELECT" is used in query to select the table and '*' is used to display all rows and columns of entire table, "from" is used to fetch particular table, "transaction" is a table name which is to be view. This query statement display the entire "transaction" table.
QUESTION 3 :
The four phases that indicate the different phases of SQL statement execution are as follows:
1. execute
2. fetch
3. parse
4. bind
Which option represents the correct sequence of events while executing a statement?
a. 1, 2, 3, 4
b. 2, 3, 4, 1
c. 3, 4, 1, 2
d. 4, 3, 1, 2
Answer : Option c - 3, 4, 1, 2
Explanation : The Option c is correct because the first step is "Parse" which checks the syntax of the statement and second step is "bind" which combines the different objects in a SQL query, and the third step is "execute" which runs the statement and last "fetch" which retrieves the results of a query.
QUESTION 4 :
Which three statements about constraints are true? (Choose three.)
A. Constraints only enforce rules at the table level.
B. Constraints prevent rows with dependencies from being deleted.
C. You must provide a name for each constraint at the time of its creation.
D. Constraint names are not required to follow the standard object-naming rules.
E. Constraints can be created at the same time as the table or after the table is created.
Answer : A, C, E,
Explanation : The Options A,C,E are correct statements about constraints. Constraints are the rules enforced at the table level only because constraints are applied to the particular columns in a table. A name must be provide at the time of constraint creation because it defines for which column it is to be applied. Constraints can be created at the time of table creation with "Create table" statement and it can also created even after the table is created by using "ALTER" keyword which is used to make changes to the table columns or rows.