DBMS Assignment 1
DBMS Assignment 1
QUESTION 1:Think of different users for the database shown in Figure 1.2. What
types of applications would each user need? To which user category would each
belong, and what type of interface would each need?
Application programmers can write a number of canned transactions for the registration
Application programmers can write a number of canned transactions for the registration
Schema:
BOOK
ISBN Title Publisher
BOOK_AUTHORS
ISBN Name
BOOK_COPIES
ISBN Branch_ID No_of_Copies
BOOK_LOANS
ISBN Branch_ID Card_No Date_Out Due_Date
LIBRARY_BRANCH
Branch_ID Branch_Name Address
BORROWER
Card_No Name Address Phone
Sample Database:
BOOK
ISBN Title Publisher
123456 Paper Towns Pub1
334455 The Last Leaves Falling Pub4
997545 The Art of Being Normal Pub1
BOOK_AUTHORS
ISBN Name
334455 Lisa Wang
334455 John Bradley
997545 Ed Thomson
123456 Eric Raymond
BOOK_COPIES
ISBN Branch_ID No_of_Copies
123456 11 6
123456 12 10
997545 14 2
334455 11 1
BOOK_LOANS
ISBN Branch_ID Card_No Date_Out Due_Date
334455 11 903 11/9/2015 11/10/2015
123456 11 915 9/3/2015 9/4/2015
123456 12 920 1/1/2015 1/2/2015
997545 14 920 13/4/2015 13/5/2015
LIBRARY_BRANCH
Branch_ID Branch_Name Address
11 Main Branch Olaya St
12 Rabwa Branch Malaz
14 Rawdah Branch Makkah Rd
15 Dariyah Branch Prince Turki
BORROWER
Card_No Name Address Phone
903 John Smith 123 F St 555-4987
915 Susan Benson 490 Main St 555-2222
920 Richard Wily 111 Maple St 498-0000
Constraints:
These are examples of constraints. Students may suggest different ones.
The following fields (columns) or combination of fields should have unique values within their tables:
BOOK (ISBN)
BOOK_AUTHORS (ISBN,Name)
BOOK_COPIES (ISBN, Branch_ID)
BOOK_LOANS (ISBN, Branch_ID, Card_No)
LIBRARY_BRANCH (Branch_ID)
BORROWER (Card_No)
The values in the following fields in their tables should have matching values in the corresponding
tables:
2.5.4 Three-Tier Client/Server Architecture for Web Application is the best choice. The Client
consists of Web User Interface. The Web Server contains the application logic which includes all the
rules and regulations related to the reservation process and the issue of tickets; the Database
Server contains the DBMS.
2.5.1 Centralized DBMS Architecture would not work since the user interface and database server
are on different machines for a web-based system.
2.5.2 Basic Client/Server Architecture and 2.5.3 Two-Tier Client/Server Architecture would work if
the Business Logic can reside on server other than the DBMS Server. In general, if the business
logic was on the DBMS Server, it will put an excessive burden on the server. If the business logic
were to reside on the web client, it will burden the communication network as well a possibly thin
client.
QUESTION 4: Consider Figure 2.1. In addition to constraints relating the values of columns in
one table to columns in another table, there are also constraints that impose restrictions on values in a
column or a combination of columns within a table. One such constraint dictates that a column or a
group of columns must be unique across all rows in the table. For example, in the STUDENT table, the
Student number column must be unique (to prevent two different students from having the same
Student number). Identify the column or the group of columns in the other tables that must be unique
across all rows in the table.