DBMS Assignment-2
DBMS Assignment-2
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.
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.
● 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.
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.
● 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.
● 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.
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?
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.
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.
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.
Following is the overall design of the ER Diagram of the University Database Registrar
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
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.
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.
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.
Before starting to discuss what a web interface is, let’s see what’s the process behind
the web pages we visit everyday.
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.
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)
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.
Following image illustrates how the protocols between client and server work
Client-Server communication
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.
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?
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.
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
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.
That’s all about Web Interfaces between Client and the Database, thus making it user
friendly.