click below
click below
Normal Size Small Size show me how
Database lesson 7
CompTia Dababase Design & MySQL Lesson 7
| Question | Answer |
|---|---|
| Which DDL command is used to create a relation? | CREATE TABLE |
| Which of the following statements will create a base relation named Producers? | CREATE TABLE Producers (p_num INTEGER NOT NULL PRIMARY KEY, p_name VARCHAR (50)); |
| Which of the following is true of the physical design phase for a database? | It is largely dependent on the DBMS selected |
| Consider the DDL statement shown in the exhibit. CREATE TABLE Sales Reps (s_num INTEGER NOT NULL PRIMARY KEY, s_first_name VARCHAR (25) NOT NULL, s_last_name VARCHAR (25) NOT NULL) | The statement will fail to execute properly due to syntax errors. The statement will fail to execute properly because there is a blank space in the table name and because the statement is missing a semicolon (;) at the end of the last line. |
| Which of the following is true of secondary indexes? | If a particular attribute is updated often, it may not be a good candidate for a secondary index. |
| Consider the DDL statement shown in the exhibit. CREATE TABLE Sales_Reps (s_num INTEGER NOT NULL PRIMARY KEY, s_first_name VARCHAR (25) NOT NULL, s_last_name VARCHAR (25) NOT NULL); | The resulting table will include three attributes. |
| Consider the relation and the view shown in the exhibit. Which of the following SQL statements will correctly create the view? | CREATE VIEW emp_view AS SELECT id, first_name, last_name, title, loc_num FROM Employee WHERE loc_num = '1004'; |
| Consider the DDL statement shown in the exhibit: CREATE INDEX genre_index ON Items(i_genre); What does this DDL statement accomplish? | It creates a secondary index on the i_genre attribute. |
| Which activity occurs during the physical design phase of a database? | Schemas and relations are created |
| What is denormalization? | Denormalization is the process of reuniting relations that were split when they underwent the normalization process. |
| Generally, denormalization will involve the duplication of attributes in relations or joining relations together to decrease the occurrences of join operations required to fetch data. Maintaining a database can be more difficult after denormalization beca | |
| Consider the relation and the view shown in the exhibit. Which of the following SQL statements will correctly create the view? | CREATE VIEW emp_view AS SELECT id, first_name, last_name, title, loc_num FROM Employee; |
| Susan is adding data to the table and tries to enter a record for a sales rep working at location_num 'AB105.' What will happen when Susan tries to insert the new record? | The insert operation will be disallowed. |
| During this design phase, the cardinality of all relationships is examined, many-to-many relationships are resolved through decomposition and the resulting data model is normalized. Which design phase has been described? | The logical design phase |
| Which of the following is true of denormalization? | Denormalization can decrease the number of join operations required to fetch data. |
| The statement will fail to execute properly because the closing parenthesis has been omitted. | The statement will fail to execute because of a syntax error. |
| Joe creates a relation called Game_Scores. Joe grants Jeff privileges on the Game_Scores relation using the following SQL statement: GRANT SELECT ON Game_Scores To Jeff; Which of the following statements is true? | Joe has full privileges for the Game_Scores relation and Jeff can view the data but not update it in any way. ( |
| A user who creates a relation with the CREATE TABLE statement automatically owns that relation. That user has full privileges for that relation. | Users other than the creator of the relation must be granted privileges to perform data operations on the relation. |
| Joe creates a relation called Game_Scores. Joe grants Jeff privileges on the Game_Scores relation using the following SQL statement: GRANT ALL PRIVILEGES ON Game_Scores To Jeff; Which of the following statements is true? | Jeff can execute all operations against the Game_Scores relation, but cannot grant privileges on the relation to other users. |
| Why should a size argument be specified when assigning a data type of CHAR or VARCHAR? | To ensure that the field will be large enough to hold the appropriate data |
| Modifications to LOCATIONS(location_num) are automatically reflected in changes to EMPLOYEES(location_num). A deletion can occur in LOCATIONS(location_num) only when there are no EMPLOYEES(location_num) records referencing the parent record. | What are the referential constraints for the relations defined here? |
| Which DDL command is used to create a secondary index? | CREATE INDEX |
| Joe creates a relation called Game_Scores. Joe grants Jeff privileges on the Game_Scores relation using the following SQL statement: GRANT ALL PRIVILEGES ON Game_Scores To Jeff WITH GRANT OPTION; Which of the following statements is true | Jeff can grant privileges on the Game_Scores relation to other users. |
| During which phase of database design might a designer choose to denormalize relations in order to improve performance? | PHYSICAL |
| Consider the relation shown in the exhibit. A database manager wants to set up a view called Mobile_Numbers that allows a user to find a student's first name, last name and cell phone number. Which SQL statement will accomplish this? | CREATE VIEW Mobile_Numbers AS SELECT first_name, last_name, cell_phone FROM Student; |
| Consider the following exhibit of DBDL code.Sales_Reps(s_num: integer NOT NULL,s_first_name: variable length character string length 25 NOT NULL s_last_name: variable length character string length 25 NOT NULL) Primary Key: s_num | Which DDL statement will accurately create the table described in the DBDL code shown in the exhibit? |
| Which DDL statement will accurately create the table described in the DBDL code shown in the exhibit? | CREATE TABLE Sales_Reps (s_num INTEGER NOT NULL PRIMARY KEY, s_first_name VARCHAR (25) NOT NULL, s_last_name VARCHAR (25) NOT NULL); |
| Why can table names contain no blank spaces? |