0% found this document useful (0 votes)
17 views

QB 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

QB 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

UE19CS301: DBMS

Unit 2 Question Bank


1. Define the following terms as they apply to the relational model
a. domain,
b. Attribute
c. n-tuple
d. relation schema
e. relation state
f. degree of a relation
g. relational database schema
h. relational database state.

2. Why are tuples in a relation not ordered?


3. Why are duplicate tuples not allowed in a relation?
4. What is the difference between a key and a super key?
5. Why do we designate one of the candidate keys of a relation to be the primary key? Can
a given relation have multiple candidate keys?
6. Discuss the characteristics of relations that make them different from ordinary tables and
files.
7. Discuss the various reasons that lead to the occurrence of NULL values in relations.
8. Discuss the entity integrity and referential integrity constraints. What is the significance
of these constraints in a database design?
9. Define foreign key. What is this concept used for?
10. Consider the following relations for a database that keeps track of business trips of
salespersons in a sales office:
SALESPERSON(Ssn, Name, Start_year, Dept_no)
TRIP(Ssn, From_city, To_city, Departure_date, Return_date, Trip_id)
EXPENSE(Trip_id, Account#, Amount)
A trip can be charged to one or more accounts. Specify the foreign keys for this
schema, stating any assumptions you make.
11. List the data types that are allowed for SQL attributes
12. Describe the four clauses in the syntax of a simple SQL retrieval query. Show what type
of constructs can be specified in each of the clauses. Which are required and which are
optional? Express these queries in Relational Algebra. Relational algebra queries suggest,
how a query evaluation plan would look like and among the given choices, which quey could
be efficient. Considering this, write multiple RA expressions for the given queries.
13. Employee Database
employee (employee-name, street, city)
works (employee-name, company-name, salary)
company (company-name, city)
manages (employee-name, manager- name)

a) Find the names of all employees who work for First Bank Corporation.
b) Find the names and cities of residence of all employees who work for First Bank
Corporation.
c) Find the names, street addresses, and cities of residence of all employees who work
for First Bank Corporation and earn more than $10,000.
d) Find all employees in the database who live in the same cities as the companies for
which they work.
e) Find all employees in the database who live in the same cities and on the same
streets as do their managers
f) Find all employees in the database who do not work for First Bank Corporation.
g) Find all employees in the database who earn more than each employee of Small
Bank Corporation.
h) Assume that the companies may be located in several cities. Find all companies
located in every city in which Small Bank Corporation is located.
i) Find all employees who earn more than the average salary of all employees of their
company.
j) Find the company that has the most employees.
k) Find the company that has the smallest payroll.
l) Find those companies whose employees earn a higher salary, on average, than the
average salary at First Bank Corporation.

Modify the Employee Database


-----------------------------------------------------------------------------
1. Modify the database so that Jones now lives in Newtown.
2. Give all employees of First Bank Corporation a 10 percent raise.
3. Give all managers of First Bank Corporation a 10 percent raise.
4. Give all managers of First Bank Corporation a 10 percent raise unless thesalary
becomes greater than $100,000; in such cases, give only a 3 percentraise.
5. Delete all tuples in the works relation for employees of Small Bank Corporation.
14) What is an Attribute and different types of attributes supported by relation schema.

15) What is a key ? Describe the difference bw candiatate key, super key, primary key
16) what is a Relationship and explain the different degrees of relationship.
17) what is cardinality . Explain the different types of it in it.
18) what are the different participation constraints?
19) Try to map the relational schema in Figure 6.14 into an ER schema. This is part of a
process known as reverse engineering, where a conceptual schema is created for an existing
implemented database. State any assumptions you make.
20) Below Figure shows an ER schema for a database that can be used to keep track of
transport ships and their locations for maritime authorities. Map this ER diagram into a
relational schema and specify all primary keys and foreign keys.

You might also like