Sei sulla pagina 1di 2

Roll no : Group :

Thapar University, Patiala


Computer Science & Engineering Department
B.E Second Year, 3rd Semester
Course Code: UCS-304 Date: 26/09/20 15
Course Name: Information Management System Time Allowed: 2 hours
Instructors: Dr. Rinkle Rani, Dr. Anju Bala and Ms. Sukhchandan Randhawa Max. Marks: 25

Ql. Differentiate between the following in the tabular format: 3


a. Logical and Physical Data Independence
b. 3NF and BCNF
c. Disjoint and Overlapping Constraint
Q2. Write the output for the following SQL functions: 2
a. SELECT SUBSTR('COMPUTER SCIENCE AND ENGINEERING DEPARTMENT', 18,
10) FROM DUAL;
b. SELECT SUBSTR('COMPUTER SCIENCE AND ENGINEERING DEPARTMENT', -5, 8) FROM
DUAL;
c. SELECT TRIM(' THAPAR UNIVERSITY ') FROM DUAL;;
d. SELECT TRIM (0 FROM 004398007200) FROM DUAL;
e. SELECT TRUNC(4235.361, 0), ROUND(4235.36 I, 0) FROM DUAL;
f. SELECT TRUNC(4235.361, 1),ROUND(4235.361, 1) FROM DUAL;
g. SELECT TRUNC(4235.36 1 , -1),ROUND(4235.361, -I) FROM DUAL;
h. SELECT TRUNC(4235.361, -2),ROUND(4235.361. -2) FROM DUAL;
Q3. Write SQL queries for the following statements based on Employees table whose schema is given below: 3
(Employee_l D. First_N ame,LastName, Emai I, Phone_N umber. H i re_Date,J ob.) D, Sal ary, Manager_Id,
Department_Id)
a. Display each employee's last name, hire date and salary review date (which is the first Monday after
six months of service).Label the column REVIEW. Format the dates to appear in the format similar to
"Monday, the Thirty-First of July, 2000."
b. Write a query that displays the employee numbers and last names of all employees who work in a
department with any employee whose last name contains a letter 'u'.
c. Display the manager number and salary of the lowest paid employee for that manager. Exclude
anyone whose manager is not known. Exclude any groups where the minimum salary is 6000 or less.
Sort the output in descending order of salary.
Q4. 2,3
QSId
------) name ) ----, CSe7D o
N time ----7---:
N ----c 7
,---"---,,,_ N._
--" ---, (--------Q r_no
Student <- Takes --, [-Course_Offerltiiii--- '-----____ ______.----'j
.,
/ -----...._
,.., ( Year ) __.------------,
----- _______ ( Semester )
c'li.. program --) Exam
Place
c_.---------'_ ----rtime)
cid )
name )

a. The above given ER model shows a ternary relationship. Construct an alternative ER Diagram that
uses only a binary relationship.
b. Convert the following given ER Model to relational schemas:

4 ,
Apply normalization on the table given below which is in un-normalized form, apply normalization upto
Q5.
BCNF and desig
Emp-Name Month Sales Bank-ld Bank-Name
Emp-ld
AA Jan 1000 BOl SBI
E01
Feb 1200
Mar 850
Jan 2200 B02 UT1
E02 BB
Feb 2500
CC Jan 1700 BOl SBI
E03
Feb 1800
Mar 1850
Apr 1725

a. Discuss Primary Key, Foreign Key, Candidate Key, Super Key with examples.
Q6.
Why would you choose a database system instead of simply storing data in files? When would it
b.
make sense not to use a database system?
ABC Furniture Company (Referential Integrity Constraints) schema is given. Write SQL queries for the
Q7.
following statements.
CUSTOMER
Customer ID FE Istorner_Narne
-- I Custorner_Address I City _State LPostal_Code

ORDER
Order Date Customer_ID
LOrder Id

ORDER LINE
r order Id I Product id I Ordered_Quantity II
PRODUCT A-77
I Product Ict[DescriptioniProduct_Finish I Standard Price [ Product_Line_Id

Show each product_line_id and the total number of products for the product_line_id.
a.
Show product_id and description for all products whose names contain a string of "table".
b.
c. Change a product_description from 'Duplex Table Lamp' to 'Arch Table Lamp'.
d. Show dates and how many orders received in each individual day.

Potrebbero piacerti anche