




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





M.Tech CSE Advanced Database Management System Assignment-
1. List any six applications of DBMS. [3] Ans. Applications of DBMS: Banking Railway reservation systems Maintaining university and college records Credit card transactions Social media websites 2. Define Tuple, Attribute and Domain. [2] Ans. Tuple is the row in a table that represents a record in a table. Ex: Name is a column and ‘Murali’ is a tuple. Attribute is the header of column or field. Ex: ‘Name’ is a column and ‘Murali’ is the value of that column. Domain is the set of all possible values that can be accepted as a value for the column. Ex: Only alphabets are allowed in a Name column. 3. What is Relational Model? Give Suitable example [2] Ans. In relational model, rows and columns are stored as a table/relation in a database. It’s the primary data model used for storing and processing data. Tables and even rows have a relationship with other tables through relational integrity rules. Ex: Employee is a table with attributes/columns (first_name, last_name, empid, deptid, salary) and values stored for each column as a tuple/row. 4. Explain Referential Integrity constraint and On Delete Cascade with suitable example. [3] Ans.
Referential integrity constraints are the rules used for relating two different tables/relations with each other. In this, keys are used to define a relationship between two or more tables. Foreign key is a referential integrity constraint used to for a relation between two tables. It is a primary key in its own table but acts as a foreign key in the other table. Ex: Employee table (first_name, last_name, empid, deptid, salary) and Department table (deptid, role) – as you can see, deptid is a primary key in Department table but acts as a foreign key in Employee table. ON DELETE CASCADE option is used to specify whether the rows deleted in the parent table also deletes the associated rows in the child table (related using foreign key). If it is not specified, then the default behavior of the database server prevents you from deleting data in a table if other tables reference it. This option should be specified during the CREATE TABLE query.
5. Consider the schema student (r_no, name, course, dob, percentage, class) and solve the following queries. [6] a) Display the name of the students having name starting with letter ‘A’. b) Display the list of students having percentage more than 80 and having course as ‘CM’. c) Change the course as ‘IF’ of student ‘Amit’. d) Display the list of students having ‘First Class from ‘CO’ course. Ans. a) select name from student where name like ‘A%’; b) select * from student where percentage>80 and course=’CM’; c) update student set course=’IF’ where name=’Amit’; d) select * from student where class=1 and course=’CO’; 6. Describe Hierarchical Data Model with suitable example. [3] Ans. Hierarchical data model is the representation of data in a tree like structure with each record having one parent record and many children record. The use of such a data model is used in cases where the information gathering is based on a concrete hierarchy. This type of data model is only confined to one-to-many relationships since there can only be one parent and many children. This model has poor flexibility and cannot support complex relationships. But it has high performance and gets clear results, promotes data sharing and has a clear chain of command. Ex: file system management, commercial hierarchical databases like IMS…etc
10.Construct an ER-Diagram for University System. [4] Ans. 11.Explain the process of normalization and discuss the need of it with the help of an example. [3] Ans. Normalization is the process of reducing and correcting tables/relations in order to reduce data redundancies and anomalies and preserve data integrity and referential integrity. Need for normalization: Reduce data redundancies
Reduce data inconsistencies and anomalies (update, insert and deletion anomalies) Determining the level of redundancy in the relation Normalization of tables result in increased performance and efficiency and takes up very little space. Example: Student (rno, name, stud_group) is a table. 1 student can join more than 1 student group, like you can see below: So if we make changes to any details about rno 1, then we change everything. Since redundant data is fed to the table, updates need to be done more than once for the same row. Incorrect updates like this leads to an update anomaly. 12.Loss less join is requiring while doing the decomposition. Justify the statement with an example. [3] Ans. Lossless join decomposition is the process of splitting a relation R into two or more relations (R1, R2, R3,…..Rn) such that the natural join of the two relations gives back the original relation R. Loss less join is required while decomposing tables because it is done to ensure there is no redundancy and if the natural join of the two tables does not give back the original table, then there is redundancy due to the formation of extraneous tuples. Lossless join decomposition is also done to ensure that no data is lost. Ex:
So, ABD is a candidate key for relation R II) Find closure of a combination of keys to find the candidate key [ZY]+^ = {Z, W, X} [WXY]
= {W, X, Y, X} So, WXY is a candidate key for relation R 15.Discuss the process of query optimization and how this helps us to faster retrieve the records. [3] Ans. Query optimization is a part of query processing and is the process of selecting an effective and efficient plan for evaluating the queries. It’s used for accessing the database in an efficient manner. Query processing steps: Parsing and translation Optimization Evaluation After the query is parsed and processed, it goes through the query optimizer where the optimization process occurs. It’s one of the most difficult part of query processing. The result of query optimization gives the same result but at a least costly way. Importance of query optimization: Requires less cost Provides faster query processing Less stress on the database Provides high performance Consumes less memory How records are retrieved faster through query optimization: Query is transformed into relational algebra expression Then this is transformed into query tree to be handled by the optimization engine Then the optimization engine analyses the query data and applies rules to transform this data into an efficient representation Then valid evaluation plans are created based on those rules
The best evaluation plan is passed on to the query execution engine