You are on page 1of 11

SQL DATABASE

AGENDA
• Schema.
• Views.
• ​Stored procedure.
• Trigger.

SCHEMA :

A database schema is considered the “blueprint” of a database which


describes how the data may relate to other tables or other data models.

The schema does not actually contain data.


EXAMPLE :
VIEWS :

A database view is a subset of a database and is based on a query that


runs on one or more database tables.

Database views are saved in the database as named queries and can be
used to save frequently used, complex queries.
EXAMPLE :
STORED PROCEDURE :
• A stored procedure is a prepared SQL
code that you can save, so the code can
be reused over and over again.

• So if you have an SQL query that you write


over and over again, save it as a stored
procedure, and then just call it to execute it.
EXAMPLE :
TRIGGER :
• A trigger is a special type of stored procedure that
automatically runs when an event occurs in the database
server.
• DML triggers run when a user tries to modify data through a
data manipulation language (DML) event.
• DML events are INSERT, UPDATE, or DELETE statements
on a table or view.
EXAMPLE :

You might also like