In: Computer Science
SQL Program True/False Question
1. Which of the following is true of a many to many relationship? T/F
2. Security is rarely a concern for most databases. T/F
3. A security requirement refers to the need to restrict who can access some of the database data. T/F
4. Report requirements refer to the input forms the database will need. T/F
5. Insert permission is the permission to add records to the database. T/F
6. A trigger is code usually written in SQL which is triggered by a database event such as an insert or delete. T/F
7. A data requirement refers to the need to gather data about the database. T/F
8. One to one relationships are the most common relationship in a relational database. T/F
9. If you have an attribute that can have multiple values you should just number them 1, 2, 3, etc. T/F
10. Ideally every attribute in a database should have a unique name. T/F
11. Lookup entities have no effect on data consistency and integrity T/F
· Security is rarely a concern for most databases. T/F
False
· A security requirement refers to the need to restrict who can access some of the database data. T/F
True
Explanation- Features like multiple views offer security to some extent where users are unable to access data of other users and departments. DBMS offers methods to impose constraints while entering data into the database and retrieving the same at a later stage. DBMS offers many different levels of security features, which enables multiple users to have different views with different features. For example, a user in the Sales department cannot see the data that belongs to the Purchase department. Additionally, it can also be managed how much data of the Sales department should be displayed to the user. Since a DBMS is not saved on the disk as traditional file systems, it is very hard for miscreants to break the code.
· Report requirements refer to the input forms the database will need. T/F
True
Explanation-A database report is the formatted result of database queries and contains useful data for decision-making and analysis
· Insert permission is the permission to add records to the database. T/F
True
· A trigger is code usually written in SQL which is triggered by a database event such as an insert or delete. T/F
True
Explanation- A trigger is either a stored PL/SQL block or a PL/SQL, C, or Java procedure associated with a table, view, schema, or the database itself. Oracle Database automatically executes a trigger when a specified event takes place, which may be in the form of a system event or a DML statement being issued against the table.
And hence DML have following commands to manage data
1. SELECT – retrieve data from the a database
2. INSERT – insert data into a table
3. UPDATE – updates existing data within a table
4. DELETE – deletes all records from a table, the space for the records remain
5. MERGE – UPSERT operation (insert or update)
6. CALL – call a PL/SQL or Java subprogram
7. LOCK TABLE – control concurrency
Hence true.
· A data requirement refers to the need to gather data about the database. T/F
False
Explanation-The Data Requirements Document provides a detailed description of the data model that the system must use to fulfill its functional requirements. ... Describe the type of information required to document the characteristics of each data element
· One to one relationships are the most common relationship in a relational database. T/F
True
· If you have an attribute that can have multiple values you should just number them 1, 2, 3, etc. T/F
False
Explanation-for multivalued attribute t you need another entity. The only way to handle multiple values of the same attribute is to create an entity in which you can store multiple instances, one for each value of the attribute.
· Ideally every attribute in a database should have a unique name. T/F
True
Explanation-Relation
(table) must have a unique name.
Every attribute (field, column) must be atomic (not multivalued,
not composite).
Every row (record) must be unique
Attributes within a relation (table) must have unique names.
· Lookup entities have no effect on data consistency and integrity T/F
True