This document provides an overview of SQL (Structured Query Language) in 3 sentences or less:
SQL is a standard language for storing, manipulating and retrieving data in relational database systems. The document outlines various SQL commands, clauses, and functions for working with data types, tables, queries, procedures, indexes and more. Examples are provided to illustrate how to use SQL statements to define schemas, insert, update, select and manipulate data in relational database tables.
An tutorial for sql learners in very easy way. It contains all the sql commands like ddl, dml, etc. with suitable examples.
at the end there are 3 sets of question with their solution with explanation. each set contains 40+ questions.
A. Table Basic Data Types- Char, varchar/varchar2, long, number, Fixed Commands to create table Commands for table handling- Alter table, Drop table, Insert records B. Commands for record handling Update, Delete Select with operators like arithmetic, comparison, logical Query Expression operators Ordering the records with orderby Grouping the records C. SQL functions Date, Numeric, Character, conversion Group functions avg, max, min, sum, count Set operations- Union, Union all, intersect, minu
Standard SQL features where PostgreSQL beats its competitorsMarkus Winand
The SQL standard has more than 4300 pages and hundreds of optional features. The number of features offered by different products varies vastly. PostgreSQL implements a relativley large number of them.
In this session I present some standard SQL features that work in PostgreSQL, but not in other popular open-source databases. But when it comes to standard conformance, PostgreSQL doesn’t even need to fear the comparison to its commercial competitors: PostgreSQL also supports a few useful standard SQL features that don’t work in any of the three most popular commercial SQL databases.
An tutorial for sql learners in very easy way. It contains all the sql commands like ddl, dml, etc. with suitable examples.
at the end there are 3 sets of question with their solution with explanation. each set contains 40+ questions.
A. Table Basic Data Types- Char, varchar/varchar2, long, number, Fixed Commands to create table Commands for table handling- Alter table, Drop table, Insert records B. Commands for record handling Update, Delete Select with operators like arithmetic, comparison, logical Query Expression operators Ordering the records with orderby Grouping the records C. SQL functions Date, Numeric, Character, conversion Group functions avg, max, min, sum, count Set operations- Union, Union all, intersect, minu
Standard SQL features where PostgreSQL beats its competitorsMarkus Winand
The SQL standard has more than 4300 pages and hundreds of optional features. The number of features offered by different products varies vastly. PostgreSQL implements a relativley large number of them.
In this session I present some standard SQL features that work in PostgreSQL, but not in other popular open-source databases. But when it comes to standard conformance, PostgreSQL doesn’t even need to fear the comparison to its commercial competitors: PostgreSQL also supports a few useful standard SQL features that don’t work in any of the three most popular commercial SQL databases.
This slideshow aims to convey the basics of Oracle Database. This slideshow captures all the essential concepts and necessary visualizations to capture all the key concepts of Oracle RDBMS, along with providing all the essential steps to install it on your system, whether it be on Mac or Windows. Capturing all the concepts precisely and cogently, it also explains key concepts like joins in a diagrammatic fashion enabling viewers to visualize them for easier understanding and retention, along with providing them with the syntax to pick up writing simple queries.
Part 3 of the SQL Tuning workshop examines the different aspects of an execution plan, from cardinality estimates to parallel execution and explains what information you should be gleaming from the plan and how it affects the execution. It offers insight into what caused the Optimizer to make the decision it did as well as a set of corrective measures that can be used to improve each aspect of the plan.
This presentation features the fundamentals of SQL tunning like SQL Processing, Optimizer and Execution Plan, Accessing Tables, Performance Improvement Consideration Partition Technique. Presented by Alphalogic Inc : https://www.alphalogicinc.com/
What is the purpose of a PL-SQL cursor- Give an example-SolutionAns- 1.docxearleanp
What is the purpose of a PL/SQL cursor? Give an example.
Solution
Ans;
12) Yes. We can use INSERT, UPDATE or DELETE commands in PL/SQL procedures.
Because PL/SQL supports the SQL commands,functions,operators. Pl/SQL supports all data manipulation statements, transaction control statements
You can directly write INSERT,UPDATE,DELETE statements in PL/SQL programs without any special notation.
13) SELECT command in PL/SQL is used to retrieve data from one or more tables ,views or snapshots.
Syntax for SELECT
SELECT [hint] [DISTINCT] select list
INTO { variable1,variable,... |record_name}
FROM table_list
[WHERE conditions]
[GROUP BY group_by_list]
[HAVING search_conditions]
[ORDER BY order_list[ASC | DESC] ]
[FOR UPDATE for_update_options]
3) The PL/SQL command that activates a cursor is OPEN.
syntax is OPEN cursor_name;
4) The PL/SQL command that selects the next row in a cursor is FETCH..INTO
syntax is FETCH cursor_name INTO variable_name;
5) The PL/SQL command that deactivates a cursor is CLOSE.
syntax is CLOSE cursor_name;
.
Ground Breakers Romania: Explain the explain_planMaria Colgan
This session was delivered as part of the EMEA Ground Breakers tour in Romania, Oct. 2019. The execution plan for a SQL statement can often seem complicated and hard to understand. Determining if the execution plan you are looking at is the best plan you could get or attempting to improve a poorly performing execution plan can be a daunting task even for the most experienced DBA or developer. This session examines the different aspects of an execution plan, from selectivity to parallel execution and explains what information you should be gleaming from the plan and how it affects the execution. It offers insight into what caused the Optimizer to make the decision it did as well as a set of corrective measures that can be used to improve each aspect of the plan.
Running queries across multiple tables. This will involve the concept of joins—that is, how we join tables together.
Using joins to run queries over multiple tables, including:
Natural, inner, and cross joins
Straight joins
Left and right joins
Writing subqueries
Using SELECT statement options
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
3. SQL is a standard language for accessing and manipulating
databases.
SQL used for RDBMS(Relational Database Management
System)
The data in RDBMS is stored in database objects called tables.
A table is a collection of related data entries and it consists of
columns and rows.
All modern DBMS use SQL
1. MS SQL Server
2. MySQL
3. IBM DB2
4. Oracle
5. Microsoft Access etc.
3
5. 5
Data Definition
Language (DDL)
Data Manipulation
Language(DML)
Data Control
Language(DCL)
Transaction Control
Language(TCL)
Data Query
Language(DQL)
6. CREATE – use to create something
CREATE <Type> . . . ;
DROP – used to delete something
DROP <type> . . . ;
ALTER –used to change, rename, modify, alter
something.
ALTER <Type> <name> <OP> . . . ;
TURNCATE – Delete something permanently
TRUNCATE <Type> . . . ;
6
7. Insert - used to insert data into table
INSERT INTO <table> (<cols>)
VALUES (<cols_values>);
Delete – used to delete data from table
DELETE FROM <table> . . . ;
Update – used to data in table
UPDATE <table> SET <cols> = <value> . . . ;
7
8. Grant – Used to provide any user access
privileges or other privileges for the
database.
GRANT <permissions> TO <users> ;
Revoke - Used to take back permissions from
any user.
REVOKE <permissions> FROM <user> ;
8
9. Commit - used to permanently save any
transaction into the database.
COMMIT;
Savepoint - used to temporarily save a
transaction so that you can rollback to that point
whenever required.
SAVEPOINT <name>;
Rollback - used with SAVEPOINT command to
jump to a savepoint in an ongoing transaction.
ROLLBACK TO <name>;
9
10. SELECT – used to Give output of any query .
SELECT <cols_or_operation>
FROM <table_or_something_else> . . . ;
10
11. Where - it use to filtering of table before group
by statement.
SELECT <something>
FROM <some_table>
WHERE <condition>;
Having – it used to filtering of table after group
by statement.
SELECT <something>
FROM <some_table>
GROUP BY <cols>
HAVING <condition>;
11
12. Arithmetical operation -
+,-,/,%,*
Logical operations –
AND(&),OR(|),NOT
Relational Operations –
<,>,<=,>=,= or <=> ,<>
IN – exact checking
BETWEEN – inclusive range checking
LIKE – pattern checking
1. _ - used for one missing values
2. % - used for multiple missing values
12
13. Order by – used for shorting (default is asc)
SELECT <something>
FROM <some_table>
ORDER BY <col1> , <col2> desc, . . ;
Limit – used to select limited rows
SELECT <something>
FROM <some_table>
LIMIT <offset>,<row_count>;
IF – if condition
IF(<condition>,<if_true>,<if_false>)
13
14. CASE – same as switch
CASE (<var>)
WHEN <value> THEN <do>
WHEN <value> THEN <do>
. .
ELSE <do>
END
OR
CASE
WHEN <condition> THEN <do>
WHEN <condition> THEN <do>
. .
ELSE <do>
END
14
15. Group Functions
◦ SUM()
◦ MIN()
◦ MAX()
◦ AVG()
◦ COUNT() ,etc
Group By - used to make group of elements
SELECT <something>
FROM <some_table>
GROUP BY <col1>,<col2> ,..;
15
16. NOT NULL – used for avoid null values
UNIQUE – used to avoid same values
CHECK – used to check some condition
DEFAULT <value> - used to set default value
16
17. A primary key is column or set of columns that uniquely
identified each row in a table
A primary key must contain unique and not null values
A composite primary key can have multiple columns whose
combination must always be unique
To create primary key
CREATE TABLE <name>(
<col> PRIMARY KEY ,..);
OR
CREATE TABLE <name>(
<col>,..,PRIMARY KEY(<col_name>..) );
After table created
ALTER TABLE <table> ADD PRIMARY KEY(<cols>..);
To Drop primary key
ALTER TABLE DROP PRIMARY KEY;
17
18. Foreign key is used to maintain referential integrity between two
tables it points to the primary key of another table
Foreign key constrain denoted a parent child relationship . A
child can’t be exist and parent can’t delete if child is exists.
Foreign key can be set to NULL
To Create Foreign Key
ALTER TABLE <table> ADD FOREIGN KEY <col_name>
REFERENCES <p_table>(<p_col>) [on_delete_action]
[on_update_action] ;
To Delete Foreign Key
ALTER TABLE <table> DROP FOREIGN KEY;
18
19. Action Option Description
ON DELETE CASCADE If parent get delete,
the child also get
delete
SET NULL If parent get delete,
the child set to null
RESTRICT Delete is not possible
if child exists
ON UPDATE CASCADE If parent get updated,
the child also get
updated
SET NULL If parent get updated,
the child set to null
RESTRICT update is not possible
if child exists
19
20. Cross Join – it take all combinations of both table rows
SELECT *
FROM <table1> JOIN <table2> ;
OR
SELECT *
FROM <table1> CROSS JOIN <table2>;
OR
SELECT *
FROM <table1>,<table2>;
Natural Join – if both table have one same column then it
table reference that column join both tables and that same
columns comes ones in table.
SELECT *
FROM <table1> NATURAL JOIN <table2> ;
20
22. Simple Query – One SELECT in the Query.
Multiple Subqueries – it follows bottom to up
approach.
i.e.
SELECT *
FROM company
WHERE salary > (
SELECT AVG(salary)
FROM company
);
22
23. Correlated Subqueries – here for every row of
main query the subqueries is are execute.
i.e.
SELECT *
FROM employees e
WHERE salary > (
SELECT AVG(salary)
from employees
where dptid=e.dptid
)
23
24. Index are used by query to find data from
table quickly
If there are no index to help query then query
engine perform entire table scans
To Create index use
CREATE INDEX <idx_name> ON
<table_name>(<col_name>);
To Delete index
DROP INDEX <idx_name> ON <table_name>;
24
25. Clustered Index – Those indexes are change
the order of the table in sorted order, there is
only one clustered index in the table which is
primary key.
Secondary Index – all index created by user
are secondary indexes which stored in
separate storage area.
Note : When we make any column UNIQUE then
it create index for that column.
25
26. A stored procedures is a segment of declarative
SQL statements stored inside the database
catalog.
Stored procedures performance, reduce network
traffic, provide code reusability & Security.
Stored Procedure are create using
CREATE PROCEDURE <prs_name> (<paramenters>)
BEGIN
[variable declaration]
[perform some operations]
END
26
27. Variable can be type of IN,OUT,INOUT
Example: sql code to find prime number
DELIMITER $$
CREATE PROCEDURE is_prime(IN num int)
BEGIN
DECLARE c int;
DECLARE x int;
SET c = 2;
SET x = 0;
my_loop:WHILE num >= c*c DO
IF num%c = 0 THEN
SET x = 1;
LEAVE my_loop;
END IF;
SET c = c+1;
END WHILE my_loop;
IF x = 1 THEN
SELECT “ITS COMPOSITE NUMBER”;
ELSE
SELECT “ITS PRIME NUMBER”;
END IF;
END $$
27
28. A cursor allows to iterate set of rows returned
by a query and process accordingly
We can create cursor inside the procedure to
handle result of set returned by a query
MySQL cursors are read only and not
scrollable(mean one row at a time and one by
one step wise).
28
29. Steps to working with cursors
1) DECELARE <cursor_name>
FOR <Select_statement>;
2) OPEN <cursor_name>;
3) FETCH <cursor_name> into <cols>.. ;
4) CLOSE <cursor_name>;
29
30. Example of Cursor
30
delimiter $$
CREATE OR REPLACE PROCEDURE pro_agent()
BEGIN
DECLARE break int DEFAULT 0;
DECLARE name varchar(20);
DECLARE salary varchar(20);
DECLARE c1 CURSOR FOR SELECT AGENT_NAME , WORKING_AREA
FROM agents;
DECLARE CONTINUE handler FOR NOT FOUND SET break = 1;
OPEN c1;
my_loop:LOOP
FETCH c1 INTO name,salary;
IF break = 1 THEN
LEAVE my_loop;
END IF;
SELECT concat_ws(“ ”,name,salary);
END LOOP my_loop;
CLOSE c1;
END $$
31. In MySQL view are not only query able but
updatable which means that we can use insert,
update, or delete statement on views to change
the underlying table
Only simple views can be updated so it means
that view containing joins, group by, having,
order by, aggregate functions are not updatable.
“WITH CHECK OPTION” is used to maintain
consistency of views so this clauses prevents us
from updating or inserting rows which are not
visible through the view.
31
32. To Create view
CREATE VIEW <view_name> AS <select_statement>;
OR For with check option for insert or update
use
CREATE VIEW <view_name> AS
<select_with_where> WITH CHECK OPTION;
TO delete view
DROP VIEW <view_name>;
32
33. A Trigger is a set of SQL statements stored in the database
catalog which executed or fired when the some event
associated with table.
Trigger are special kind of stored procedure that are
executed automatically on firing of some event
We use “FOR EACH ROW” if there is bulk row operation in
Triggers
Triggers are created using
CREATE TRIGGER <trigger_name> <trigger_time> <trigger_event>
ON <table_name>
BEGIN
[process]
END
To delete Trigger
DROP TRIGGER <name>;
33
34. Trigger times are : AFTER & BEFORE
Trigger event are :
1. DELETE => OLD.key
2. INSERT => NEW.key
3. UPDATE => OLD.key & NEW.key
Example:
34
delimiter $hiva
CREATE OR REPLACE TRIGGER wit_logs_update AFTER UPDATE ON wit
FOR EACH ROW
BEGIN
INSERT INTO logs VALUES (concat_ws("","updated data is
name:",NEW.name,"from",OLD.name,"marks:",NEW.mark," FROM ",OLD.mark,sysdate()));
END $hiva