Define the relations as tables in sql, Database Management System

Assignment Help:

Consider the relations given below
Borrower (id_no, name)
Book (accno., title, author, borrower_idno)
(a) Define the above relations as tables in SQL forming real world assumptions about the kind of the fields. Define the primary keys and the foreign keys.
(b) For the above relations answer the subsequent queries in SQL
What are the titles of the books borrowed through the borrower whose id-no in 365.
(i) Find out the numbers and names of borrowers who have borrowed books on DBMS in ascending order in id_no.
(ii) List the names of borrowers who have borrowed at least two books.

a) Create table Book
(Accno int Primary Key,
title char(30),
author char(30),
borrow-idno int references Borrower_id.no );
Create table borrower
(id-no int Primary Key,
name char(30) );
b) (i) Select title from Book, Borrower where Borrower.id_no =Book.borrower-idno and borrower.id_no = 365
(ii) Select id_no, name from Borrower, Book where Borrower.id_no= Book.borrower_idno and title= ‘DBMS' order by id_no asc;
(iii) Select name from Borrower, Book where Borrower.id_no = book.borrower_id_no having count (*) > 2

 


Related Discussions:- Define the relations as tables in sql

Datawarehouse, 1) Define a job scheduling strategy that will meet business ...

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Unnormalize form, employee(empid,empname,dept,telno,mobno, add,sssno,tinno,...

employee(empid,empname,dept,telno,mobno, add,sssno,tinno,WEdates,WEcomp,WEadd,WEpos,WEres) this is a employee record which is need to be normalize.the WE means work experience

What are object interaction diagrams, What are object interaction diagrams?...

What are object interaction diagrams? Object interaction diagrams are the diagrams that used to describe order in which messages are communicated in execution of an operation,

E-R Diagram, The H. I. Topi School of Business operates international busin...

The H. I. Topi School of Business operates international business programs in 10 locations throughout Europe. The school had its first class of graduates in 1965. The school keep

What is multivalued attribute, What is Multivalued Attribute? Multival...

What is Multivalued Attribute? Multivalued Attribute - Multivalued attribute might have more than one value for an entity. For instance, PreviousDegrees of a STUDENT.

A database administrator'', A database administrator''s responsibilities an...

A database administrator''s responsibilities and data contents

Describe the four main ways of optimising disk block access, Describe the f...

Describe the four main ways of optimising disk block access. Ans: a. Disk  b. Non-volatile writes buffers c. File organization (Clustering) d. Log-based file system

Draw an entity-relationship model, Draw an Entity-Relationship model for ...

Draw an Entity-Relationship model for the relational schema given in the Appendix. Show all the entities, relationships, relationship names, and attributes and also underline the

Evaluate the null hypothesis, 1.Suppose you are given a dataset that consis...

1.Suppose you are given a dataset that consists of a random sample of tasters, on which the following variables were obtained: (y) Zpref = taste preference for green beans store

What are advantages of object-oriented programming paradigm, What is the ma...

What is the major advantage of object-oriented programming paradigm? The ability to modify the explanation of an object without affecting the rest of the system is the main adv

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd