This Doc Consist of ER diagram of University and NHL, Introduction to posgres SQL and installation,DML and its various commands,implementation of constraints with examples,DML Implementation with set operations & Functions,Implementation of nested Queries.
PL/SQL is a combination of SQL along with the procedural features of programming languages.
It provides specific syntax for this purpose and supports exactly the same datatypes as SQL.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
in this presentation the commands let you help to understand the basic of the database system software. how to retrieve data, how to feed data and manipulate it very efficiently by using this commands.
PL/SQL is a combination of SQL along with the procedural features of programming languages.
It provides specific syntax for this purpose and supports exactly the same datatypes as SQL.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
in this presentation the commands let you help to understand the basic of the database system software. how to retrieve data, how to feed data and manipulate it very efficiently by using this commands.
YouTube Link: https://youtu.be/f6VWSlnHGCE
** MySQL DBA Certification Training: https://www.edureka.co/mysql-dba **
This Edureka PPT on 'SQL Triggers' will help you understand the concept of triggers in SQL. Below are the topics covered in this SQL Triggers For Beginners.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
PHP provides access to a great number of different database systems, many of which are relational in nature and can be interrogated using Structured Query Language (SQL).
YouTube Link: https://youtu.be/f6VWSlnHGCE
** MySQL DBA Certification Training: https://www.edureka.co/mysql-dba **
This Edureka PPT on 'SQL Triggers' will help you understand the concept of triggers in SQL. Below are the topics covered in this SQL Triggers For Beginners.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
PHP provides access to a great number of different database systems, many of which are relational in nature and can be interrogated using Structured Query Language (SQL).
This short text will get you up to speed in no time on creating visualizations using R's ggplot2 package. It was developed as part of a training to those who had no prior experience in R and had limited knowledge on general programming concepts. It's a must have initial guide for those exploring the field of Data Science
Postgres has the unique ability to act as a powerful data aggregator in many data centers. This presentation shows how Postgres's extensibility, access to foreign data sources, and ability handle NoSQL-like and data warehousing workloads gives it unmatched capabilities to function in this role.
SQLMAP is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers.
Best Data Science Ppt using Python
Data science is an inter-disciplinary field that uses scientific methods, processes, algorithms and systems to extract knowledge and insights from many structural and unstructured data. Data science is related to data mining, machine learning and big data.
Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINAJISC GECO
Presentation given as part of the DevCSI/JISC GECO Open Mapping Workshop which was held at the Electron Club, CCA, Glasgow on Thursday 25th August 2011. The event was connected to the OpenStreetMap State of the Map Scotland event.
A talk given by Julian Hyde at DataCouncil SF on April 18, 2019
How do you organize your data so that your users get the right answers at the right time? That question is a pretty good definition of data engineering — but it is also describes the purpose of every DBMS (database management system). And it’s not a coincidence that these are so similar.
This talk looks at the patterns that reoccur throughout data management — such as caching, partitioning, sorting, and derived data sets. As the speaker is the author of Apache Calcite, we first look at these patterns through the lens of Relational Algebra and DBMS architecture. But then we apply these patterns to the modern data pipeline, ETL and analytics. As a case study, we look at how Looker’s “derived tables” blur the line between ETL and caching, and leverage the power of cloud databases.
Similar to DataBase Management System Lab File (20)
This file work is made for the purpose of learning and to get knowledge about programs in big data. Relevant information is taken from various sources. This file was for acadmic purpose and it is shared for learnig purposes
This doc contain information about upcoming pen style networking technology called as 5 Pen Pc Technology.All the relevant data is taken from various sources and accordingly made for information and academic related purposes.
This Doc consist of description of different types of lan networks and equipment and devices, Toplogies, C program of bit,byte and character stuffing, various routing algorithms, programs of Hello_client and Hello_server.
A common parking issue faced by the people of India due to insufficient parking spaces available.So smart parking system is developed to overcome the problem of congestion of vehicles,traffic issues and much more.It is IOT based with use of different sensors and other devices.To save time and fuel we need to have such a smart system.It will be beneficial in controlling the pollution too.
This S.R.S deals with the basic's of hotel management system.It will show different features with different functionalities.Data Flow diagram is also mentioned With 0 and 1 Level diagram.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
Automobile Management System Project Report.pdfKamal Acharya
The proposed project is developed to manage the automobile in the automobile dealer company. The main module in this project is login, automobile management, customer management, sales, complaints and reports. The first module is the login. The automobile showroom owner should login to the project for usage. The username and password are verified and if it is correct, next form opens. If the username and password are not correct, it shows the error message.
When a customer search for a automobile, if the automobile is available, they will be taken to a page that shows the details of the automobile including automobile name, automobile ID, quantity, price etc. “Automobile Management System” is useful for maintaining automobiles, customers effectively and hence helps for establishing good relation between customer and automobile organization. It contains various customized modules for effectively maintaining automobiles and stock information accurately and safely.
When the automobile is sold to the customer, stock will be reduced automatically. When a new purchase is made, stock will be increased automatically. While selecting automobiles for sale, the proposed software will automatically check for total number of available stock of that particular item, if the total stock of that particular item is less than 5, software will notify the user to purchase the particular item.
Also when the user tries to sale items which are not in stock, the system will prompt the user that the stock is not enough. Customers of this system can search for a automobile; can purchase a automobile easily by selecting fast. On the other hand the stock of automobiles can be maintained perfectly by the automobile shop manager overcoming the drawbacks of existing system.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
1. 1 | P a g e
Submitted To:- Submitted By:-
Sir Arun Kumar Uttam Singh Chaudhary
(17EMBIT055)
2. 2 | P a g e
Table of Contents
S.no Experiment Page no.
1 Database design using E-R model of
university
4
2 Database design using E-R model
National Hockey league
5-8
3 Introductionto PostGres SQL and its
installation.
9-17
4 Implementation of Data Definition
language (DML), Commands with
Examples
i. Create Database
ii. Select Database
iii. Delete Database
iv. Create Table
v. Delete Table
vi. Insertion Data into table, Etc.
18-23
5 Implement type of Constraintswith
Examples
(a) Primary key, (b) Foreign Key,
(c) Check, (d) Unique (e) Null
(f) Not null, (g) Default
24-28
6 Implementation on Data
Manipulation (DML) (Introductionto
29-32
3. 3 | P a g e
SQL)
a. Select clause
b. From clause
c. Where clause
7 implementation on Data
Manipulation (DML)
a. Aggregation functions (Min,
Max, Sum, Avg, count)
b. Group by clause
c. Having
d. Rename operation (as)
33-36
8 Implementation on Data
Manipulation (DML), Set Operations
a. Union Operation
b. Intersect Operation
c. Except Operation
37-39
9 Implementation of Nested Queries 40-45
10 Create a Company Database and
Write SQL retrieval queries with
example.
46-54
4. 4 | P a g e
Experiment:-1
Aim:-Design a ER diagram for the University
database
Fig :1
It describe different entities having relation with each other.
5. 5 | P a g e
Experiment:-2
Aim:-Design a clean and clear ER diagram for the NHL
Database.
Fig:-2
It describes National hockey league database with different
entities having set of attributes with relationship among them.
6. 6 | P a g e
Definitions:
1. Entity:- An entity can be any real world object that has an
independent existence.
E.g.:- person, place, object etc.
2. Attributes:- Attributes can be described as the properties of
entities.
Types of attributes:-
Simple:- Attributes which can’t be broken into
smaller subparts.
E.g.:- Student Id.
Composite:- Attributes which can be broken down
into smaller parts.
E.g.:- Student Name.
Single valued:-Attributes having only one value.
E.g.:- Student Age.
Multi-valued:- Attributes having more thanone value.
E.g.:-Student Mobile Number
Stored:-Attribute which is already present as an
attribute for an entity.
7. 7 | P a g e
E.g.;- Student college duration can be calculated using date of
joining. Here Date of joining is stored attribute.
Derived:- Attribute which is derived from stored attributes it
was not present as an attribute for an entity.
E.g.:- Student college duration is derived attribute.
Null:-Attributes having null values.
E.g.:- Student Mobile Number may or may not have
null value.
3. Specialization:- It is a process of creating subclasses out of
given entity types.
4. Generalization:- It is a process in which two or more entity
types are taken and grouped under a common subclass. It
is a reverse process of specialization.
5. Relationship:- This shows relations between different
entities and hold together various component of ER model.
6. Keys:- Keys are the attributes used to distinguish one entity
from another in entity set.
8. 8 | P a g e
TYPES OF KEYS:-
Super key:- It is a set of key having one or more
attribute that can uniquely identify entity in a entity
set.
Candidate Key:- Least combination of attributes that
can uniquely identify an entity set. It could be subset
of super key.
Primary Key:- It is the candidate key which is most
appropriate key for the table. It is decided by the
administrator.
Foreign Key:- It is generally a primary key that serve
as a field to another field in the same database.
Simple Key:- It is a key having single attribute.
Composite key:-It is a key which is not simple key but
having more than one attribute.
Compound Key:- It is key which is not composite key.
Alternate Key:-It is term used for candidate key
which is chosen after choosing a primary key by
database designer.
9. 9 | P a g e
Experiment 3
Aim: Introduction to PostGreSQL and its installation.
SQL is also called SE-QU-EL. It has got some historical
significance - the initial name of SQL
was Simple English Query Language.
You will be using PostgreSQL as the relational database
management system. PostgreSQL is very light-weight,
and it is free as well.
What is PostgreSQL?
PostgreSQL is a powerful, open source object-relational
database system that uses and extends the SQL language
combined with many features that safely store and scale
the most complicated data workloads.
PostgrSQL has earned a strong reputation for its proven
architecture, reliability, data integrity, robust feature set,
extensibility, and the dedication of the open source
community behind the software to consistently deliver
performing and innovative solutions.
10. 10 | P a g e
PostgreSQL runs on all major operating systems, has
been ACID-compliant since 2001, and has powerful add-
ons such as the popular PostGRES geospatial database
extender. It is no surprise that PostgreSQL has become
the open source relational database of choice for many
people and organizations .
Install PostgreSQL step by step
Start Installing PostgreSQL
Specify installation folder, choose your own or keep the
default folder suggested by PostgreSQL installer.
11. 11 | P a g e
Enterthe password for the database super user and service
account.
Enter the port for PostgreSQL. Make sure that no other
applications are using this port. Leave it as default if you
are unsure.
12. 12 | P a g e
Choose the default locale used by the database.
13. 13 | P a g e
You’ve completed providing information for the
PostgreSQL installer. Click the Next button to install
PostgreSQL
14. 14 | P a g e
The installation may take few minutes to complete.
15. 15 | P a g e
Click the Finish button to complete the PostgreSQL
installation.
Verify the Installation
There are several ways to verify the installation. You can
try to connect to the PostgreSQL database server from
any client application e.g., psql and pgAdmin.
The quick way to verify the installation is through
the pgAdmin application.
16. 16 | P a g e
First, click on pgAdmin III to launch it. The pgAdmin III
GUI will display.
Second, double-click PostgreSQL 9.5 on the object
browser. It will ask you for the admin password. Just
enter the password you’ve used in the installation step.
17. 17 | P a g e
Third, if everything is fine, the pgAdmin will display all
the objects that belong to the server.
Congratulation!you’ve successfully installed PostgreSQL
database server on your local system.
18. 18 | P a g e
Experiment:-4
Aim:-Implementation of Data Definition language
(DML), Commands with Examples
i. Create Database
ii. Select Database
iii. Delete Database
iv. Create Table
v. Delete Table
vi. Insertion Data into table, Etc.
DDL- Data Definition Language (DDL) statements are
used to define the database structure or schema.
DDL uses different statements :
CREATE - to create objects in the database
ALTER - alters the structure of the database
DROP - delete objects from the database
TRUNCATE - remove all records from a table, including
all spaces allocated for the records are removed
19. 19 | P a g e
COMMENT - add comments to the data dictionary
RENAME - rename an object
CREATE TABLE
Syntax: Create table tablename( fieldname1
datatype(),fieldname2 datatype()...);
ALTER TABLE
1. ADD
2.MODIFY
ADD
Syntax:alter table table name ADD (fieldname
datatype()...);
modify
syntax: Alter table table name modify (fieldname
datatype()...);
DESCRIBE TABLE
Syntax: DESCRIBE TABLE NAME;
DROP TABLE
Syntax: DROP Table name;
20. 20 | P a g e
COMMENT - add comments to the data dictionary
RENAME - rename a table
Synatax: rename table table name to new table name
Examples : In this example we creates a table and insert
the values.
21. 21 | P a g e
Example : In the following figure shows the alter a table .
For Example : In this figure shows the describe
command.
22. 22 | P a g e
DML- Data Manipulation Language (DML) statements
are used for managing data within schema objects DML
deals with data manipulation, and therefore includes most
common SQL statements such SELECT, INSERT, etc.
DML allows to add / modify / delete data itself.
DML is used to manipulate with the existing data in the
database objects (insert, select, update, delete).
DML Commands:
1.INSERT
2.SELECT
3.UPDATE
4.DELETE
*INSERT:
Syntax: INSERT INTO Table name values();
*SELECT:
Syntax: Select*from <table name>
*UPDATE:
Syntax: Update<table name> set to(calculation);
*DELETE:
Syntax: Delete form<table name>
23. 23 | P a g e
Example : In the below figure shows the update and
delete command on the given table.
24. 24 | P a g e
Experiment :-5
Aim:-Implement type of constraints with examples
(a) Primary key
(b) Foreign key
(c) Check
(d) Unique
(e) Null
(f) Not null
(g) Default
Primary Keys:
Primary key uniquely identifies each record in a table. It
must have unique values and cannot contain nulls. In the
below example the ROLL_NO field is marked as primary
key, that means the ROLL_NO field cannot have
duplicate and null values.
25. 25 | P a g e
CREATE TABLE STUDENT(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL UNIQUE,
STU_AGE INT NOT NULL,
STU_ADDRESS VARCHAR (35) UNIQUE,
PRIMARY KEY (ROLL_NO)
);
Foreign keys: are the columns of a tablethat points to the
primary key of another table. They act as a cross-
reference between tables.
This constraint is used for specifying range of values for a
particular column of a table. When this constraint is being
set on a column, it ensures that the specified column must
have the value falling in the specified range.
CREATE TABLE STUDENT(
ROLL_NO INT NOT NULL CHECK(ROLL_NO
>1000) ,
STU_NAME VARCHAR (35) NOT NULL,
26. 26 | P a g e
STU_AGE INT NOT NULL,
EXAM_FEE INT DEFAULT 10000,
STU_ADDRESS VARCHAR (35) ,
PRIMARY KEY (ROLL_NO)
);
In the above example we have set the check constraint on
ROLL_NO column of STUDENT table. Now, the
ROLL_NO field must have the value greater than 1000.
UNIQUE Constraint:enforces a column or set of columns
to have unique values. If a column has a unique
constraint, it means that particular column cannot have
duplicate values in a table.
CREATE TABLE STUDENT(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL UNIQUE,
STU_AGE INT NOT NULL,
STU_ADDRESS VARCHAR (35) UNIQUE,
PRIMARY KEY (ROLL_NO)
27. 27 | P a g e
);
NOT NULL: constraint makes sure that a column does
not hold NULL value. When we don’t provide value for a
particular column while inserting a record into a table, it
takes NULL value by default. By specifying NULL
constraint, we can be sure that a particular column(s)
cannot have NULL values.
Example:
CREATE TABLE STUDENT(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL,
STU_AGE INT NOT NULL,
STU_ADDRESS VARCHAR (235),
PRIMARY KEY (ROLL_NO)
);
28. 28 | P a g e
The DEFAULT: constraint provides a default value to a
column when there is no value provided while inserting a
record into a table.
Example:-
CREATE TABLE STUDENT(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL,
STU_AGE INT NOT NULL,
EXAM_FEE INT DEFAULT 10000,
STU_ADDRESS VARCHAR (35) ,
PRIMARY KEY (ROLL_NO)
);
29. 29 | P a g e
Experiment:-6.
Aim:-Explain Data ManipulationLanguage(DML)
with examples in DBMS.
Data manipulation language (DML) can be defined as a
set of syntax elements that are used to manage the data in
the database. The commands of DML are not auto
committed and modification made by them are not
permanent to the database. It is a computer programming
language that is used to perform select, insert delete and
updatedata in a database.Theuser requests are assisted by
data manipulation language. This language is responsible
for all forms of data modification in a database.
Types of Data Manipulation Languages.
1.Procedural programming
In this type the user will specify what data is required
and how to get it.
2 Declarative programming
Here, the user will only specify what data is required
30. 30 | P a g e
Commands
The DML section of SQL consists of following a set of
commands.
Select/From/Where
Insertinto/values
Update/set/where
Delete/from/where
The database programmers and users are allowed by this
basic to enter the data and information into the database
and then retrieve it by the use of several numbers of filter
option.
Select/from/where
Select
It is one of the basic query commands available in SQL
and works in the same way as the projection operation of
relational algebra. The attributes are selected by this
command on the basis of the condition defined by the
where clause.
From
A relation name is taken by this clause as an argument
from where attributed are to be projected or selected.
31. 31 | P a g e
Where
The predictions or conditions that should match for
qualifying the attributed to be projected are defined by
this clause.
For example
Select author_name
From book-set
Where age>40
The name of the authors will be yield by the command
from the relation book set whose age is greater than 40.
e.g.
SQL> select*from student
32. 32 | P a g e
OUTPUT:-
ROLL NO. NAME MARKS ADDR
101 ABC 75 LINK ROAD
102 XYZ 80 JM ROAD
103 PQR 87 N7
SQL>select *from student where marks=80
ROLL NO. NAME MARKS ADDR
102 XYZ 80 JM ROAD
33. 33 | P a g e
Experiment:7
Aim:- Implementationof Aggregate Functions
These functions operate on the multiset of values of a
column of a relation, and return a value
avg: average value
min: minimum value
max: maximum value
sum: sum of values
count: number of values
Q.1 Find the avg salary of employee from employee table
Ans:- Select avg(salary)
From employee
Q.2 Find the no. of employee who worksin dept-no.2
Ans:- Select count(*)
From employee
Where dept-no.2
34. 34 | P a g e
Q.3 Find the no. of cities where dept present
Ans:-Select count(distinct(city))
From department
Q.4 Give the age of oldest employee
Ans:-Select max(age)
From employee
Q.5 Find the mini. Age of employee whose salary is
greater than 50K
Ans:- Select min(age)
From employee
Where salary>50K
Q.6 Find the total salary of all employees
Ans:- Select sum(salary)
From employee
35. 35 | P a g e
Aggregate Functions –Group By
Find the average salary of instructors in each department
select dept_name, avg(salary) as avg_salary
from instructor
group by dept_name;
Attributes in select clause outside of aggregate functions
must appear in group bylist
/* erroneous query */
select dept_name, ID, avg(salary)
from instructor
group by dept_name;
Aggregate Functions –Having Clause
Find the names and average salaries of all departments
whose average salary is greater than 42000
36. 36 | P a g e
select dept_name, avg(salary)
from instructor
group by dept_name
having avg(salary) > 42000;
Note: predicates in the havingclause are applied after the
formation of groups whereas predicates in the where
clause are applied before forming groups
RENAME OPERATOR:-
Employee(employee_name,e_id,age,salary)
Q. Find the name of employee whose salary is greater
than 20K
Select employee_name as name
From employee
Where salary>20K
37. 37 | P a g e
Experiment:-8
Aim:-Implementation of Set operations on Data
manipulation language
Set Operations:-
Find courses that ran in Fall 2009 or in Spring 2010
(selectcourse_idfrom section where sem= ‘Fall’ and year
= 2009)
Union
(selectcourse_idfrom section where sem= ‘Spring’ and
year = 2010)
Find courses that ran in Fall 2009 but not in Spring 2010
(selectcourse_idfrom section where sem= ‘Fall’ and year
= 2009)
Intersect
(selectcourse_idfrom section where sem= ‘Spring’ and
year = 2010)
38. 38 | P a g e
Find courses that ran in Fall 2009 and in Spring 2010
(selectcourse_idfrom section where sem= ‘Fall’ and year
= 2009)
Except
(selectcourse_idfrom section where sem= ‘Spring’ and
year = 2010)
1.Find the salaries of all instructors that are less than the
largest salary
select distinct T.salary
from instructor as T, instructor as S
where T.salary< S.salary
2.Find all the salaries of all instructors
select distinct salary
from instructor
39. 39 | P a g e
3.Find the largest salary of all instructors
(select“second query” )
Except
(select“first query”)
Set operations union, intersect, and except
Each of the above operations automatically eliminates
duplicates
To retain all duplicates use the corresponding multiset
versions union all, intersect alland except all.
Suppose a tuple occurs mtimes in rand n times in s, then,
it occurs:
m + n times in r union all s
min(m,n)times in rintersect all s
max(0, m –n)times in rexcept all s
40. 40 | P a g e
EXPERIMENT-9
Aim:-IMPLEMENTATION OF NESTED QUERIES
In nested queries, a query is written inside a query. The
result of inner query is used in execution of outer query.
We will use STUDENT, COURSE,
STUDENT_COURSEtablesfor understandingnested
queries.
STUDENT
S_ID S_NAME S_ADDRESS S_PHONE S_AGE
S1 RAM DELHI 9455123451 18
S2 RAMESH GURGAON 9652431543 18
S3 SUJIT ROHTAK 9156253131 20
S4 SURESH DELHI 9156768971 18
41. 41 | P a g e
COURSE
C_ID C_NAME
C1 DSA
C2 Programming
C3 DBMS
STUDENT_COURSE
S_ID C_ID
S1 C1
S1 C3
S2 C1
S3 C2
S4 C2
S4 C3
42. 42 | P a g e
There are mainly two types of nested queries:
Independent Nested Queries: In independent nested
queries, query execution starts from innermost query
to outermost queries. The execution of inner query is
independent of outer query, but the result of inner
query is used in execution of outer query. Various
operators like IN, NOT IN, ANY, ALL etc are used in
writing independent nested queries.
IN: If we want to find out S_ID who are enrolled
in C_NAME ‘DSA’ or ‘DBMS’, we can write it with
the help of independent nested query and IN operator.
From COURSE table, we can find
out C_ID for C_NAME ‘DSA’ or DBMS’ and we can
use these C_IDs for finding S_IDs
from STUDENT_COURSE TABLE.
STEP1: Finding C_ID for C_NAME =’DSA’or
‘DBMS’
Select C_ID from COURSE where C_NAME = ‘DSA’
or C_NAME = ‘DBMS’
43. 43 | P a g e
STEP 2: Using C_ID of step 1 for finding S_ID
Select S_ID from STUDENT_COURSEwhere C_ID IN
(SELECT C_ID from COURSE where C_NAME =
‘DSA’ or C_NAME=’DBMS’);
STEP 3: Using C_ID of step 1 for finding S_ID
Select S_ID from STUDENT_COURSEwhere C_ID IN
(SELECT C_ID from COURSE where C_NAME =
‘DSA’ or C_NAME=’DBMS’);
The inner query will return a set with members C1 and C3
and outer query will return those S_IDs for
which C_ID is equal to any member of set (C1 and C3 in
this case). So, it will return S1, S2 and S4.
Note: If we want to find out names of STUDENTs
who have either enrolledin ‘DSA’ or ‘DBMS’, it can
be done as:
44. 44 | P a g e
Select S_NAME from STUDENT where S_ID IN
(Select S_ID from STUDENT_COURSE
where C_ID IN
(SELECT C_ID from COURSE where C_NAME=’DSA
’ or C_NAME=’DBMS’));
NOT IN: If we want to find out S_IDs
of STUDENTs who have neither enrolled in ‘DSA’
nor in ‘DBMS’, it can be done as:
Select S_ID from STUDENT where S_ID NOT IN
(Select S_ID from STUDENT_COURSE
where C_ID IN
(SELECT C_ID from COURSE where C_NAME=’
DSA’ or C_NAME=’DBMS’));
The innermost query will return a set with members C1
and C3. Second inner query will return those S_IDs for
which C_ID is equal to any member of set (C1 and C3 in
this case) which are S1, S2 and S4. The outermost query
will return those S_IDs where S_ID is not a member of
set (S1, S2 and S4). So it will return S3.
45. 45 | P a g e
Co-related Nested Queries: In co-related nested
queries, the output of inner query dependson the row
which is being currentlyexecuted in outer query. e.g.;
If we want to find out S_NAME of STUDENTswho
are enrolled in C_ID ‘C1’, it can be done with the
help of co-related nested query as:
Select S_NAME from STUDENT S where EXISTS
( select * from STUDENT_COURSE SC where
S.S_ID=SC.S_ID and SC.C_ID=’C1’).
For each row of STUDENT S, it will find the rows
from
STUDENT_COURSE
where S.S_ID = SC.S_ID and SC.C_ID=’C1’.
If for a S_ID from STUDENT S, atleast a row exists
in STUDENT_COURSE SC with C_ID=’C1’, then
inner query will return true and
corresponding S_ID will be returned as output.
46. 46 | P a g e
Experiment:-10
Aim:-Create a company database and Write SQL
Retrieval Queries with example
CREATE TABLE employee (
emp_idINT PRIMARY KEY,
first_nameVARCHAR(40),
last_nameVARCHAR(40),
birth_dayDATE,
sexVARCHAR(1),
salaryINT,
super_idINT,
branch_idINT
);
CREATE TABLE branch (
branch_idINT PRIMARY KEY,
branch_nameVARCHAR(40),
mgr_idINT,
mgr_start_dateDATE,
47. 47 | P a g e
FOREIGN KEY(mgr_id) REFERENCES
employee(emp_id) ONDELETESETNULL
);
ALTERTABLE employee
ADD FOREIGN KEY(branch_id)
REFERENCESbranch(branch_id)
ONDELETESETNULL;
ALTERTABLE employee
ADD FOREIGN KEY(super_id)
REFERENCESemployee(emp_id)
ONDELETESETNULL;
CREATETABLEclient (
client_idINT PRIMARY KEY,
client_nameVARCHAR(40),
branch_idINT,
48. 48 | P a g e
FOREIGN KEY(branch_id) REFERENCES
branch(branch_id) ONDELETESETNULL
);
CREATETABLEworks_with (
emp_idINT,
client_idINT,
total_salesINT,
PRIMARY KEY(emp_id, client_id),
FOREIGN KEY(emp_id) REFERENCES
employee(emp_id) ONDELETECASCADE,
FOREIGN KEY(client_id)
REFERENCESclient(client_id) ONDELETECASCADE
);
CREATETABLEbranch_supplier(
branch_idINT,
supplier_nameVARCHAR(40),
supply_typeVARCHAR(40),