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

Tuples-attributes , Consider a relation s over the attributes A and B wit...

Consider a relation s over the attributes A and B with the following characteristics: 5,000 tuples with 10 tuples per page A 2-level B+ tree index on attribute

Structure of the ldb, Though all the ABAP/4 Dictionary Structures that exis...

Though all the ABAP/4 Dictionary Structures that exists in the structure of the LDB, being described in Database Program, we are explaining the Dictionary Structures in the Report.

Draw an er diagram with primary key for a farm, Draw an ER diagram that rep...

Draw an ER diagram that represents the information described below. Show all entity sets, relationship sets, primary keys, and the mapping cardinality of the relationship sets.

List the set operations of sql, List the set operations of SQL? 1) Unio...

List the set operations of SQL? 1) Union 2) Intersect operation 3) The except operation

Differentiate between procedural and non procedural language, Differentiate...

Differentiate between Procedural and non procedural languages ? Procedural and non procedural languages - A procedural language specifies the operations to be performed on th

advantages of database over file system, Q.   Why would you choose a datab...

Q.   Why would you choose a database system instead of simply storing data in operating system file? Define  at a base concept in details. Sol. Advantages of Database over Fil

Query, Use a Set operator to create a list of academics who have written or...

Use a Set operator to create a list of academics who have written or co-written less than 5 papers and also have greater than 3 interests. List their academic number in the output.

Microeconomic, anyone have a textbook solutions case fair, 8 edition of vo...

anyone have a textbook solutions case fair, 8 edition of vol 1 ?, please give me

Functional Dependencies, What exactly is the concept of Functional Dependen...

What exactly is the concept of Functional Dependencies? And how do we associate this concept with the logic of Super-keys, Candidate Keys, etc? Given Relation R(A,B,C,D,E) with de

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