MCS-023 Solved Assignment 2018-19
MCS-023 Solved Assignment 2018-19
KHOJI.NET
Page 1
KHOJI.NET
Page 2
Question 1. List and describe briefly all the possible applications of a database
management system for a University.
Answer: Storing and accessing the data in the form of Excel sheets and account books is a
tedious work. It requires a lot of laborious work. It may often yield undesired results.
Maintaining these records as files may turn out to be a costlier task than any other of the
colleges and institutions.
KHOJI.NET
Information can be anything that is of significance to an individual or organization.
1. Used to store student data in single place: We know Database is used for storing Data
and Information. In a University DBMS cn be used to store all the data related to students
in one place. Instead of keeping different files for different records all the related data can
be stored in single database.
2. Used for multiple access: Because of facility of DBMS data can be accessed by multiple
users. This access can be simultaneously. With the help of DBMS multiple users can
work on the database. This will help to finish work more fast.
3. Can be centeralized: With the help of a centralized database all the branches of
university can access data any time. This facility is not present in manual/traditional
system.
4. Online use: With the help of DBMS database can be available online via internet. This
will facilitate every user of the database. Students can benefit most from it because they
can access their details online.
5. Online Registration: By going to online DBMS option University will get facility of
online registration, where students can register online without visiting University.
6. Online results: With the help of online DBMS results can be declared online every
student will have instant access to their result via visitng result page.
7. Various online forms: Various forms such as registration form, change information form
or any other request form can be put online. All the form data will be stored in database.
8. Live tracking: With the help of DBMS all the process can be tracked properly. It is very
hard in physical filing system.
Page 3
9. Easy query: DBMS will help querying data more fast. Any type of data can be accessed
instantly with just a single query.
10. Easy Analysis: With the help of DBMS all the data will be stored computerized. This
data can be used for different kind of analysis. Analysis purpose is the biggest use of
DBMS in any industry. For example comparing current year results with previous or
KHOJI.NET
through a website. In case any student or faculty member need any data it will be
available. For students it would be a 24x7 support system.
Page 4
Question 2. Identify all the associated entities for a University Management System, their
corresponding attributes, relationships and cardinality and design an Entity-Relationship
(ER) diagram for it.
Answer:
ER Diagram:
KHOJI.NET
Page 5
Question 3. Consider the E-R diagram of Question 2 and design the relational schema and
the tables. Perform and show the Normalization till the required normal form. Implement
the database using MS-Access and submit the screenshots along with your assignment
response for this question.
Answer:
KHOJI.NET
Page 6
KHOJI.NET
Page 7
KHOJI.NET
Question 4. Consider the following relations:
Supplier(S#,sname,status,city)
Parts(P#,pname,color,weight,city)
SP(S#,P#,quantity)
Answer: SELECT s_id FROM SP WHERE P_id IN (SELECT P_id FROM Parts WHERE
color=”BLUE” ;
KHOJI.NET
f) Count number of supplier who supplies „BLUE‟ part.
Answer: SELECT S_id FROM SP WHERE P_id IN (SELECT P_id FROM Parts WHERE
Pname=”p2” ) ;
KHOJI.NET
n) Find name of supplier who supply maximum parts.
a) Find all the product_id‟s and names whose manufacturer is LEO company.
Answer: SELECT * FROM Supplier WHERE sid = (SELECT sid FROM Supplies WHERE
pid = (SELECT pid FROM Product WHERE name = “police_car” ;
KHOJI.NET
c) Write a SQL statement to insert a new product with pid=-1, name='my product', and
min_age=3 into the Product table.
Answer: INSERT INTO Product(pid, name, min_age) VALUES(-1, “my product”, 3);
d) List the ids and names of all products whose inventory is below 10.
Answer: SELECT pid, name FROM Product WHERE pid IN (SELECT pid FROM Inventory
WHERE stock < 10) ;
e) List the ids and names of all suppliers for products manufactured by "TRIKA". The id
and name of each supplier should appear only once.
f) List the ids, names, and number in stock of all products in inventory. Order the list by
decreasing number in stock and decreasing product ids.
Page 11
g) List the ids and names of all products for whom there is only one supplier.
h) Find the ids and names of the products with the lowest inventory. Do NOT assume these
are always products with an inventory of zero.
KHOJI.NET
Answer: SELECT Product.pid, Product.name, MIN(Inventory.Stock) FROM Product
INNER JOIN Inventory ON Inventory.pid=Product.pid ;
i) List the id and name of each supplier along with the total number of products it supplies.
j) Find the id and name of the manufacturer who produces toys on average for the
youngest children.
Page 12