Sunday, April 5, 2015

Some facts you need to know about relational tables


Some useful facts that you need to know about relational tables in relational model / Relational model keywords and their equivalent keywords / Relational model basics


Some facts about Relations (Tables) in Relational model

The information you may need to know about a relation and its components with equivalent simple terms and examples are given below;

RELATIONAL MODEL TERMS AND THEIR EQUIVALENT TERMS

 

Relational terms
Equivalent terms
Relation
Table
Tuple
Row, record
Attribute
Column, field
Cardinality (in SQL)
Number of tuples
Degree
Number of attributes
Primary key
Unique identifier
Domain
Set of permitted values
Atomic Domain
Set of indivisible permitted values
Schema
Logical design of the database
Instance
The snapshot of a database at a given instant of time

Relation <----> Table


Example:
Regno
Name
Phone
10BS0123
Madhavan
9965235412
10BC0234
Jerry
8569326541
11BM0023
Malar
9658236542
11BC0003
Kumar
9653268954
Table 1 - STUDENT
The above table shows a relation STUDENT with 3 attributes (Regno, Name, and Phone) and 4 records.

Tuple <----> Row or Record

It is used to represent every individual entity/row/record.
Example:
In table 1, there are 4 records. For example, (‘10BS0123’, ‘Madhavan’, 9965235412) is one record/row/tuple.

Attribute <----> Column or Field

It is used to represent all the values stored in that particular column.
Example:
In table 1, there are 3 columns namely Regno, Name, and Phone.

Cardinality (in SQL) <----> Number of rows

It is the number of records/tuples/rows stored in the table currently. The cardinality of STUDENT table is 4.

Degree <----> Number of columns

It is the number of columns/attributes/fields of a table. For example, the degree of table STUDENT is 3.

Primary key <----> Unique identifier

It is used to uniquely identify the individual records/rows/tuples at any time. For table STUDENT, Regno is the primary key. A primary key attributes/columns/field are permitted to store unique and Not Null values.

Domain <----> Set of permitted values

Domain is the set of permitted values for a particular column/attribute. It is to ensure the meaning of a single column. For example, in table STUDENT the permitted values for Regno column is set of valid register numbers of students.
Consider one more example table STUDENT_SPORTS given below; assume that this table is used to store all the students who are registered for some sports.
Regno
Name
Sports
10BS0123
Madhavan
Athlete
10BC0234
Jerry
Snooker
11BM0023
Malar
Basket ball
11BC0003
Kumar
High jump
For table STUDENT_SPORTS, the set of permitted values for Regno column is set of students’ register numbers of students who registered for some sports. It does not mean all the students register numbers.
The domain of Sports attribute is set of valid sports/games that are offered.

Atomic Domain <----> Indivisible domains

If the values that are stored as part of a domain are not divisible into different values, that domain is called atomic.
For example, in STUDENT_SPORTS the attribute Sports contains indivisible values in it. That is we cannot break the values into multiple different values in turn that are meaningful. Let us take the value ‘Basket ball’ for instance. Though it is divisible into two values ‘Basket’ and ‘Ball’, they would mean the basket and the ball, but not a game ‘basket ball’. Such values are called indivisible values.

PROPERTIES OF RELATIONS



  • There are no duplicate tuples – We don’t insert a record, for example, (‘10BS0123’, ‘Madhavan’, ‘Athlete’) two times.
  • Tuples are unordered (not sorted) – We don’t store the records in any particular order, say, ascending order or descending order.
  • Attributes are unordered – The attributes a table can be in any order.
  • All attribute values are atomic – We demand the permitted values for any attribute should be indivisible.

KINDS OF RELATIONS



  • Base relations: The real relations. Called "base table" in SQL.
  • Views: The virtual relations. A view is a named, derived relation. This can be derived from another relation or set of relations.
  • Snapshots: A snapshot is a real, not virtual, named derived relation.
  • Query results: The final output relation from a specified query. It may not be named and has no permanent existence. We call them as intermediate relations if we are about to use them in deriving something else further.
  • Temporary relations: A non-permanent named derived relation.

Please see the video for knowing what is data, database, and DBMS.




What is meant by degree of a relation in relational model?

What is arity in relational model?

Define cardinality of a relation in relational model

What is cardinality

Define schema and instance

Difference between domain and atomic domain

Friday, April 3, 2015

DBMS Basics and ER Model Quiz 7

Entity-Relationship Modeling Quiz 1


1. In a Entity-Relationship data model, an entity becomes a(n) _____________
    Attribute
    Table
    Constraint
    Column

2. The language that requires a user to specify the data to be retrieved without specifying exactly how to get it is
    Procedural DML
    Non-Procedural DML
    Procedural DDL
    Non-Procedural DDL

3. Which of the following data model is widely applied in many real world database applications?
    Network model
    Relational model
    Hierarchical model
    None of the above

4. The logical design of the database is database __________, a snapshot of the data in the database at a given instant in time is database ________.
    Instance, Schema
    Relation, Schema
    Relation, Domain
    Schema, Instance

5. The tuples (records) of the relations (tables) can be of ________ order.
    Any
    Ascending
    Sorted
    Descending

6. Which of the following is the collection of interrelated data and set of program to access them?
    Data structure
    Database
    DBMS
    Programming Language

7. Database management systems are intended to
    Eliminate data redundancy
    Establish relationships among records in different files
    Manage file access
    All of the above

8. ________________defines the database schema, Interacts continuously with users, defines integrity and security checks, defines procedures for backup and recovery
    Sophisticated User
    Naïve User
    DBA
    Application Programmer

9. The number of tuples in a relation is called __________ of a relation.
    Cardinality
    Degree
    Tuple
    Key

10. The number of attributes (columns) in a relation is called __________ of a relation.
    Cardinality
    Degree
    Tuple
    Key

Score =

Correct answers:

Thursday, April 2, 2015

DBMS Basics and ER Model Quiz 6

Entity-Relationship Modeling Quiz 1


1. According to the levels of data abstraction, the schema at the intermediate level is called
    Logical schema
    Physical schema
    Subschema
    Conceptual schema

2. It is an abstraction through which relationships are treated as higher level entities
    Generalization
    Specialization
    Aggregation
    Inheritance

3. ___________ creates the metadata.
    DML compiler
    DML pre-processor
    DDL interpreter
    Query interpreter

4. When an E-R diagram is mapped to tables, the representation of which of the followig is redundant?
    Weak entity sets
    Weak relationship sets
    Strong entity sets
    Strong relationship sets

5. In an ER diagram, Y is the dominant entity and X is a subordinate entity. Then which of the following is incorrect?
    Operationally, if X is deleted, so is Y
    Operationally, if Y is deleted, so is X
    Existence is dependent on Y
    Operationally, if X is deleted, and remains the same

6. Which of the following can be considered as one of the reasons to model data?
    Understand each user’s perspective of data
    Understand the data itself irrespective of the physical representation
    Understand the use of data across application areas
    All of the above

7. In an ER Diagram, the concept total participation is represented by which of the following components?
    Dashed lines between entity set and relationship set
    Double lines between entity set and relationship set
    Single line between entity set and relationship set
    Solid line between entity set and relationship set

8. Relations (tables) that are produced by proper application of ER model will always be in
    1NF
    2NF
    3NF
    BCNF

9. "Manager salary details are hidden from the employee". Which of the following you can relate to this statement?
    External level data hiding
    Physical level data hiding
    Conceptual level data hiding
    None of the above

10. Which of the following two files are used during the operation of the DBMS?
    Query languages and utilities
    DML and query language
    Data dictionary and transaction log
    Data dictionary and query language

Score =

Correct answers:



Wednesday, April 1, 2015

Database Management Systems - Cochin University November 2008 Questions

Database Management Systems - Cochin University November 2008 Questions / CUSAT - DBMS Nov 2008 Question / CS 505 DBMS CUSAT Question


BTS (C) – V – 08 – 060 – G
B.Tech Degree V Semester Examination, November 2008

CS/IT 505 Database Management Systems

(2006 Scheme)
Time: 3 Hours                                                    Maximum marks: 100
PART – A
(Answer ALL Questions)
(All questions carry EQUAL marks)
(8 X 5 = 40)
I. (a) List any five differences between file-oriented approach and database approach.
(b) Explain the term “Structural constraints”.
(c) Differentiate between heap files and sorted files.
(d) Distinguish between spanned and unspanned records.
(e) State and prove Armstrong’s inference rules. What do you mean by saying that these rules are sound and complete?
(f) Define the basic constraints in SQL.
(g) Illustrate with necessary example the shadow paging recovery technique.
(h) Discuss the characteristics of object oriented databases.

PART – B
(All questions carry EQUAL marks)
(4 X 15 = 60)
II. (a) Discuss the main categories of data models. (10)
(b) List the five functions of DBA. (5)
OR
III. Design an ER diagram for a banking enterprise. (15)

IV. With necessary diagram, explain the various single level ordered indexing schemes. (15)
OR
V. Illustrate with necessary diagrams, internal and external hashing techniques. (15)

VI. (a) Define normalization. Illustrate with suitable example 1NF, 2NF, and 3NF. (10)
(b) Consider the relational schemas:
          Borrower (Customer_name, loan_no)
          Loan (Branch_name, loan_no, amount)
          Depositor (Customer_name, account_no)
          Account (Branch_name, account_no, balance)
Write SQL and relational algebra queries for the following:
          (i) Find the loan number of loans with loan amount between Rs. 1000 and Rs. 10,000.
          (ii) Find the names of all customers who have a loan at the “Perryridge” branch. (5)
OR
VII. Define 1NF, 2NF, 3NF, and BCNF. Find a BCNF decomposition of the relation schema LENDING with the following set of functional dependencies:
LENDING (Branch_name, Branch_city, Assets, Customer_name, Loan_number, Amount)
          Branch_name à Assets Branch_city
          Loan_number à Amount Branch_name
A candidate key for this schema is {loan_number, customer_name}. (15)

VIII. (a) Describe the steps in building a data warehouse. (10)
(b). List the ACID properties of a transaction. (5)
OR
IX. (a) Illustrate with an example an algorithm for testing conflict serializability of a schedule. (10)
(b) Differentiate between serial and non-serial schedule. (5)

*********









Database Management Systems - CUSAT Univeristy Questions

Database Management Systems - CUSAT Univeristy Questions / DBMS - CUSAT Questions with Answers / Cochin University DBMS Questions with Answers / Cochin University of Science And Technology (CUSAT) Previous Year DBMS Questions



  • Database Management Systems (DBMS) Question - November 2008
  • Database Management Systems (DBMS) Question - November 2008
  • Database Management Systems (DBMS) Question - November 2008
  • Database Management Systems (DBMS) Question - November 2008
  •  Database Management Systems (DBMS) Question - November 2008
  •  Database Management Systems (DBMS) Question - November 2008





Database Management Systems - Visvesvaraya Technological University Dec 09/Jan 10 Questions

Database Management Systems - Visvesvaraya Technological University Dec 09/Jan 10 Questions / December 2009-January 2010 DBMS questions of Visvesvaraya Technological University / DBMS University questions with answers



USN                                                      06CS54
Fifth Semester B.E. Degree Examination, Dec.09/Jan.10

Database Management Systems

Time: 3 hrs.                                                     Max. Marks: 100
Note: Answer any FIVE full questions, selecting at least TWO questions from each part.
PART – A

1. a. Explain the typical components of a DBMS with a neat diagram. (10 Marks)
b. Define and explain the following terms with an example each:
(i) Snapshot  (ii) Intension  (iii) Extension  (iv) Schema construct (05 Marks)
c. What is meant by “Persistent storage for program objects”? Explain. (05 Marks)

2. a. Explain how role names are assigned in case of recursive relationships? Illustrate this concept with a diagram. (06 Marks)
b. What is meant by partial key? Explain. (04 Marks)
c. Design an ER diagram for keeping track of information about an AIRLINE database taking into account at least six entities. (10 Marks)

3. a. Define referential integrity constraint. Explain the importance of referential integrity constraint. How is this constraint implemented in SQL? (08 Marks)
b. Consider the following relations and write relational algebra queries:
Employee(FName, SSN, Salary, Super-SSN, DNo);
WorksON(ESSN, PNO, Hours);
Department(DName, Dno, Mgr-SSN);
Dependent(ESSN, Dependent-Name);
(i) Retrieve the highest salary paid in each department.
(ii) Retrieve the name of managers who have more than two dependents.
(iii) Retrieve the number of employees and their average salary working in each department. (12 Marks)

4. a. Explain IN and EXISTS operators with suitable examples. (08 Marks)
b. Consider the same data given in Q3(b), and write the following queries in SQL:
(i) Retrieve the name of all employees who do not have supervisor.
(ii) Retrieve the name of each employee who has a dependent with the same first name and same sex as the employee.
(iii) Retrieve the SSN of all employees who work on project numbers 1, 2, 3. (12 Marks)

PART – B

5. a. How is a view created and dropped? What problems are associated with updating of views? (10 Marks)
b. What is embedded SQL? With an example, illustrate how would you connect to a database, fetch records and display. Also explain the concept of stored procedure in brief. (10 Marks)

6. a. Which normal form is based on the concept of transitive functional dependency? Explain with an example the decomposition into 3NF. (10 Marks)
b. Define multi-valued dependency. Explain 4NF with an example. (10 Marks)

7. a. Explain 3 phases involved in an ARIES algorithm with an appropriate example. (10 Marks)
b. Given a relation with 4 attributes R = {A B C D} and the following FDs, identify the candidate key for R and the highest normal form.
(i) C -> D, C -> A, B -> C (ii) B -> C, D -> A. (10 Marks)

8. Write short notes on the following;
a. Two phase locking protocol
b. Transaction support in SQL
c. Write ahead log protocol
d. Time stamp ordering algorithm       (20 Marks)
***********







Database Management Systems - Visvesvaraya Technological University Questions

Database Management Systems - Visvesvaraya Technological University Questions / DBMS Question Papers of Visvesvaraya Technological University, Bengaluru / Visvesvaraya Technological University DBMS Questions with Answers / Previous year DBMS questions of Visvesvaraya Technological University, Bangalore / DBMS University Exam Questions with Answers



  • Database Management Systems - Question December 2008/January 2009

  • Database Management Systems - Question December 2010/January 2011

  • Database Management Systems - Question May 2011/June 2011

  • Database Management Systems - Question December 2011/January 2012

  • Database Management Systems - Question May 2012/June 2012

 

 

 

 

 

 

 

 

 





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

data recovery