Major links



Quicklinks


📌 Quick Links
[ DBMS ] [ SQL ] [ DDB ] [ ML ] [ DL ] [ NLP ] [ DSA ] [ PDB ] [ DWDM ] [ Quizzes ]


Wednesday, February 24, 2016

Fragmentation in Distributed Database - Quiz

Database System Architectures - Quiz


1. What are the advantages of Replication of data in Distributed database?
    Avaliability, Parallelism, Increased data transfer
    Availability, Parallelism, Reduced data transfer
    Availability, Increased parallelism, Cost of updates
    All of the above

2. A fragmentation technique wherein every tuple of a table is assigned to one or more fragments as a result of fragmentation is called ________________ .
    Vertical Fragmentation
    Horizontal Fragmentation
    Hybrid Fragmentation
    None of the above

Assume a relation EMP as given below:
                EMP(EmpNo, EName, Job, Sal, Department)
Furthermore, assume that there are two applications which are accessing the above mentioned table. One application typically retrieves information about employees who earn more than Rs5.000, the other application typically manages information about 'clerks' (job). Also, assume that there are employees with other designations and different salaries stored in EMP. With this information, answer the questions 3 to 6.

3. Which of the following are the simple predicates which can be directly extracted from the given applications?
    {Job = clerk, Salary>5000}
    {Job = clerk, Salary<5000}
    {Job = Manager, Salary>5000}
    {Job = Manager, Salary<5000}

4. How many valid minterm predicates we can derive for the above said problem?
    4
    5
    3
    2

5. Assume that the departments are 'Finance', 'Production', and 'Design'. If there is one more application which accesses the informatoin frequently based on the 'Finance' department, what would be the number of valid minterm fragments?
    5
    6
    7
    8

6. If by mistake, I miss one of the valid minterm fragments. What would be the effect of that in fragmentation?
    Causes skew
    Reconstruction of EMP will be unsuccessful
    Slows down the database access
    None

7. Which of the following failures are unique to distributed database systems?
    Failure of a site
    Loss of messages
    Network Partition
    All the above

8. For the given set of simple predicates Pr, how many min-term predicates we can derive (including invalid ones). Pr = {Branch = “Vellore”, Branch = “Chennai”, Salary <=20000, Salary > 20000} Assumptions: Consider there are five different branches.
    4
    8
    16
    32

9. In a distributed database application, if we have very many number of read only queries than update queries then ______________ allocation technique is advantageous.
    Hybrid Fragmentation
    Horizontal Fragmentation
    Replication
    Vertical Fragmentation

10. Which of the following would be the advantage of Database Fragmentation?
    Most of the operations are local to any sites
    Reduced Network Traffic
    Parallel processing
    All the above

Score =

Correct answers:

Go to Distributed Database Quizzes - Home page

Monday, February 22, 2016

Database Normalization Solved Exercise 7

Set of solved exercises in Normalization / Normalization Solved Examples / How to find candidate keys, and primary keys in database? / Sets of examples to find the keys of a tables / Process of Key finding in a database – Examples


Question:



Consider the relation scheme R = (E, F, G, H, I, J, K, L, M, N) and the set of functional dependencies {{E, F} {G}, {F} {I, J}, {E, H} {K, L} {M}, {K} {M}, {L} {N}} on R. What is the key for R?


Solution:

To find the key of a relation, we need to find the closure of attributes. If any attribute’s or set of attributes’ closure gives all the attributes of the relation, then we would say that attribute/set of attributes as the key for that relation.

To simplify this task or to avoid finding closure of all attributes, let us do find the closure for left hand side (LHS) attributes of the functional dependencies.

For the given question, attributes F, (E, F), (E, H), K, and L are the LHS attributes.


  • The closure of F, i.e., (F)+ = FIJ EFGHIJKLMN. Hence F is not a candidate key. [Refer, How to find closure]

  • (EF)+ = EFGIJ EFGHIJKLMN. Hence EF is not a candidate key.

  • (EH)+ = EHKLMN EFGHIJKLMN. Hence EH is not a candidate key.

  • (K)+ = KM EFGHIJKLMN. Hence, K is not a candidate key.

We observed that the left side attributes of any FDs alone cannot form a key. Let us try with the combination of two FDs LHS.



  • (EFH)+ = EFGHIJKLMN  = R.

Hence, EFH is the key for this relation.




[
Derivation of EFH+:
Step 1: result = EFH
Step 2: result = EFGH from {E, F} {G}
Step 3: result = EFGHIJ from {F} {I, J}
Step 4: result = EFGHIJKLM from {E, H} {K, L} {M}
Step 5: result = EFGHIJKLMN from {L} {N}
We have reached that the result = R. hence, EFH is the key.
]
 





Related Posts:








How to find candidate keys using closure finding algorithms


Sunday, February 21, 2016

CS 8303 – DATABASE MANAGEMENT SYSTEMS April May 2014

Anna University CS 8303 – DATABASE MANAGEMENT SYSTEMS April May 2014, Computer Science and Engineering, Third Semester, Regulation 2012. Database Management System Question Paper April May 2014




Exam
B.E/B.Tech. (Full Time) DEGREE END SEMESTER EXAMINATIONS
Academic Year
April May 2014
Subject Code
CS 8303
Subject Name
Database Management Systems
Branch
Computer Science and Engineering
Semester
Third Semester
Regulation
2012


B.E / B.Tech. (Full Time) DEGREE END SEMESTER EXAMINATIONS, APRIL / MAY 2014
Computer Science and Engineering
Third Semester
CS 8303 – DATABASE MANAGEMENT SYSTEMS
(Regulations 2012)
Time : 3 Hours                      Answer A L L Questions                Max. Marks 100
PART-A (10 x 2 = 20 Marks)

1. List the responsibilities of a database administrator.
2. List four advantages of database systems over file systems.
3. List the properties to be satisfied by a decomposition of relation
4. Define PJNF. Give an example.
5. What is dynamic SQL?
6. Can views be modified? Justify.
7. What is savepoint?
8. What is the advantage of indent locking?
9. What are the two types of spatial queries? Give examples.
10. What are the issues in mobile databases?

Part-B (5* 16 = 80 Marks)

11. (i) Explain the architecture of database systems with a neat diagram. (10)
(ii) Write short notes on data models. (6)
12. a) (i) A university registrar's office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title.
Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled.
Construct an E-R diagram for the registrar's office. Document all assumptions that you make about the mapping constraints. (10)
(ii) Convert the ER schema shown in figure 12 (a) (ii) into relational schema. Document all assumptions that you make about the mapping constraints. (6)
 (OR)
(i) Consider a database the following relational schema: (10)
Customer (Cust#, Cname, City)
Order(Order#, Odate, Cust#, Ord_Amt)
Order_ltem(Order#, ltem#, Qty)
ltem(ltem#, Unit_Price)
Shipment(Order#, Warehouse#, Ship_date)
Warehouse(Warehouse#, City)
Ofd_Amt refers to total dollar amount of an order; Odate is the date the order was placed; Ship_date is the date an order is shipped from the warehouse. An order can be shipped from any warehouse.
Express the following queries in RA:
A) List the Order# and Ship_date for all orders shipped from Warehouse# "W2".
B) Delete all orders for customer named "Jose"
C) List all customer names whose orders were shipped from a warehouse in the same city as they live in.
D) List the Order# for orders that were shipped from all warehouses in New York.
E) Produce a listing: Cname, #ofOrders, Avg_Order_Amt, where the middle column is the total number of orders by the customer and the last column is-the average order amount for that-customer.
(ii) Consider the relation for published-books: (6)
BOOK (Title, Author, Type, Price, Affil, Publisher)
Affil refers to the affiliation of the author.
Suppose the following dependencies exist:
Title -> Publisher, Type
Type -»Price
Author -> Affil
What normal form is the relation in? Explain your answer. Apply normalization until you cannot decompose the relations further. State the reasons behind each decomposition.
13. a) ( i ) Explain how database security is achieved using SQL. (10)
(ii) What are triggers? Discuss the use of triggers with an example. (6)
(OR)
(i) Consider a database the following relational schema:  (10)
CUSTOMER (Cust Id, Cust_Name, Annual_Revenue, Cust_Type)
SHIPMENT (Shipments#, Cust Id, Weight, Truck#, Destination, Ship_Date)
Note: Cust_id references CUSTOMER
Truck# references TRUCK
Destination references CITY
Assume each shipment contains one package.
TRUCK (Truck#, Driver_Name)
CITY (City Name, Population)
Express the following queries in SQL:
A) List the name and id of customers for whom the driver, Kennedy has delivered shipments.
B) List the cities to which the driver, Kennedy has delivered shipments.
C) List the average weight of the shipments received by each customer.
D) For each city which has received atleast 10 packages, what is the average weight of a package sent to that city?
E) List the drivers who have delivered shipments to every city.
(ii) Explain referential integrity constraint, and the ways in which updates of such attributes are handled. (6)
14. a) (i) Explain 2PL and its variants with the advantages and disadvantages. (10)
(ii) Explain the properties of a transaction with suitable examples.  (6)
(OR)
b) (i) What are deadlocks? How are they handled? (10)
(ii) Explain 2PC protocol. (6)  
15. a) (i) Explain the different algorithms used for selection operation and their associated cost. (10)
(ii) Discuss the steps involved in query processing with a neat diagram. (6)
(OR)
b) (i) What are temporal databases? Explain insertion and deletion in temporal databases. (10)
(ii) Write notes on data mining. (6)

************************







Please visit, subscribe and share 10 Minutes Lectures in Computer Science

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents