0% found this document useful (0 votes)
89 views14 pages

DBMS Assignment-2

The document describes the design of a university registrar database. It identifies the key entities as courses, students, instructors, and course offerings. Relationships between entities include students enrolling in course offerings, instructors teaching course offerings, and courses being offered. The entity relationship diagram shows the entities and relationships, including use of a bridge table for the many-to-many relationship between students and course offerings. Attributes are identified for primary keys and foreign keys for unique identification. The overall design of the database is presented to track students, courses, instructors and enrollments.

Uploaded by

P Sai Kiran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views14 pages

DBMS Assignment-2

The document describes the design of a university registrar database. It identifies the key entities as courses, students, instructors, and course offerings. Relationships between entities include students enrolling in course offerings, instructors teaching course offerings, and courses being offered. The entity relationship diagram shows the entities and relationships, including use of a bridge table for the many-to-many relationship between students and course offerings. Attributes are identified for primary keys and foreign keys for unique identification. The overall design of the database is presented to track students, courses, instructors and enrollments.

Uploaded by

P Sai Kiran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Assignment-2

Part-A: Modelling a University Registrar Database

What is a University Registrar?

Typically, a University registrar processes registration requests, schedules classes and


maintains class lists, enforces the rules for entering or leaving classes, and keeps a
permanent record of grades and marks. In institutions with selective admission
requirements, a student only begins to be in connection with the registrar's official
actions after admission.

Why is a database required for this?

After knowing about what a university registrar is, one wants to create a database of
university registrar to make the process easier instead of entering the information into
books manually.

Idea of having a database is good, but how to model it?

The idea of creating a database is good, but following are the steps that have to be
followed to create a database and monitor it:
● Creating entities for University Database
● Identifying relationships among them
● Creating attributes for each entity
● Declaring tables for each entity and data types for each attribute according to the
requirements
● Finally updating the database every time and retrieving data whenever required

Now that we got an idea of how a database can be created, we go through each step in
designing the database.

What are the entities to be considered for our database?


Let’s consider a scenario where a university board wants to create a new course by
discussing with the faculty of the university. Then the following details have to be
mentioned in the course:
● Title of the course
● Credits

Name: P. Sai Kiran ​ ​ 1​ ​ Roll no: 160118733169


Assignment-2

● Syllabus
● Prerequisites

After having a description of how the course will be, for the ease of reference, we also
add a course code to every course.

Keeping all these details in mind, we now describe the course entity in a database.

​Course Entity in University Registrar Database

Above table describes how a course entity looks in a database. An example of how a
course entity can be created is just shown here.

What about offering a course to students after creating a course?

After having created a course by the university, it has to be offered to students. So an


entity named course offering has to be created. We have to keep following things in
mind while creating a course offering.

● Make sure that a course offering is unique, provided the university has a
flexibility to offer a course to more than a single student.
● Only a single instructor has to teach the course i.e, no two instructors should
teach for the same course offering.
● At which point of time the course has to be offered to a student should also be
mentioned. This means that at which year and at which semester the course has
to be offered should be mentioned.

Name: P. Sai Kiran ​ ​ 2​ ​ Roll no: 160118733169


Assignment-2

● One has to keep in mind that an instructor can teach a course offering to more
than a single section. So it should also include section no, classroom, lecture
hours etc.

Now, we have a look at the course offering entity.

Course Offering Entity of University Registrar Database

As per the above points mentioned, we include following attributes in the course offering
entity.
● Course code (To know which course if offered)
● Instructor ID (To know who is instructing the course)
● Year (At which year(1st or 2nd or 3rd or 4th) the course has to be offered)
● Semester(At which semester(ranging from I to VIII ) the course has to be offered)
● Section,Room_ID,Timings(Other details of course offering)

What about the details of students who enroll for the course?

Name: P. Sai Kiran ​ ​ 3​ ​ Roll no: 160118733169


Assignment-2

Now, offering a course is okay but to whom the course has to be offered and what are
the details of students who want to enroll for the course?The above question can be
answered by creating a new entity named student.
Following attributes have to be mentioned to uniquely identify a student in a university.

● Student ID (For unique identification of student)


● Student Name (Name of the student)
● Program (Details of the program that he/she has chosen for)

Let’s have a look at student entity

Student Entity of University Registrar Database

One raises a doubt that many students can enroll for a single course
offering and at the same time many course offerings can be enrolled
by a single student. How can we know details of a particular student
that has enrolled for the course?

To resolve the above problem, a bridge entity named​ enrolls​ can be constructed
between student and course offering, which consists of the following attributes so that
the relation becomes unique and identification can be made easily.

Now, we have a look at the enrolls entity

Name: P. Sai Kiran ​ ​ 4​ ​ Roll no: 160118733169


Assignment-2

Enrolls Entity of University Registrar Database

We have included following attributes in enrolls entity

● Enrollment ID(to uniquely identify an enrollment for a course offering)


● Student ID(to know about the student that has enrolled for the course)
● Course Code(to know the details of the course that was offered)

What is the proof that a student has completed a particular course?

To answer the above question, a student has to write an examination of a particular


course and has to pass successfully, thus receiving a grade. So, to have this
information included in the database, a ​grade ​attribute is also included in enrolls identity
to know whether a particular student has successfully completed a particular course
offering after admitting it. If it is null, it means that the student has a backlog in
that course offering, otherwise meaning that a particular student has secured the
mentioned grade in the grade attribute.

Everything is fine, what about the instructor?

Forgot to mention, instructor is the key entity for a course offering to exist. That’s the
reason to include Instructor ID in course offering.Now we’ll have a look at Instructor
Entity.

Name: P. Sai Kiran ​ ​ 5​ ​ Roll no: 160118733169


Assignment-2

Instructor Entity of University Registrar Database

Following are the attributes that has to be included in instructor entity

● Instructor ID(to uniquely identify an instructor in a university)


● Instructor name
● Title of the Instructor(Eg: Professor, Assistant Professor etc.)
● Department(Eg: Computer Science and Engineering)

What does the overall ER Diagram look like?

Following is the overall design of the ER Diagram of the University Database Registrar

Name: P. Sai Kiran ​ ​ 6​ ​ Roll no: 160118733169


Assignment-2

What are the Mapping constraints of the ER Diagram?

Following mapping constraints were mentioned for attributes in the ER Diagram:

1. Primary Key Constraint


2. Foriegn Key Constraint
3. Not Null Constraint

(Note that Primary Key Constraint itself enforces unique constraint)

In the above ER Diagram, ‘N’ represents Not Null constraint.

Name: P. Sai Kiran ​ ​ 7​ ​ Roll no: 160118733169


Assignment-2

What are the attributes that were not enforced a not null constraint
and attributes that were enforced Primary Key Constraint?

Following are the attributes that were not enforced a not null constraint

● Grades​(There may be students who didn’t pass the examination)


● Credits​(There may be non-credit subjects)
● Prerequisites​(There may be courses which doesn’t require prerequisites)

Following are the attributes that were enforced primary key constraint

● Course Code
● Student ID
● Enrollment ID
● Instructor ID

All the above attributes were enforced with primary key constraint for the purpose of
unique identification.

What are the relations that exist among the entities?

Following are the all relations between entities that are mentioned in the diagram
● Student - Course Offerings → Enrolls
● Instructor - Course Offerings → Instructs
● Course - Course Offerings → Offers

We particularly focus on the relation between ​student​ and ​course offering​ because a
many to many relationship​ exists between ​student​ and ​course offering​. For clarity,
a bridge table called ​enrolls ​is constructed which makes it clear to handle the database
with unique identification and also clears redundancy problems.

Other relations don't require a bridge table as they have​ many to one relationship.

Adding to the above, point to note that ​Course Offering​ is a ​Weak Entity​ as it doesn’t
have a primary key.For Unique Identification, ​Foriegn Keys​ are used.Also the
relationship between ​Course Offering​ and ​Enrolls​ is a ​Weak Relationship​, which
was represented by a dashed line connecting both the entities.

Name: P. Sai Kiran ​ ​ 8​ ​ Roll no: 160118733169


Assignment-2

A final question, what should be done after designing a database?

As expected, one can create a database using the above design using a Database
Administrator (DBA) and start using the database by inserting data into it.

That’s all about the Design of a University Registrar Database.

Name: P. Sai Kiran ​ ​ 9​ ​ Roll no: 160118733169


Assignment-2

​Part-2 : Web Interfaces to DataBases

What are the terms used in web interface?

Before starting to discuss what a web interface is, let’s see what’s the process behind
the web pages we visit everyday.

Firstly, we see the terminology used in web interfaces.

1. Web Client: ​A web client is a user who visits the web pages using a web
browser. There are billions of users who visit different web pages everyday.

2. Web Browser: ​A web browser is an engine used to run web applications on a


device such as phone or a PC. A web browser also accesses the web server
depending on the request of the client using protocols. It actually acts as a
platform to run web applications.

3. Web Server: ​A web server is a machine which serves the users according to the
requests received from the clients. It uses the protocol mechanism to
communicate with the user. Web browser acts as an interface between client and
the server, which is responsible for sending the requests to the server and
receiving the response from the server.

4. Web Resources: ​Web resources are files with extensions such as .html, .json,
.pdf etc. These files are loaded into the server and stored in them. Whenever the
user requests to get access to a file in the website, the browser sends a request
for access to these files. Accordingly, the web server related to the site responds
to the request and depending on the permissions given to the user, the server
grants access to these files (host decides whether files of the site are to be public
or private)

5. Protocol: ​A protocol is a mode of communication between the user and the


server. Some of the popular protocols are:

● HyperText Transfer Protocol(HTTP) → Used to transfer hyper text among


two or more systems(Client-Server Communication in general)
● HyperText Transfer Protocol Secure(HTTPS) →Used to transfer hyper
text among two or more systems securely

Name: P. Sai Kiran ​ ​ 10​ ​ Roll no:


160118733169
Assignment-2

● File Transfer Protocol(FTP) → Used to transfer files from one machine to


the other
● Internet Protocol(IP) → Used to route through different networks until
destination is reached

Among the above protocols, HTTP and IP are the most popular as the former is used to
access the content of web pages that were loaded on the server and the latter is used
to connect to the server of ISP(Internet Service Provider) for browsing the internet or
connecting to other servers.

How do these protocols work (or) how does a client communicate


with the server?

Following image illustrates how the protocols between client and server work

​Client-Server communication

Name: P. Sai Kiran ​ ​ 11​ ​ Roll no:


160118733169
Assignment-2

1. Initially, the client connects to the internet through the Internet Service
Provider(ISP). This gives him access to connect to the other computers in the
world.

2. Then the client requests a connection with the web server of the mentioned
domain. Sometimes intermediate servers check the details of the user to make
sure that he/she is authorized to access the server’s contents or not.

3. Then the server has to grant access to establish the connection. On successful
establishment of connection between server and client, they can communicate
with each other through networking protocols.

4. Protocol that goes from client to server is known as a request. Similarly, protocol
that goes from server to client is known as response.

5. When a client sends a request to access the web resources(mentioned above),


the server sends a response granting permission to access them. Then file
transfer from server to the client takes place through FTP(File Transfer Protocol).

Process was clear, but what is a DNS server shown in the diagram?

Domain Name System (DNS) server is like a telephone directory of the internet. When
users type the domain name of the website (Eg: google.com), it searches for the
corresponding server and connects it to the Edge Server(Logically closest Domain
server to the client). Browsers then use those addresses to communicate with the Edge
servers.

Can’t we use web servers for storing and manipulating data i.e,
Can we host a web application on a database?

Good question, this can be explained below.

As mentioned above, the HTTP protocol is the most widely used protocol for navigating
through a website and extracting information from it. But here, one has to note the point
that the HTTP protocol is ​stateless ​i.e, it doesn’t remember the state of the client. For
example, if a client accesses information of a website for more than once, it doesn’t
Name: P. Sai Kiran ​ ​ 12​ ​ Roll no:
160118733169
Assignment-2

remember that the client has requested information previously. It assumes that the user
has requested the information freshly everytime.

This becomes problematic in cases like bank transactions when the state (account
balance) before and after the transaction has to be recorded every time a transaction is
executed.

So, should we embed a database into the web interface architecture?

Exactly.

We place a database, track the transactions of the client in cases of specific domains
(Eg: Banking and Finance websites) where it is important to remember the state of
transactions.

Whenever the client connects to the server of the website’s domain and performs any
transaction, all those details are recorded in the database (Issuing Bank Statements)
through the web server which acts as an intermediate layer between the client and the
database.

Finally, by embedding the database into the web interface, it consists of three
components named

● Client or the User


● Web Server
● Database

Finally, how do you express the above things in a single line?

As the web interface consists of three components, it can be described in a single line
as ​Three-Tier Architecture​. Below diagram illustrates how a Three Tier Architecture
looks.

Two-Tier Architecture, ​also known as Client-Server architecture was also used


previously, when only programmers used to access the database and manipulate it. But
now-a-days, Three-Tier Architecture was introduced to make the applications
user-friendly. This led to a great reform in the history of usage of internet, leading to the
increase of count of users to around ​3.4 billion.

Name: P. Sai Kiran ​ ​ 13​ ​ Roll no:


160118733169
Assignment-2

​Image showing the difference between 2-Tier and 3-Tier Architecture

That’s all about Web Interfaces between Client and the Database, thus making it user
friendly.

Name: P. Sai Kiran ​ ​ 14​ ​ Roll no:


160118733169

You might also like