SlideShare a Scribd company logo
Deepak D. Upadhyay
Enrollment No.: 160511201754
MCA Sem-3
13. Create application for professor to find out whether the professor is enrolled for university.
If enrolled then returned class number associated with that professor.
If professor is not a semester coordinator then give a suitable message.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
● Create Database:
mysql> CREATE DATABASE clg;
Query OK, 1 row affected (0.00 sec)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
● Use Database:
mysql> USE clg;
Database changed
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
● Create Table:
mysql> CREATE TABLE profesor(pid int auto_increment primary key, pname varchar(20), enrol
varchar(3), clss int(3), sem varchar(3));
Query OK, 0 rows affected (0.13 sec)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
● Insert Values in Table:
mysql> INSERT INTO profesor(pname,enrol,clss,sem) VALUES
("Deepak","yes",3,"yes"),("Deepika","yes",2,"no"),("Dipesh","no",4,"yes"),("Diren","no",1,"no");
Query OK, 4 rows affected (0.01 sec)
Records: 4 Duplicates: 0 Warnings: 0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
● Inserted Values in Table:
mysql> SELECT * FROM profesor;
+-----+-----------+-------+------+------+
| pid | pname | enrol | clss | sem |
+-----+-----------+-------+------+------+
| 1 | Deepak | yes | 3 | yes |
| 2 | Deepika | yes | 2 | no |
| 3 | Dipesh | no | 4 | yes |
| 4 | Diren | no | 1 | no |
+-----+-----------+-------+------+------+
4 rows in set (0.02 sec)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Deepak D. Upadhyay
Enrollment No.: 160511201754
MCA Sem-3
● Create Stored Procedure:
mysql> DELIMITER //
mysql> CREATE PROCEDURE Deepak(IN name varchar(20))
-> BEGIN
-> DECLARE er varchar(3);
-> DECLARE cl int(3) default 0;
-> DECLARE se varchar(3);
-> SET er=(SELECT enrol FROM profesor WHERE pname=name);
-> SET cl=(SELECT clss FROM profesor WHERE pname=name);
-> SET se=(SELECT sem FROM profesor WHERE pname=name);
-> IF (er="yes") THEN
-> SELECT CONCAT(name," is Enrolled in University") as Enrolled;
-> IF (cl>0) THEN
-> SELECT name as Profesor, cl as Class;
-> IF (se="yes") THEN
-> SELECT CONCAT(name," is Semester CoOrdinator") as CoOrdinator;
-> ELSE
-> SELECT CONCAT(name," is Not Semester CoOrdinator") as CoOrdinator;
-> END IF;
-> ELSE
-> SELECT CONCAT(name," is Not Associated with Class") as Class;
-> END IF;
-> ELSE
-> SELECT CONCAT(name," is Not Enrolled in University") as Enrolled;
-> END IF;
-> END //
Query OK, 0 rows affected (0.05 sec)
mysql> DELIMITER ;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
● Execute the Stored Procedure:
mysql> CALL Deepak("Deepak");
+-----------------------------------------+
| Enrolled |
+-----------------------------------------+
| Deepak is Enrolled in University |
+-----------------------------------------+
1 row in set (0.03 sec)
+-----------+--------+
| Profesor | Class |
+-----------+--------+
| Deepak | 3 |
+-----------+--------+
Deepak D. Upadhyay
Enrollment No.: 160511201754
MCA Sem-3
1 row in set (0.03 sec)
+-------------------------------------------+
| CoOrdinator |
+-------------------------------------------+
| Deepak is Semester CoOrdinator |
+-------------------------------------------+
1 row in set (0.05 sec)
Query OK, 0 rows affected (0.05 sec)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

More Related Content

PPT
Pubcon Las Vegas 2012 SQL Injection
PPTX
You Are Born To Blossom by Dr. APJ Abdul Kalam Book Review
PDF
Online notice board
PPTX
Man in The Middle Attack
PDF
Progressive Web Applications
PDF
PWA e Hybrid App VS Native
PDF
Progressive web apps
PDF
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Pubcon Las Vegas 2012 SQL Injection
You Are Born To Blossom by Dr. APJ Abdul Kalam Book Review
Online notice board
Man in The Middle Attack
Progressive Web Applications
PWA e Hybrid App VS Native
Progressive web apps
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...

Similar to ADBMS (MySql) tiny project (20)

PDF
Micro project project co 3i
DOC
Sql
PPT
Database queries
PPTX
MergeResult_2023_11_05_10_40_21.pptxoooo
PDF
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
PDF
10 csl57 dbms lab
PDF
MICRO PROJECT 22319 DMS
PDF
DBMS ASSIGNMENT questions list for graduation .pdf
PPTX
College management presentation using Oracle 10G
DOCX
Dbms record
PDF
6. Aggregate Functions.pdf
PDF
Very simple queries of DBMS
PDF
Sql (Introduction to Structured Query language)
PDF
DBMS Notes selection projection aggregate
PDF
lab.123456789123456789123456789123456789
 
DOC
Introduction sql
PPTX
Educational Resource Management System
PDF
4. DML.pdf
PDF
M|18 User Defined Functions
PDF
5. Basic Structure of SQL Queries.pdf
Micro project project co 3i
Sql
Database queries
MergeResult_2023_11_05_10_40_21.pptxoooo
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
10 csl57 dbms lab
MICRO PROJECT 22319 DMS
DBMS ASSIGNMENT questions list for graduation .pdf
College management presentation using Oracle 10G
Dbms record
6. Aggregate Functions.pdf
Very simple queries of DBMS
Sql (Introduction to Structured Query language)
DBMS Notes selection projection aggregate
lab.123456789123456789123456789123456789
 
Introduction sql
Educational Resource Management System
4. DML.pdf
M|18 User Defined Functions
5. Basic Structure of SQL Queries.pdf
Ad

More from Deepak Upadhyay (7)

PPTX
Power of positive attitude
PPTX
EFFICIENT DATA EXTRACTION USING ARTIFICIAL INTELLIGENCE
PPTX
Holographic Data Storage
PPTX
Augmented Reality
PPTX
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
PPTX
Progressive web app
PPTX
Linux fundamentals
Power of positive attitude
EFFICIENT DATA EXTRACTION USING ARTIFICIAL INTELLIGENCE
Holographic Data Storage
Augmented Reality
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Progressive web app
Linux fundamentals
Ad

Recently uploaded (20)

PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Introduction to Artificial Intelligence
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Digital Strategies for Manufacturing Companies
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
assetexplorer- product-overview - presentation
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Designing Intelligence for the Shop Floor.pdf
Softaken Excel to vCard Converter Software.pdf
Introduction to Artificial Intelligence
PTS Company Brochure 2025 (1).pdf.......
Digital Strategies for Manufacturing Companies
Operating system designcfffgfgggggggvggggggggg
assetexplorer- product-overview - presentation
VVF-Customer-Presentation2025-Ver1.9.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Wondershare Filmora 15 Crack With Activation Key [2025
Computer Software and OS of computer science of grade 11.pptx
Reimagine Home Health with the Power of Agentic AI​
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
2025 Textile ERP Trends: SAP, Odoo & Oracle
Odoo Companies in India – Driving Business Transformation.pdf
Understanding Forklifts - TECH EHS Solution
Upgrade and Innovation Strategies for SAP ERP Customers
Digital Systems & Binary Numbers (comprehensive )
Designing Intelligence for the Shop Floor.pdf

ADBMS (MySql) tiny project

  • 1. Deepak D. Upadhyay Enrollment No.: 160511201754 MCA Sem-3 13. Create application for professor to find out whether the professor is enrolled for university. If enrolled then returned class number associated with that professor. If professor is not a semester coordinator then give a suitable message. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ● Create Database: mysql> CREATE DATABASE clg; Query OK, 1 row affected (0.00 sec) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ● Use Database: mysql> USE clg; Database changed ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ● Create Table: mysql> CREATE TABLE profesor(pid int auto_increment primary key, pname varchar(20), enrol varchar(3), clss int(3), sem varchar(3)); Query OK, 0 rows affected (0.13 sec) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ● Insert Values in Table: mysql> INSERT INTO profesor(pname,enrol,clss,sem) VALUES ("Deepak","yes",3,"yes"),("Deepika","yes",2,"no"),("Dipesh","no",4,"yes"),("Diren","no",1,"no"); Query OK, 4 rows affected (0.01 sec) Records: 4 Duplicates: 0 Warnings: 0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ● Inserted Values in Table: mysql> SELECT * FROM profesor; +-----+-----------+-------+------+------+ | pid | pname | enrol | clss | sem | +-----+-----------+-------+------+------+ | 1 | Deepak | yes | 3 | yes | | 2 | Deepika | yes | 2 | no | | 3 | Dipesh | no | 4 | yes | | 4 | Diren | no | 1 | no | +-----+-----------+-------+------+------+ 4 rows in set (0.02 sec) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  • 2. Deepak D. Upadhyay Enrollment No.: 160511201754 MCA Sem-3 ● Create Stored Procedure: mysql> DELIMITER // mysql> CREATE PROCEDURE Deepak(IN name varchar(20)) -> BEGIN -> DECLARE er varchar(3); -> DECLARE cl int(3) default 0; -> DECLARE se varchar(3); -> SET er=(SELECT enrol FROM profesor WHERE pname=name); -> SET cl=(SELECT clss FROM profesor WHERE pname=name); -> SET se=(SELECT sem FROM profesor WHERE pname=name); -> IF (er="yes") THEN -> SELECT CONCAT(name," is Enrolled in University") as Enrolled; -> IF (cl>0) THEN -> SELECT name as Profesor, cl as Class; -> IF (se="yes") THEN -> SELECT CONCAT(name," is Semester CoOrdinator") as CoOrdinator; -> ELSE -> SELECT CONCAT(name," is Not Semester CoOrdinator") as CoOrdinator; -> END IF; -> ELSE -> SELECT CONCAT(name," is Not Associated with Class") as Class; -> END IF; -> ELSE -> SELECT CONCAT(name," is Not Enrolled in University") as Enrolled; -> END IF; -> END // Query OK, 0 rows affected (0.05 sec) mysql> DELIMITER ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ● Execute the Stored Procedure: mysql> CALL Deepak("Deepak"); +-----------------------------------------+ | Enrolled | +-----------------------------------------+ | Deepak is Enrolled in University | +-----------------------------------------+ 1 row in set (0.03 sec) +-----------+--------+ | Profesor | Class | +-----------+--------+ | Deepak | 3 | +-----------+--------+
  • 3. Deepak D. Upadhyay Enrollment No.: 160511201754 MCA Sem-3 1 row in set (0.03 sec) +-------------------------------------------+ | CoOrdinator | +-------------------------------------------+ | Deepak is Semester CoOrdinator | +-------------------------------------------+ 1 row in set (0.05 sec) Query OK, 0 rows affected (0.05 sec) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++