SlidePub
Home
Categories
Login
Register
Home
Science
Sql views, stored procedure, functions
Sql views, stored procedure, functions
omvikram
238 views
11 slides
Mar 04, 2020
Slide
1
of 11
Previous
Next
1
2
3
4
5
6
7
8
9
10
11
About This Presentation
This is a KT slide to explain SQL Views, Stored Procedure & Custom Functions (MySQL)
Size:
486.78 KB
Language:
en
Added:
Mar 04, 2020
Slides:
11 pages
Slide Content
Slide 1
SQL - Views, SP, Fx
5/03/2020
-
-by Om Vikram Thapa
Slide 2
Views
In DB, 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. The fields in a view are fields from
one or more real tables in the database.
Slide 3
CREATE
& CALL
CREATE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;
SELECT * FROM [view_name];
Slide 4
SAMPLE
DEMO
Slide 5
STORED
PROCEDURE
A stored procedure is a prepared SQL code that
you can save, so the code can be reused over
and over again.
You can also pass parameters to a stored
procedure, so that the stored procedure can act
based on the parameter value(s) that is passed.
Slide 6
CREATE
& CALL
CREATE PROCEDURE procedure_name
BEGIN
sql_statement
END;
EXEC procedure_name;
OR
CALL procedure_name;
Slide 7
SAMPLE
DEMO
Slide 8
FUNCTIONS
SQL Functions are a way to extend MySQL with a new
function that works like a native (built-in) function such
as NOW() or CONCAT()
Functions will have the params with datatype and
always return a value with return datatype too. These
are also called as UDF (User Defined Functions)
Slide 9
CREATE
& CALL
CREATE FUNCTION
function_name(param param_data_type)
RETURNS data_type
BEGIN
function_statement
END;
SELECT function_name([column_name]) FROM
[table_name];
Slide 10
SAMPLE
DEMO
Slide 11
TAKEAWAY
1)VIEWS
2)STORED FUNCTIONS
3)FUNCTIONS
Tags
sql
views
stored procedure
functions
mysql
database
computer science
basics
fundamentals
Categories
Science
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
238
Slides
11
Age
2101 days
Related Slideshows
23
Earthquakes_Type of Faults_Science G8.pptx
OctabellFabila1
31 views
15
Quiz #1 Science 10 in the first quarter for jhs
HendrixAntonniAmante
32 views
9
Astronomy history from long ago till doday
ssuserbd9abe
30 views
9
Great history of astronomy from long ago till today
ssuserbd9abe
28 views
20
EARTHQUAKE-DRILL.powerpoint.............
chalobrido8
31 views
9
History of astronomy from old times to the present times
ssuserbd9abe
31 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-11)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better