post no 35 Algorithms for Decomposition


Database Questions and Answers – Algorithms for Decomposition

1. A relation is in ____________ if an attribute of a composite key is dependent on an attribute of other composite key.
a) 2NF
b) 3NF
c) BCNF
d) 1NF

Answer: b
Explanation: A relation is in 3 NF if an attribute of a composite key is dependent on an attribute of other composite key. (If an attribute of a composite key is dependent on an attribute of other composite key then the relation is not in BCNF, hence it has to be decomposed.).
2. What are the desirable properties of a decomposition
a) Partition constraint
b) Dependency preservation
c) Redundancy
d) Security

Answer: b
Explanation: Lossless join and dependency preserving are the two goals of the decomposition.
3. R (A,B,C,D) is a relation. Which of the following does not have a lossless join dependency preserving BCNF decomposition.
a) A-> B, B-> CD
b) A->B, B->C, C->D
c) AB->C, C->AD
d) A->BCD

Answer: d
Explanation: This relation gives a relation without any loss in the values.
Class (course id, title, dept name, credits, sec id, semester, YEAR, building, room NUMBER, capacity, TIME slot id)
The SET OF functional dependencies that we require TO hold ON class are:
course id->title, dept name, credits
building, room number->capacity
course id, sec id, semester, year->building, room NUMBER, TIME slot id
A candidate KEY FOR this schema IS {course id, sec id, semester, YEAR}
4. Consider the above conditions. Which of the following relation holds ?
a) Course id-> title, dept name, credits
b) Title-> dept name, credits
c) Dept name-> credits
d) Cannot be determined

Answer: a
Explanation: Here course id is not a superkey. Thus, class is not in BCNF.
5. The algorithm that takes a set of dependencies and adds one schema at a time, instead of decomposing the initial schema repeatedly is
a) BCNF algorithm
b) 2NF algorithm
c) 3NF synthesis algorithm
d) 1NF algorithm

Answer: c
Explanation: The result is not uniquely defined, since a set of functional dependencies can have more than one canonical cover, and, further, in some cases, the result of the algorithm depends on the order in which it considers the dependencies in Fc .
6. The functional dependency can be tested easily on the materialized view, using the constraints ____________.
a) Primary key
b) Null
c) Unique
d) Both Null and Unique

Answer: d
Explanation: Primary key contains both unique and not null constraints .
7. Which normal form is considered adequate for normal relational database design?
a) 2NF
b) 5NF
c) 4NF
d) 3NF

Answer: d
Explanation: A relational database table is often described as “normalized” if it is in the Third Normal Form because most of the 3NF tables are free of insertion, update, and deletion anomalies .
8. Relation R with an associated set of functional dependencies, F, is decomposed into BCNF. The redundancy (arising out of functional dependencies) in the resulting set of relations is
a) Zero
b) More than zero but less than that of an equivalent 3NF decomposition
c) Proportional to the size of F+
d) Indeterminate

Answer: b
Explanation: Redundancy in BCNF is low when compared to 3NF. For more details on BCNF .
9. A table has fields F1, F2, F3, F4, and F5, with the following functional dependencies:

F1->F3
F2->F4
(F1,F2)->F5
in terms of normalization, this table is in
a) 1NF
b) 2NF
c) 3NF
d) None of the mentioned

Answer: a
Explanation: Since the primary key is not given we have to derive the primary key of the table. Using the closure set of attributes we get the primary key as (F1,F2). From functional dependencies, “F1->F3, F2->F4”, we can see that there is partial functional dependency therefore it is not in 1NF. Hence the table is in 1NF.

10. Let R(A,B,C,D,E,P,G) be a relational schema in which the following FDs are known to hold:

AB->CD
DE->P
C->E
P->C
B->G
The relation schema R is
a) in BCNF
b) in 3NF, but not in BCNF
c) in 2NF, but not in 3NF
d) not in 2NF


Answer: d
Explanation: From the closure set of attributes we can see that the key for the relation is AB. The FD B->G is a partial dependency, hence it is not in 2NF.

Post No 34 Functional-Dependency

Database Questions and Answers – Functional-Dependency

1. We can use the following three rules to find logically implied functional dependencies. This collection of rules is calleda) Axiomsb) Armstrong’s axiomsc) Armstrongd) Closure
Answer: bExplanation: By applying these rules repeatedly, we can find all of F+, given F.2. Which of the following is not a Armstrong’s Axiom ?a) Reflexivity ruleb) Transitivity rulec) Pseudotransitivity ruled) Augmentation rule

Answer: cExplanation: It is possible to use Armstrong’s axioms to prove that Pseudotransitivity rule is sound.3. The relation employee(ID,name,street,Credit,street,city,salary) is decomposed into
employee1 (ID, name)employee2 (name, street, city, salary)This type of decomposition is calleda) Lossless decompositionb) Lossless-join decompositionc) Both a and bd) None of the mentioned

Answer: dExplanation: Lossy-join decomposition is the decomposition used here .4. Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into
instructor (ID, name, dept name, salary)department (dept name, building, budget)This comes undera) Lossy-join decompositionb) Lossy decompositionc) Lossless-join decompositiond) Both a and b

Answer: dExplanation: Lossy-join decomposition is the decomposition used here .5. There are two functional dependencies with the same set of attributes on the left side of the arrow:A->BCA->BThis can be combined asa) A->BCb) A->Bc) B->Cd) None of the mentioned

Answer: aExplanation: This can be computed as the canonical cover .6. Consider a relation R(A,B,C,D,E) with the following functional dependencies:
ABC -> DE andD -> ABThe number of superkeys of R is:a) 2b) 7c) 10d) 12

Answer: cExplanation: A superkey is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table.7. Suppose we wish to find the ID’s of the employees that are managed by people who are managed by the employee with ID 123. Here are two possible queries:
I.SELECT ee.empID  FROM Emps ee, Emps ff  WHERE ee.mgrID = ff.empID AND ff.mgrID = 123;II.SELECT empID  FROM Emps   WHERE mgrID IN  (SELECT empID FROM Emps WHERE mgrID = 123);Which, if any, of the two queries above will correctly (in SQL2) get the desired set of employee ID’s?a) Both I and IIb) I onlyc) II onlyd) Neither I nor I

Answer: aExplanation: The query can be satisfied by any of the two options.8. Suppose relation R(A,B) currently has tuples {(1,2), (1,3), (3,4)} and relation S(B,C) currently has {(2,5), (4,6), (7,8)}. Then the number of tuples in the result of the SQL query:
<i>SELECT * FROM R NATURAL OUTER JOIN S; </i>IS:a) 2b) 4c) 6d) None of the mentioned

Answer: aExplanation: The SQL NATURAL JOIN is a type of EQUI JOIN and is structured in such a way that, columns with same name of associate tables will appear once only.9. Suppose now that R(A,B) and S(A,B) are two relations with r and s tuples, respectively (again, not necessarily distinct). If m is the number of (not necessarily distinct) tuples in the result of the SQL query:
R intersect S;
Then which of the following is the most restrictive, correct condition on the value of m?
(a) m = min(r,s)(b) 0 <= m <= r + s(c) min(r,s) <= m <= max(r,s)(d) 0 <= m <= min(r,s)

Answer: dExplanation: The value of m must lie between the min value of r and s and 0.10. Suppose relation R(A,B,C,D,E) has the following functional dependencies:
A -> BB -> CBC -> AA -> DE -> AD -> EWhich of the following is not a key?a) Ab) Ec) B,Cd) D

Answer: cExplanation: Here the keys are not formed by B and C.

Post No 33 Normal Forms

Database Questions & Answers – Normal Forms
1. In the __________ normal form, a composite attribute is converted to individual attributes.
A) First
B) Second
C) Third
D) Fourth
Answer: A
Explanation: The first normal form is used to eliminate the duplicate information.
2. A table on the many side of a one to many or many to many relationship must:
a) Be in Second Normal Form (2NF)
b) Be in Third Normal Form (3NF)
c) Have a single attribute key
d) Have a composite key
Answer: d
Explanation: The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key.
3. Tables in second normal form (2NF):
a) Eliminate all hidden dependencies
b) Eliminate the possibility of a insertion anomalies
c) Have a composite key
d) Have all non key fields depend on the whole primary key
Answer: a
Explanation: The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key.
4. Which-one ofthe following statements about normal forms is FALSE?
a) BCNF is stricter than 3 NF
b) Lossless, dependency -preserving decomposition into 3 NF is always possible
c) Loss less, dependency – preserving decomposition into BCNF is always possible
d) Any relation with two attributes is BCNF
Answer: c
Explanation: We say that the decomposition is a lossless decomposition if there is no loss of information by replacing r (R) with two relation schemas r1(R1) andr2(R2).
5. Functional Dependencies are the types of constraints that are based on______
a) Key
b) Key revisited
c) Superset key
d) None of the mentioned
Answer: a
Explanation: Key is the basic element needed for the constraints.
6. Which is a bottom-up approach to database design that design by examining the relationship between attributes:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
Answer: c
Explanation: Normalisation is the process of removing redundancy and unwanted data.
7. Which forms simplifies and ensures that there is minimal data aggregates and repetitive groups:
a) 1NF
b) 2NF
c) 3NF
d) All of the mentioned
Answer: c
Explanation: The first normal form is used to eliminate the duplicate information.
8. Which forms has a relation that possesses data about an individual entity:
a) 2NF
b) 3NF
c) 4NF
d) 5NF
Answer: c
Explanation: A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X \twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof.
9. Which forms are based on the concept of functional dependency:
a) 1NF
b) 2NF
c) 3NF
d) 4NF
Answer: c
Explanation: The table is in 3NF if every non-prime attribute of R is non-transitively dependent (i.e. directly dependent) on every superkey of R.
10. Empdt1(empcode, name, street, city, state,pincode).
For any pincode, there is only one city and state. Also, for given street, city and state, there is just one pincode. In normalization terms, empdt1 is a relation in
a) 1 NF only
b) 2 NF and hence also in 1 NF
c) 3NF and hence also in 2NF and 1NF
d) BCNF and hence also in 3NF, 2NF and 1NF
Answer: b
Explanation: The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key.

Post no 32 Recent Number Series


Recent Number Series

Q1. : 4, 17, 40, 71, 108, ?
Q2. : 24, 10, 8, 10, 18, ?
Q3. : 6, 14, 45, 184, ?
Q4. : 17, 38, 80, 164, ?
Q5. : 5, 18, 57, 174, ?
Q6. : 6, 5, 7, 12.5, 27,-----
Q7. : 3, 18, 35, 56, 83,-----
Q8. : 7, 6, 10, 27,------, 515
Q9. : 45, 49, 40, 56, 31,------
Q10. : 11, 29, 65, 137,------, 369
Q11. : 7, 21, 5, 23, ?
Q12. : 15, 22, 32, 46, 65, ?
Q13. : 9, 10, 18, 27, 91, ?
Q14. : 17, 23, 35, 59, ?, 203
Q15. : 6, 7, 16, 51, 208, ?
Q16. : 11, 12, 26, 81, 328, ?
Q17. : 4, 11, 24, 44, 72, ?
Q18. : 11, 12, 20, 29, 93, ?
Q19. : 17, 25, 15, 27, 13, ?
Q20. : 13, 21, 37, 69, ?, 261
Q21. : 7, 16, 30, 49, 73, ?
Q22. : 8, 7, 12, 33, 128, ?
Q23. : 23, 29, 17, 35, 11, ?
Q24. : 9, 11, 20, 48, ?, 239
Q25. : 113, 116, 107, 134, 53 ?
Q26. : 7, 12, 33, 128, 635, ?

Post 30 IEEE STANDARDS

IEEE STANDARDS
802.1 Related to Network Architecture
802.2 Defines LLC
802.3 Ethernet
802.4 Token Bus
802.5Token Ring
802.6 MAN
802.7 Broadband LAN using coaxial cable
802.11 wiFi
802.15 Wireless PAN
802.15.1 Bluetooth
Types of CLASSES
CLASS A 0-127 2^7 LAN 2^24 Computers undereach LAN
CLASS B 128-191 2^14 LAN 2^16
CLASS C 192-223 2^21 LAN 2^8
CLASS D 224-239
CLASS E 240-255
CLASS A,B,C are mostly used for unicast communication
CLASS D are used for multicast Communication
PORT NUMBERS
20-FTP data (File Transfer Protocol)
21-FTP Control(File Transfer Protocol)
22-SSH (Secure Shell)
23-Telnet
25 -SMTP(Simple Mail Transfer Protocol)
43-whois
53-DNS (Domain Name Service)
68-DHCP (Dynamic Host Configuration Protocol)
79-Finger
80-HTTP (HyperText Transfer Protocol)
110-POP3 (Post Office Protocol, version 3)
115-SFTP (Secure File Transfer Protocol)
119-NNTP (Network New Transfer Protocol)
123-NTP (Network Time Protocol)
137-NBNS (NetBios naming service)
138-NetBiosDatagram Service
139-NetBIOS Session service
143-IMAP (Internet Message Access Protocol)
161-SNMP (Simple Network Management Protocol)
194-IRC (Internet Relay Chat)
220-IMAP3 (Internet Message Access Protocol 3)
443-SSL (Secure Socket Layer)
445-SMB (NetBIOS over TCP) Server message block
993-SIMAP (Secure Internet Message Access Protocol)
3389-RDP(RemoteDesktop Protocol)

Post 29 OS MCQ

  1. Which of the following is a dynamic scheduling algorithm used in real-time operating systems to place processes in a priority queue?
    A. Earliest deadline first (EDF)
    B. First-Come First-Serve Scheduling(FCFS)
    C. Round Robin Scheduling(RRS)
    D. Multilevel Queue Scheduling(MQS)
    E. None of these
    Answer & Explanation
    A. Earliest deadline first (EDF)
    Explanation:
    Earliest deadline first (EDF) or least time to go is a dynamic scheduling algorithm used in real-time operating systems to place processes in a priority queue.
  2. Which of the following is the module that gives control of the CPU to the process selected by the scheduler?
    A. Device Driver
    B. Scheduler
    C. Dispatcher
    D. All of these
    E. None of these
    Answer & Explanation
    C. Dispatcher
    Explanation:
    The dispatcher is the module that gives control of the CPU to the process selected by the scheduler.
  3. Number of processes completed per unit time is termed as _____
    A. Waiting time
    B. Response time
    C. Turnaround time
    D. Throughput
    E. None of these
    Answer & Explanation
    D. Throughput
    Explanation:
    Number of processes that complete their execution per time unit. 
  4. The time taken in an interactive program from the issuance of a command to the commence of a response to that command is known as?
    A. Waiting time
    B. Response time
    C. Turnaround time
    D. Throughput
    E. None of these
    Answer & Explanation
    B. Response time
    Explanation:
    Response time is the interval between submission of a request.
  5. Which of the following is time required for a particular process to complete, from submission time to completion.?
    A. Waiting time
    B. Response time
    C. Turnaround time
    D. Throughput
    E. None of these
    Answer & Explanation
    C. Turnaround time
    Explanation:
    Turnaround time is the time difference between completion time and arrival time.   
  6. Which of the following is the time difference between turn around time and burst time?
    A. Waiting time
    B. Response time
    C. Arrival Time
    D. Throughput
    E. None of these
    Answer & Explanation
    A. Waiting time
    Explanation:
    An amount of time a process has been waiting in the ready queue.
  7. Which of the following is a time required by a process for CPU execution?
    A. Waiting time
    B. Response time
    C. Arrival Time
    D. Throughput
    E. Burst time
    Answer & Explanation
    E. Burst time
    Explanation:
    Burst time is a time required to complete execution of particular task or process. 
  8. Which of the following is similar to FCFS scheduling?
    A. Earliest deadline first (EDF)
    B. Multilevel Feedback Queue Scheduling(MQS)
    C. Round Robin Scheduling(RRS)
    D. Multilevel Queue Scheduling(MQS)
    E. None of these
    Answer & Explanation
    C. Round Robin Scheduling(RRS)
    Explanation:
    Round robin scheduling is similar to FCFS scheduling, except that CPU bursts are assigned with limits called time quantum.
  9. Which of the following is an example of dynamic priority scheduling algorithms?
    A. Earliest deadline first scheduling
    B. Least slack time scheduling
    C. Round Robin Scheduling(RRS)
    D. Both (A) and (B)
    E. Both (B) and (C)
    Answer & Explanation
    D. Both (A) and (B)
    Explanation:
    Earliest deadline first scheduling and Least slack time scheduling are examples of Dynamic priority scheduling algorithms.
  10. 10.Which of the following is also known as CPU Scheduler?
  11. A. Long Term Scheduler
    B. Short Term Scheduler
    C. Medium Term Scheduler
    D. Both (A) and (B)
    E. Both (B) and (C)
    Answer & Explanation
    B. Short Term Scheduler
    Explanation:
    Short Term Scheduler is also known as CPU Scheduler used to enhance the CPU performance and it runs very frequently