Hybridoma Technology ( Production , Purification , and Application )
Group No.5's Solution for Advance Database Systems Project
1. Group No.5
Name
Sarmad Ali
Muhammad Abdullah
Noman Rasool
Hashaam Altaaf
Syed Muhammad Hanif Shah
Imran Ahmed
M.Hamza Hanif
M.Usama Yosuf
Roll No.
01
02
25
38
45
46
6
48
2. Department of Information Technology
Solution of Laboratory Manual
Submitted By: Group No.5
Registration No.: BSIT-ISP-MLT-grp #5
Session: 2018
Class: BSIT-5th A
Submitted To: Sir Muhammad Nouman Farooq
3. Course: Advance Database Systems (CS-214)
Project Contents
Perliminary Study
Database Structure
Data-Types
ERD (Entity Relationship Diagram)
Schema Diagram
Database & Table Coding
Views
Joins
Stored Procedures
Triggers
Indexes
Simulator Used: XAMPP Integrated Development Environment using CONSOLE and Navicat
Graphical User Interface (GUI)
4. Perliminary study
We discuss about he Pakistan international stadiums of crickets…..
In this each INT_STADIUMS contain only one CITY ecah city must belong to one and only one
INT_STADIUM…..
INSERT INTO `pakistan international stadiums`.`CITY` VALUES (`karachi,sindh`),(`lahore,punjab`)
,(`sialkot,pujab`),
(`hyderabad,sindh`),(`gujranwala,punjab`),(`peshawar,kpk`),(`rawalpindi,punjab`),(`shiekhupura,punjab`)
,
(`queeta,balochistan`),(`multan,punjab`);
INSERT INTO `pakistan international stadiums`.`STADIUM` VALUES
(`stadium_name,stadium_capacity,stadium_yearbuilt`),
(`natonal cricket stadium karachi,34228,1995`) , (`gadaffi stadium lahore,27000,1959`) , (`iqbal stadium
fsd,18000,1978`) ,
(`jinnah stadium sialkot,20000,1920`) , (`niaz stadium hyderabad,15000,1959`) , (`jinnah stadium
gujranwala,20000,1989`) ,
(`arbab stadium peshawar,20000,1995`) , (`rawalpindi stadium,25000,1993`) , (`shiekhupura
stadium,27000,1996`) ,
(`ayyub stadium queeta,32000,1978`) , (`multan stadium,30000,2001`);
5. Solution of Database Structure
In this Database
two Tables
two Primary Keys
No Foreign Keys
Solution of Database Types
text( )
Varchar( )
Solution of ERD (Entity Relationship Diagram)
Scenario=>in this scenario we study about pakistan cricket international stadiums.in this scenario
Each CITY must contain only one INT-STADIUM and each INT-STADIUM must belong to only and only one CITY.
6. Each CITY must contain only one INT-STADIUM and
each INT-STADIUM must belong to only and only one
CITY.
Relationships as per Business Rule
7. •Cordinality> CITY to INT_STADIUM (mandatory)
•Type of relationship> All relationships are one to one type of relationship.
•Degree> binary because of two entities
8. Database & Table Coding
DROP DATABASE IF EXISTS `pakistan cricket international stadiums`;
CREATE DATABASE IF NOT EXISTS `pakistan cricket international stadiums`;
9. USE `pakistan cricket international stadiums`;
CREATE TABLE `pakistan cricket international stadiums`.`CITY`
(
city_name varchar (15) NOT NULL,
PRIMARY KEY (city_name),
city_province text (16)
);
CREATE TABLE `pakistan cricket international stadiums`.`INT-STADIUM`
(
stadium_name varchar (14) NOT NULL,
PRIMARY KEY (stadium_name),
stadium_capacity int (5),
stadium_yearbuilt int (4),
city_name varchar (15)
);
10. Views & Indexes
• In SQL, a view is a virtual table based on the result set of
an SQL statement
• A view contains rows and columns, just like a real table
create view view_name AS SELECT column_name from
database_name.table_name
11.
12. Stored-Procedure
• A stored procedure is a set of SQL statements that can be stored in the server
• It is a method to encapsulate repetitive tasks
• They allow for variable declarations, flow control and other useful programming techniques
Syntax
DELIMITER //
Create procedure show_continent()
Begin
Select *from `pakistan cricket international stadiums`,`CITY`;
END //
13. Triggers
• Kind of stored procedures
• Use only for DML (is a family of syntax elements similar to a computer programming language used for
selecting, inserting, deleting and updating data in a database) commands
• It fires automatically when these actions are attempted
Syntax
DELIMITER //
CREATE trigger insertlocation after insert on location for each row
BEGIN
insert into `Pakistan cricket international stadiums`.location VALUES
('@Loc_ID','@Loc_e','@Loc_Country','@Loc_State','@Loc_City');
END //
Indexes
Use for sorting record
Create a sorted virtual copy
Faster for efficient searching
CREATE INDEX index_name ON database_name.table_name(column_name);