You are on page 1of 7

ISE 1

Date:26/02/2020

Marks:50 M

PRN NO:______________________

Instructions:
1. All questions are compulsory.
2. Only one selection will get considered.
3. Types answer of MCQ in answer block.
4. Upload PDF File of answers on moodle.

Question 1: All questions are compulsory. (16 M)

Type: Multiple Choice questions and answers.

1 The _________ provides a set of operations that take one or more relations as input and return a
relation as an output.
a) Schematic representation
b) Relational algebra
c) Scheme diagram
d) Relation flow

2. To remove a relation from an SQL database, we use the ______ command.


a) Delete
b) Purge
c) Remove
d) Drop table

3. Here which of the following displays the unique values of the column?
SELECT ________ dept_name
FROM instructor;
a) All
b) From
c) Distinct
d) Name

4. The query given below will not give an error. Which one of the following has to be replaced to get
the desired output?
SELECT ID, name, dept name, salary * 1.1
WHERE instructor;

a) Salary*1.1
b) ID
c) Where
d) Instructor

5. This Query can be replaced by which one of the following?


SELECT name, course_id
FROM instructor, teaches
WHERE instructor_ID= teaches_ID;

a) Select name,course_id from teaches,instructor where instructor_id=course_id;


b) Select name, course_id from instructor natural join teaches;
c) Select name, course_id from instructor;
d) Select course_id from instructor join teaches;

6. ’_ _ _ ’ matches any string of ______ three characters. ’_ _ _ %’ matches any string of at ______
three characters.
a) Atleast, Exactly
b) Exactly, Atleast
c) Atleast, All
d) All, Exactly
7. SELECT instructor.*
FROM instructor, teaches
WHERE instructor.ID= teaches.ID;

This query does which of the following operation?


a) All attributes of instructor and teaches are selected
b) All attributes of instructor are selected on the given condition
c) All attributes of teaches are selected on given condition
d) Only the some attributes from instructed and teaches are selected

8. (SELECT course id
FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009)
EXCEPT
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010);

This query displays


a) Only tuples from second part
b) Only tuples from the first part which has the tuples from second part
c) Tuples from both the parts
d) Tuples from first part which do not have second part

Question 2: All questions are compulsory. (04 M)

Type: Drawing.

1. Draw an ER diagram of the music database. (2017BTECS00006, 2017BTECS00013)


2. Draw an ER Diagram for University Management System. (2017BTECS00026 ,
2017BTECS00028)
3. Draw an ER diagram of the flight database. (2018BTECS00106, 2018BTECS00107)
4. Draw an ER Diagram for restaurant Management System. (2018BTECS00109,
2018BTECS00110)
5. Draw an ER Diagram for Gym Management System. (2018BTECS00111, 2018BTECS00112)
6. Draw an ER Diagram for Storage System. (2018BTECS00113 , 2018BTECS00114)

Question 3: All questions are compulsory. (20M)

Type : SQL Queries.

1. Write a query in SQL to find the ID number for the actor whose first name
is 'Woody' and the last name is 'Allen'
Sample table: actor
act_id | act_fname | act_lname | act_gender
--------+----------------------+----------------------+------------
101 | James | Stewart | M
102 | Deborah | Kerr | F
103 | Peter | OToole | M
104 | Robert | De Niro | M
105 | F. Murray | Abraham | M
106 | Harrison | Ford | M
107 | Nicole | Kidman | F
108 | Stephen | Baldwin | M
109 | Jack | Nicholson | M
110 | Mark | Wahlberg | M
111 | Woody | Allen | M
112 | Claire | Danes | F
113 | Tim | Robbins | M
114 | Kevin | Spacey | M
115 | Kate | Winslet | F
116 | Robin | Williams | M
117 | Jon | Voight | M
118 | Ewan | McGregor | M
119 | Christian | Bale | M
120 | Maggie | Gyllenhaal | F
121 | Dev | Patel | M
122 | Sigourney | Weaver | F
123 | David | Aston | M
124 | Ali | Astin | F

2.
3. Perform Full outer join on following tables.
Sample table: foods
+---------+--------------+-----------+------------+
| ITEM_ID | ITEM_NAME | ITEM_UNIT | COMPANY_ID |
+---------+--------------+-----------+------------+
| 1 | Chex Mix | Pcs | 16 |
| 6 | Cheez-It | Pcs | 15 |
| 2 | BN Biscuit | Pcs | 15 |
| 3 | Mighty Munch | Pcs | 17 |
| 4 | Pot Rice | Pcs | 15 |
| 5 | Jaffa Cakes | Pcs | 18 |
| 7 | Salt n Shake | Pcs | |
+---------+--------------+-----------+------------+
Sample table: company
+------------+---------------+--------------+
| COMPANY_ID | COMPANY_NAME | COMPANY_CITY |
+------------+---------------+--------------+
| 18 | Order All | Boston |
| 15 | Jack Hill Ltd | London |
| 16 | Akas Foods | Delhi |
| 17 | Foodies. | London |
| 19 | sip-n-Bite. | New York |
+------------+---------------+--------------+

4. We have the following two tables 'student' and 'marks' with common field
'StudentID'.
student marks
write a query to identify all students who get better marks than that of the student
who's StudentID is 'V002', but we do not know the marks of 'V002'.

5. Create a view of a table actor with attributes act_id and act_fname and
display all the values of view.

6.
Create table with name Persons having attributes ID, FirstName,
LastName and Age. After creating table add primary key constraint to
ID.

7. Display current date in different formats.

8. Display all the system tables.

9. Create following table “STUDENT” with the following records.

+---------+----------+-----+-----------+----------+
| ROLL_NO | NAME | AGE | BRANCH | CITY |
+---------+----------+-----+-----------+----------+
| 10001 | Kate | 22 | CSE | Mumbai |
| 10002 | Richard | 21 | ECE | Delhi |
| 10003 | Rick | 33 | ME | Chennai |
| 10004 | Peter | 26 | CSE | Delhi |
| 10005 | Steve | 22 | CSE | Noida |
| 10006 | Mark | 22 | ECE | Jaipur |
| 10007 | Brad | 23 | ME | Rampur |
+---------+----------+-----+-----------+----------+
SQL statement will fetch all the records from the table “STUDENT” and the
returned rows will be in ascending order of student age in ascending order.

10. write an SQL statements to fetch the name of the students where
student age is “greater than 23” and address is “Delhi”

Question 4 : All questions are compulsory. (10M)

Type : Oral.

You might also like