Professional Documents
Culture Documents
DBMS Micro
DBMS Micro
2023-2024
1
CMR Institute of Technology
(UGC AUTONOMOUS)
(Approved by AICTE, Affiliated to JNTU, Kukatpally, Hyderabad) Kandlakoya,
Medchal Road, Hyderabad.
CERTIFICATE
This is to certify that a Micro Project entitled with: “DESIGNING A RELATIONAL
DATABASE FOR UNIVERSITY REGISTER’S OFFICE” is being
Submitted by
C. LAKSHMI SREE 22R01A0411
C. SRIKANTH 22R01A0412
CH. AKASH 22R01A0413
2
ACKNOWLEDGEMENT
We are extremely grateful to Dr. M. Janga Reddy, Director,
Dr. B. Satyanarayana, Principal and Mr. A. Prakash, Head of Department, Dept of
Computer Science and Engineering, CMR Institute of Technology for their inspiration
and valuable guidance during entire duration.
We express our thanks to all staff members and friends for all the help and
coordination extended in bringing out this Project successfully in time.
Finally, we are very much thankful to our parents and relatives who guided
directly or indirectly for successful completion of the project.
3
CONTENTS
1. Introduction 5
2. Advantages of RDBMS 9
3. SQL Query 10
4. Conclusion 13
5. References 13
4
INTRODUCTION:
● All modern database management systems like SQL, MS SQL Server, IBM
DB2, ORACLE, My-SQL and Microsoft Access are based on RDBMS.
● It is called Relational Data Base Management System (RDBMS) because it is
based on relational model introduced by E.F. Codd.
● Relational database is most commonly used database. It contains number of
tables and each table has its own primary key.
SQL:
● SQL stands for Structured Query Language. It is used for storing and managing
data in relational database management system (RDBMS).
● It is a standard language for Relational Database System. It enables a user to
create, read, update and delete relational databases and tables.
● All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server
use SQL as their standard database language.
● SQL allows users to query the database in a number of ways, using English-like
statements.
5
SQL Commands:
● SQL commands are instructions. It is used to communicate with the database.
It is also used to perform specific tasks, functions, and queries of data.
● SQL can perform various tasks like create a table, add data to tables, drop
the table, modify the table, set permission for users.
There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.
6
a. DROP: It is used to delete both the structure and record stored in the table.
Syntax: DROP TABLE table_name;
b. ALTER: It is used to alter the structure of the database. This change could be either
to modify the characteristics of an existing attribute or probably to add a new
attribute.
Syntax: ALTER TABLE table_name ADD column_name COLUMN-definition;
c. TRUNCATE: It is used to delete all the rows from the table and free the space
containing the table.
Syntax: TRUNCATE TABLE table_name;
b. UPDATE: This command is used to update or modify the value of a column in the
table. Syntax: UPDATE table_name SET [column_name1= value1,...column_nameN
= valueN] [WHERE CONDITION]
7
b. Revoke: It is used to take back permissions from the user.
Syntax: REVOKE SELECT, UPDATE ON MY_TABLE FROM USER1, USER2;
b. Rollback: Rollback command is used to undo transactions that have not already been
saved to the database.
Syntax: ROLLBACK;
c. SAVEPOINT: It is used to roll the transaction back to a certain point without rolling
back the entire transaction.
Syntax: SAVEPOINT SAVEPOINT_NAME;
Relational Algebra
Relational algebra is a procedural query language, which takes instances of relations as
input and yields instances of relations as output. It uses operators to perform queries. An
operator can be either unary or binary. They accept relations as their input and yield
relations as their output. Relational algebra is performed recursively on a relation and
intermediate results are also considered relations.
REQUIREMENTS:
Hardware Requirements:
Software Requirements:
● Easy Maintenance
● A record in one table could be related to another record in a different table (1:1
relationship)
● A record in one table may be related to several records in other tables (1:M
relationship)
● Several table records could be linked to multiple records in a different table (M: N
relationship)
However, before tables are created, a relational database management system must ensure
that:
● Each table has a unique primary key, which has no null values.
● The foreign key, which is used to relate to 2 tables, is preserved in one table and
refers to the primary key of another table.
● No column has a null value (empty cell).
9
SQL Query
SQL> Create table Student (student_id number (10) primary key, name char
(20), program varchar2(10));
OUTPUT:
Student_id name program
SQL> Create table Course (courseno varchar2 (10) primary key, title char
(10), syllabus char(10), credits number(10));
OUTPUT:
courseno title syllabus credits
OUTPUT:
10
4. Instructor (instructor-id, name, dept, title)
SQL> Create table Instructor (instructor_id number (7) primary key, name
char (10), dept char (7), title char (10));
OUTPUT:
SQL> Create table Enrols (student_id number (10), courseno varchar2 (10),
secno char (10), semester varchar2(10), year number (5), grade varchar2(5),
foreign key(courseno) references Course(courseno), foreign key(student_id)
references student(student_id), foreign key (secno) references
Course-offering(secno), foreign key(semester) references
Course-offering(semester));
OUTPUT:
student_id courseno secno semester year grade
11
OUTPUT:
OUTPUT:
maincourse prerequisite
12
CONCLUSION
Relational databases store data in tables. Tables can grow large and have a multitude of
columns and records. Relational database management systems (RDBMSs) use SQL (and
variants of SQL) to manage the data in these large tables. The RDBMS you use is your
choice and depends on the complexity of your application.
You learned that the structure of a relational database is based on the relational model.
You also learned that the largest structure in a relational database is a table, which
contains fields, records, and a primary key. You discovered that using the primary-key
field to link tables allows data to be accessed in a relational database.
Finally, you learned that Structured Query Language (SQL) is the programming language
used to create relational databases, and that a relational database management system
(RDBMS) is a software package used to manage relational databases.
REFERENCES
● https://www.oracle.com/in/database/what-is-a-relation
al-database/
● https://www.ionos.com/digitalguide/hosting/technical-
matters/relational-databases/
13