This document discusses PostgreSQL concepts like creating tables, primary keys, foreign keys, unique constraints, and default values. It also covers CRUD operations for inserting, reading, updating, deleting and truncating table data. Additional topics include sorting result sets, using aliases, limiting results, and offsetting result rows. The document is part of a multipart tutorial series on learning PostgreSQL quickly.
BITS: Introduction to relational databases and MySQL - Schema designBITS
BITS training: Introduction to relational databases and MySQL - Module 3: Schema design.
See http://www.bits.vib.be/index.php?option=com_content&view=article&id=17204047:green-basics-of-databases&catid=81:training-pages&Itemid=190
BITS: Introduction to relational databases and MySQL - Schema designBITS
BITS training: Introduction to relational databases and MySQL - Module 3: Schema design.
See http://www.bits.vib.be/index.php?option=com_content&view=article&id=17204047:green-basics-of-databases&catid=81:training-pages&Itemid=190
BITS: Introduction to relational databases and MySQL - SQLBITS
BITS: Introduction to relational databases and MySQL - Module2: Structured query language
See http://www.bits.vib.be/index.php?option=com_content&view=article&id=17204047:green-basics-of-databases&catid=81:training-pages&Itemid=190
Hello Everyone ! Hope everybody doing good in their work and with their busy life.
Today i am listing down some interesting ORA- errors which i found recently as a Beginner, My Good Luck i have solved those too. So, here i am Listing down the errors with solutions.
It happens when you work with oracle, you may face or might be facing.
So, guys ! Be fearless. Have a look over it. If you need any help, Please Please let me know..
Thankyou.
BITS: Introduction to relational databases and MySQL - SQLBITS
BITS: Introduction to relational databases and MySQL - Module2: Structured query language
See http://www.bits.vib.be/index.php?option=com_content&view=article&id=17204047:green-basics-of-databases&catid=81:training-pages&Itemid=190
Hello Everyone ! Hope everybody doing good in their work and with their busy life.
Today i am listing down some interesting ORA- errors which i found recently as a Beginner, My Good Luck i have solved those too. So, here i am Listing down the errors with solutions.
It happens when you work with oracle, you may face or might be facing.
So, guys ! Be fearless. Have a look over it. If you need any help, Please Please let me know..
Thankyou.
Tutorial terkait:
- Instalasi Postgre
- Menambah add-ons aplikasi Postgre
- Membuat database
- Administrasi database menggunakan phpPgAdmin
- Struktur logical postgre
- Tipe data
- Membuat tabel (Constraint dan Sequences)
- Sintaks SQL dasar
- Migrasi ke Postgre
- Problematika migrasi
Tutorial dilengkapi screenshoot agar memudahkan anda. Enjoy.. :)
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
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
This tutorial will give you a quick start to SQL including examples. It covers most of the topics required for a basic understanding of SQL and to get a feel of how it works.
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
How to leave the ORM at home and write SQLMariaDB plc
Looking to understand the basics of relational databases and the ubiquitous structured query language (SQL)? This is the session for you. Senior Software Engineer Assen Totin starts with an introduction to relational database theory and quickly moves to practical examples of SQL with simple, single-table selects, joins, and aggregates.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
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.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
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.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
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
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
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/
2. Creating Table
In psql maximum size of table is 32 terabytes.
In order to Create Table in psql we will follow the following syntax
◦ CREATE TABLE [table name] (
[Column name] [Column Data type],
…
);
◦ Example: CREATE TABLE sample_table (
id INTEGER,
fname VARCHAR(20),
lnameVARCHAR(25)
);
◦ Now if we write d sample_table we will see the table details:
RAPID POSTGRESQL LEARNING. 2
3. PRIMARY KEY CONSTRAINT
A primary key constraint is simply a combination of an UNIQUE constraint and a NOT NULL
constraint.
◦ How to define:
◦ First way
◦ CREATE TABLE test(
t1 INTEGER, t2 INTEGER, PRIMARY KEY (t1)
);
◦ Second way
◦ CREATE TABLE test(
t1 INTEGER PRIMARY KEY, t2 INTEGER
);
RAPID POSTGRESQL LEARNING. 3
4. FOREIGN KEY
A foreign key is a column or a group of columns that points to the primary key or another table.
◦ HOW TO DEFINE:
CREATE TABLE referenceTable(
id INTEGER PRIMARY KEY,
name VARCHAR(10)
);
CREATE TABLE testable(
id INTEGER PRIMARY KEY,
ref_id INTEGER REFERENCES referenceTable(id)
);
If we have a table with two or more foreign keys it would be something like bellow:
◦ CREATE TABLE referenceTable( id INTEGER, id1 INTEGER , PRIMARY KEY(id,id1));
◦ CREATE TABLE testable(id integer PRIMARY KEY, ref_id INTEGER, ref_id1 INTEGER, FOREIGN KEY(ref_id,red_id1) REFERENCES
referenceTable(id,id1));
RAPID POSTGRESQL LEARNING. 4
5. Check Constraint
We can use CHECK constraint when we need to check some values.
◦ HOW TO DEFINE CHECK CONSTRAINT
CREATE TABLE item(
id INTEGER PRIMARY KEY,
name VARCHAR(15),
price NUMERIC CHECK(price>0)
);
RAPID POSTGRESQL LEARNING. 5
6. NOT NULL Constraint
NOT NULL constraint is used to force a column that should not accept null value.
◦ HOW TO DEFINE:
◦ CREATE TABLE test(
M1 INTEGER NOT NULL,
M2 INTEGER CHECK (M2 IS NOT NULL)
);
RAPID POSTGRESQL LEARNING. 6
7. UNIQUE Constraint
If we need to have a column with unique values we have to use UNIQUE Constraint.
◦ How to Define
◦ CREATE TABLE test(
id INTEGER PRIMARY KEY,
email VARCHAR(52) UNIQUE,
nationalCode INTEGER(10),
CONSTRAINT national_code_unq_const UNIQUE(nationalCode)
);
◦ Above example uses 2 ways of defining UNIQUE Constraint
◦ Pay attention to the red color and blue color and you can find out which type of difference those have with each other.
RAPID POSTGRESQL LEARNING. 7
8. DEFAULT VALUES
We can specify a column to holds a default value if it had not a value while insert operation.
◦ How to define:
◦ CREATE TABLE test(
id INTEGER PRIMARY KEY,
test1 CHAR(5) DEFAULT ‘MASUD’,
test2 TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
◦ In above example we indicated that the default value of test1 column is <masud> and the default value
of test2 which it’s data type is TIMESTAMP would be CURRENT_TIMESTAMP
◦ Note that CURRENT_TIMESTAMP is a predefined constant in postgresql that shows current time stamp
RAPID POSTGRESQL LEARNING. 8
9. CASCADE
Have you ever tried to drop a table that has a dependency to another table?
You may checked that, but if not, I’ll tell you what would happen. If you do that you will face an
error. That error informs us that you are trying to drop a table that has a dependency on another
table.
So what is the solution?
◦ Solution would be CASCADE
◦ If we use CASCADE keyword after a command, it avoid dependencies and run the command on related
and depended tables or columns.
◦ How to use:
◦ DROP TABLE [table_name] CASCADE;
◦ Example: DROP TABLE testable CASCADE;
RAPID POSTGRESQL LEARNING. 9
10. CRUD
Crud stands for Create, read, update and delete.
In continue we will see how we can crud with Postgresql.
RAPID POSTGRESQL LEARNING. 10
11. INSERT
We can insert into table columns with the following syntax:
◦ INSERT INTO [TABLE NAME] ([COLUMNS])
VALUES ([values]);
◦ For instance we have the following table:
◦ CREATE TABLE ttst(
id SERIAL NOT NULL PRIMARY KEY
fname VARCHAR(10),
lname VARCHAR(30)
);
◦ INSERT INTO ttst (fname,lname) VALUES(‘Ali’,’MasudianPour’);
◦ INSERT INTO ttst (fname,lname) VALUES(‘Reza’,’Nejati’);
◦ INSERT INTO ttst (fname,lname) VALUES(‘Reza’,’Asi’);
◦ Now if we try to: SELECT * FROM ttst; The result would like the image:
RAPID POSTGRESQL LEARNING. 11
12. READ
In order to see table entries we use SELECT keyword, look at the example
◦ SELECT * FROM [TABLE NAME] ;
◦ This means that select all entries of table that we mentioned its name into square brackets.
◦ SELECT *COLUMN NAME+, *COLUMN NAME+, … FROM *TABLE NAME+
◦ This means that we can indicate which column we want to check and see related values.
◦ Example:
◦ SELECT id, fname FROM ttst;
RAPID POSTGRESQL LEARNING. 12
13. UPDATE
We can update columns with the following syntax:
◦ UPDATE [TABLE NAME] SET [COLUMN NAME] = [NEW VALUE]
◦ For example:
◦ UPDATE ttst SET fname=‘Masud’ WHERE id=5;
◦ After above command the select result would be similar to image
RAPID POSTGRESQL LEARNING. 13
14. DELETE
On order to delete a row we use DELETE Keyword.
◦ DELETE FROM [TABLE NAME] WHERE [CONDITION]
◦ For instance:
◦ DELETE FROM ttst WHERE id=6;
◦ As we talked about later, If we had some dependencies we use CASCADE keyword.
◦ For instance
◦ DELETE FROM ttst WHERE id=6 CASCADE;
RAPID POSTGRESQL LEARNING. 14
15. TRUNCATE
In order to empty all rows in a table we use TRUNCATE KEYWORD
◦ TRUNCATE TABLE [Table Name];
◦ For example:
◦ TRUNCATE TABLE ttst();
RAPID POSTGRESQL LEARNING. 15
16. Eliminate Duplications
In order to eliminate duplicate rows we use DISTINCT keyword.
◦ DISTINCT
◦ We can use DISTINCT keyword to eliminate duplications
◦ SELECT DISTINCT [*/COLUMN NAME] FROM [TABLE NAME];
◦ Example:
◦ SELECT DISTINCT * FROM ttst();
RAPID POSTGRESQL LEARNING. 16
17. Portion of a row
We can select data more accurate with writing conditions in WHERE clause
◦ For instance:
◦ SELECT * FROM ttst WHERE id=6
◦ SELECT * FROM ttst WHERE id>=10
◦ SELECT * FROM ttst WHERE fname=‘Ali’
◦ AND / OR
◦ SELECT * FROM ttst WHERE fname=‘Ali’ AND lname=‘MasudianPour’
◦ SELECT * FROM ttst WHERE fname =‘Reza’ OR flane=‘Ali’
RAPID POSTGRESQL LEARNING. 17
18. SORTING
We can sort the query result by using ORDER BY
◦ Take a look at below example
◦ SELECT * FROM ttst ORDER BY fname
◦ The result will select all values and sort them by fname and finally shows the output.
◦ ORDER BY has some switches
◦ DESC
◦ ORDER BY [column name] DESC
◦ Descending sort
◦ ASC
◦ ORDER BY [column name] ASC
◦ Ascending Sort
◦ NULLS FIRST
◦ ORDER BY [column name] DESC NULLS FIRST
◦ NULLS LAST
◦ ORDER BY [column name] DESC NULLS LAST
RAPID POSTGRESQL LEARNING. 18
19. ALIAS
Optionally, aliases can be declared for a column
◦ Example:
◦ WE USE AS KEYWORD TO USE ALIAS
◦ SELECT * FROM ttst AS e;
◦ Selects everything from ttst table and result will be known as e Alias
◦ SELECT fname fn, lname ln FROM ttst ORDER BY fn
◦ This example selects fname as fn and lname as ln and as you can see we used alias in ORDER BY
RAPID POSTGRESQL LEARNING. 19
20. LIMIT
Take a look at the below example
◦ SELECT * FROM ttst LIMIT 2
◦ The output will be limited to only 2 rows
◦ SELECT * FROM ttst LIMIT 10
◦ The output will be limited to only 10 rows
RAPID POSTGRESQL LEARNING. 20
21. OFFSET
AS we can limit our result with LIMIT clause, we can also set a range with OFFSET clause
◦ SELECT * FROM ttst OFFSET 4
◦ Above example selects all rows from ttst table and shows result with 4 offset. To be more clear it will avoid showing 4 first rows.
◦ SELECT * FROM ttst LIMIT 3 OFFSET 4
◦ Just like the previous example and following LIMIT
RAPID POSTGRESQL LEARNING. 21
22. END OF PART 2
End of Part 2
◦ In part 3 we will discuss about:
◦ COMBINING QUERIES with UNIOPN, INTERSECT and …
◦ Aggregation Functions
◦ GROUP BY and HAVING
◦ JOINS
◦ SUBQUERY EXPRESSIONS
◦ And …
RAPID POSTGRESQL LEARNING. 22