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

Database Exit

Uploaded by

melsew
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)
21 views

Database Exit

Uploaded by

melsew
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/ 4

Productivity Improvement and Center of Excellence

Entrance Exam Package 100%


Student Name
IDNO
Department
Please put a tick mark ( ) beside Your Instructor Melsew D, Beshada T
Name
Subject Advanced database technology
Date of Exam
Time Allowed 1:30hr

GENERAL DIRECTIONS:
1. MAKE SURE THAT THE EXAM PAPER CONTAINS 04 PAGES INCLUDING THE
COVER PAGE
2. READ THE INSTRUCTION CAREFULLY FOR ALL PARTS
3. USE ONLY BLUE OR BLACK PANES

N.B: DONOT TURN THIS PAGE UNTIL YOU ARE ALLOWED TO DO SO


1. Which of the following is used in the application programs to request data from the database
management system?

A. Data query language C. Data Control Language


B. Data Definition Language D. Transaction Control Language

2. ________ command makes the updates performed by the transaction permanent in the
database?
A. ROLLBACK C. TRUNCATE
B. COMMIT D. DELETE
3. Which one of the following SQL commands is the same as relational algebra?
SELECT EID, ENAME FROM EMPLOYEE WHERE SkillType=Database”;
A. < EID, ENAME >< SkillType C. < SkillType =”Database”> <
=”Database”> (Employee) EID, ENAME > (Employee)
B. < EID, ENAME > < SkillType D. < EID, ENAME >  < SkillType
=”Database”> (Employee) =”Database”> [Employee]
6. The values appearing in given attributes of any tuple in the referencing relation must
likewise occur in specified attributes of at least one tuple in the referenced relation,
according to ______integrity constraint.

A. Referential C. Referencing
B. Primary D. Specific

7. The____condition allows a general predicate over the relations being joined?

A. On C. Set

B. Using D. Where

8. SELECT __________FROM instructor WHERE dept name= ’Comp. Sci.’;


Which of the following should be used to find the mean of the salary?

A. Mean(salary) C. Sum(salary)
B. Avg(salary) D. Count(salary)
9. SELECT COUNT (____ ID) FROM teaches
WHERE semester = ’spring’ AND YEAR = 2010;
If we do want to eliminate duplicates, we use the keyword ______in the aggregate
expression.
A. Count C. Primary key
B. Avg D. Distinct

10. Which statement is used to delete all rows in a table without having the action logged?
A. DELETE C. DROP

B. REMOVE D. TRUNCATE

11. How can you change "Thomas" into "Michel" in the "LastName" column in the Users table?

A. UPDATE User SET LastName = 'Thomas' INTO LastName = 'Michel'


B. MODIFY Users SET LastName = 'Michel' WHERE LastName = 'Thomas'
C. MODIFY Users SET LastName = 'Thomas' INTO LastName = 'Michel'
D. UPDATE Users SET LastName = 'Michel' WHERE LastName = 'Thomas’

Practical Test
1. Assuming you as a part of design and development of team of an organization, propose E-
R model using E-R diagram for the following data requirements. Also convert and
represent E-R model into tables: Company organized into DEPARTMENT. Each
department has unique name and a particular employee who manages the department. Start
date for the manager is recorded. Department may have several locations. A department
control a number of PROJECT. Projects have a unique name, number and a single location.
Company's EMPLOYEE name, ssno, address, salary, sex and birth date are recorded. An
employee is assigned to one department, but may work for several projects (not necessarily
controlled by her dept). Number of hours/week an employee works on each project is
recorded. Employee's DEPENDENT are tracked for health insurance purposes (dependent
name, birthdate, relationship to employee). Based on the above scenario Assess the
business requirement of the prescriptions and perform the following task by using answer
sheet
1.1. Identify the database Entities of the organization

1.2. Identify a type of Attributes for each entity

1.3. Draw entity relationship (ER) diagram for the identified entities with type of Attributes
2. Based the following ER-diagram Write your answer on the paper

Perform all the questions using transact SQL (SQL queries of DDL and DML) for the following
Er-diagram. Put all your answers on the answer sheet after running them on SQL server

1. Create a database named “MyBar”

2. Create all the tables with their primary key, proper data types, and their relationships
3. Fill five records on each table. For all tables the primary key is given. You can use
appropriate name and values for the remaining fields. Primary key for the relations is given
as follows. Each relation has five records
a. The primary key for bars is (from bar101, bar102 – bar105)
b. The primary key for BEERS is (Meta, Harer, Bedelie, Amber, Habesha)
c. The primary key for DRINKERS is (from Drink301, drink302 – drink305) at least
two should be females
4. Write the following select queries
a. Name of female drinkers and their favorite beers
b. Unit Profit of each beer that each bar sold
c. Total profit of all beers sold

You might also like