The process of producing a description of the implementation of the database on secondary storage; it describes the base relations, file organization, and indexes design used to achieve efficient access to the data, and any associated integrity constraints and security measures.
What are the differences between conceptual and logical
Conceptual: The process of constructing the model is independent from all physical consideration.
Logical: The process of constructing the model is based on a specific data model, but independent of a particular DBMS and other physical consideration
How do you define the index on a column of a table
Index : a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random lookups and efficient access of ordered records.</li></ul>Please write a SQL statement about creating index<br />CREATE INDEX index_name ON table_name(column_name);<br /><ul><li>What are unary, binary, ternary, and quaternary? Give 1 example each
Unary relationships have only one participant-the relation is associated with itself. The classic example of a unary relationship is Employee to Manager. One's manager is, in most cases, also an employee with a manager of his or her own. It is also known as recursive relationship.
Binary relationships, the association between two entities is the most common type in the real world.
A ternary relationship involves three entities and is used when a binary relationship is inadequate. Many modeling approaches recognize only binary relationships. Ternary or n-ary relationships are decomposed into two or more binary relationships.
Quaternary relationships involve four entities. For example a professor teaches a course to students using slides. Here the four entities are professor, slides, course, and student. The relationship between the entities are Teaches. Another example:
How do you use subclass and super class in ERD?
Superclass: An entity type that includes distinct subclasses that requires to be represented in data model. It is also known as generalization.
Subclass: An entity type that has a distinct role and is also a member of superclass. It is also known as specialization.
Please describe 2 common problems when you design a database (example)
Insufficient domain memory</li></ul>Occurrence of connection traps such as fan trap and chasm trap.<br />Fan Trap occurs where a model represents a relationship between entity types, but pathways between certain entity occurrences is ambiguous.<br />Chasm Trap occurs where a model suggests the existence of a relationship between entity types, but pathway does not exist between certain entity occurrences.<br /><ul><li>What is normalization? How do you use functional dependency? (2NF/3NF)
Normalization is a technique for producing a set of suitable relation that supports the data requirements of an enterprise and to minimize data redundancy.
The functional dependency can be classified as : full functional dependency, partial functional dependency and also transitive functional dependency. It makes use of Functional Dependencies that exist in a table (relation, more formally) and the primary key or Candidate Keys in analyzing the tables.
B is fully dependent on A if B is functionally dependent on A but on any proper subset of A.</li></ul>3NF<br />Based on the concept of transitive dependency.<br />Transitive dependency is a condition where:<br />A, B, and C are attributes of a relation such that if A -> B and B -> C<br />Then C is transitively dependent on A through B. (Provided that A is not functionally dependent on B or C).<br /><ul><li>Please create ERD for the following questions:
A holding company has several company and each company has 4 departments
Every employee only work for 1 department and 1 department only can have 10 employee
Every company has only one main business and every company’s business is different from each other
Please create global ERD for the following question
Normalize the following table to 1NF, 2NF, and 3NF
1NF</li></ul>2NF<br />Property(propertyno, paddress)<br />Propertyinspection(propertyno,idate,itime,comments,staffno,sname,carreg)<br />3NF<br />Property(propertyno,paddress)<br />Staff(staffno,sname)<br />Propertyinspection(propertyno, idate,itime,comments,staffno,carreg)<br /><ul><li>How the DBS run the query processing?
DBMS QUERY prepares the SQL statement (in general, one that returns rows) by indicating to the database engine where to put return data (if any), and then tells the database to execute the SQL statement.This command is used for statements, either SQL SELECT statements or stored procedures, that return data. For statements that do not return data, use DBMS RUN. Example :
DBMS QUERY SELECT title_id, name, dir_first_name, dir_last_name FROM table_name
A database transaction is a logical unit of database operation which is executed as a whole to process user requests for retrieving data or updating the database. An SQL transaction automatically begins with a transaction-initialing SQL statement (eg. SELECT, INSERT).
How to ensure the integrity while executing transactions?
Concurrency control techniques that include locking(e.q deadlock detection adn recovery) and time stamping. The concurrency control schedules transactions to avoid any interference. Secondly serializability identifies executions of transactions to ensure consistency
What are the property of transaction?</li></ul>The properties of database transactions are summed up with the acronym ACID:<br />Atomicity - all or nothing<br />All of the tasks (usually SQL requests) of a database transaction must be completed;<br />If incomplete due to any possible reasons, the database transaction must be aborted.<br />Consistency - serializability and integrity<br />The database must be in a consistent or legal state before and after the database transaction. It means that a database transaction must not break the database integrity constraints.<br />Isolation<br />Data used during the execution of a database transaction must not be used by another database transaction until the execution is completed. Therefore, the partial results of an incomplete transaction must not be usable for other transactions until the transaction is successfully committed. It also means that the execution of a transaction is not affected by the database operations of other concurrent transactions.<br />Durability<br />All the database modifications of a transaction will be made permanent even if a system failure occurs after the transaction has been completed.<br />