SQL is a standard language used to access and manage relational database systems. It was originally developed in the 1970s at IBM for use in database management systems. Some popular database systems that support SQL include MySQL, PostgreSQL, Oracle, SQLite, and Microsoft SQL Server. SQL allows users to define and manipulate the structure and data of databases through commands like SELECT, INSERT, UPDATE, DELETE, and more.
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...John Andrews
SlideShare Description for "Chatty Kathy - UNC Bootcamp Final Project Presentation"
Title: Chatty Kathy: Enhancing Physical Activity Among Older Adults
Description:
Discover how Chatty Kathy, an innovative project developed at the UNC Bootcamp, aims to tackle the challenge of low physical activity among older adults. Our AI-driven solution uses peer interaction to boost and sustain exercise levels, significantly improving health outcomes. This presentation covers our problem statement, the rationale behind Chatty Kathy, synthetic data and persona creation, model performance metrics, a visual demonstration of the project, and potential future developments. Join us for an insightful Q&A session to explore the potential of this groundbreaking project.
Project Team: Jay Requarth, Jana Avery, John Andrews, Dr. Dick Davis II, Nee Buntoum, Nam Yeongjin & Mat Nicholas
Show drafts
volume_up
Empowering the Data Analytics Ecosystem: A Laser Focus on Value
The data analytics ecosystem thrives when every component functions at its peak, unlocking the true potential of data. Here's a laser focus on key areas for an empowered ecosystem:
1. Democratize Access, Not Data:
Granular Access Controls: Provide users with self-service tools tailored to their specific needs, preventing data overload and misuse.
Data Catalogs: Implement robust data catalogs for easy discovery and understanding of available data sources.
2. Foster Collaboration with Clear Roles:
Data Mesh Architecture: Break down data silos by creating a distributed data ownership model with clear ownership and responsibilities.
Collaborative Workspaces: Utilize interactive platforms where data scientists, analysts, and domain experts can work seamlessly together.
3. Leverage Advanced Analytics Strategically:
AI-powered Automation: Automate repetitive tasks like data cleaning and feature engineering, freeing up data talent for higher-level analysis.
Right-Tool Selection: Strategically choose the most effective advanced analytics techniques (e.g., AI, ML) based on specific business problems.
4. Prioritize Data Quality with Automation:
Automated Data Validation: Implement automated data quality checks to identify and rectify errors at the source, minimizing downstream issues.
Data Lineage Tracking: Track the flow of data throughout the ecosystem, ensuring transparency and facilitating root cause analysis for errors.
5. Cultivate a Data-Driven Mindset:
Metrics-Driven Performance Management: Align KPIs and performance metrics with data-driven insights to ensure actionable decision making.
Data Storytelling Workshops: Equip stakeholders with the skills to translate complex data findings into compelling narratives that drive action.
Benefits of a Precise Ecosystem:
Sharpened Focus: Precise access and clear roles ensure everyone works with the most relevant data, maximizing efficiency.
Actionable Insights: Strategic analytics and automated quality checks lead to more reliable and actionable data insights.
Continuous Improvement: Data-driven performance management fosters a culture of learning and continuous improvement.
Sustainable Growth: Empowered by data, organizations can make informed decisions to drive sustainable growth and innovation.
By focusing on these precise actions, organizations can create an empowered data analytics ecosystem that delivers real value by driving data-driven decisions and maximizing the return on their data investment.
As Europe's leading economic powerhouse and the fourth-largest hashtag#economy globally, Germany stands at the forefront of innovation and industrial might. Renowned for its precision engineering and high-tech sectors, Germany's economic structure is heavily supported by a robust service industry, accounting for approximately 68% of its GDP. This economic clout and strategic geopolitical stance position Germany as a focal point in the global cyber threat landscape.
In the face of escalating global tensions, particularly those emanating from geopolitical disputes with nations like hashtag#Russia and hashtag#China, hashtag#Germany has witnessed a significant uptick in targeted cyber operations. Our analysis indicates a marked increase in hashtag#cyberattack sophistication aimed at critical infrastructure and key industrial sectors. These attacks range from ransomware campaigns to hashtag#AdvancedPersistentThreats (hashtag#APTs), threatening national security and business integrity.
🔑 Key findings include:
🔍 Increased frequency and complexity of cyber threats.
🔍 Escalation of state-sponsored and criminally motivated cyber operations.
🔍 Active dark web exchanges of malicious tools and tactics.
Our comprehensive report delves into these challenges, using a blend of open-source and proprietary data collection techniques. By monitoring activity on critical networks and analyzing attack patterns, our team provides a detailed overview of the threats facing German entities.
This report aims to equip stakeholders across public and private sectors with the knowledge to enhance their defensive strategies, reduce exposure to cyber risks, and reinforce Germany's resilience against cyber threats.
Adjusting primitives for graph : SHORT REPORT / NOTESSubhajit Sahu
Graph algorithms, like PageRank Compressed Sparse Row (CSR) is an adjacency-list based graph representation that is
Multiply with different modes (map)
1. Performance of sequential execution based vs OpenMP based vector multiply.
2. Comparing various launch configs for CUDA based vector multiply.
Sum with different storage types (reduce)
1. Performance of vector element sum using float vs bfloat16 as the storage type.
Sum with different modes (reduce)
1. Performance of sequential execution based vs OpenMP based vector element sum.
2. Performance of memcpy vs in-place based CUDA based vector element sum.
3. Comparing various launch configs for CUDA based vector element sum (memcpy).
4. Comparing various launch configs for CUDA based vector element sum (in-place).
Sum with in-place strategies of CUDA mode (reduce)
1. Comparing various launch configs for CUDA based vector element sum (in-place).
Explore our comprehensive data analysis project presentation on predicting product ad campaign performance. Learn how data-driven insights can optimize your marketing strategies and enhance campaign effectiveness. Perfect for professionals and students looking to understand the power of data analysis in advertising. for more details visit: https://bostoninstituteofanalytics.org/data-science-and-artificial-intelligence/
Techniques to optimize the pagerank algorithm usually fall in two categories. One is to try reducing the work per iteration, and the other is to try reducing the number of iterations. These goals are often at odds with one another. Skipping computation on vertices which have already converged has the potential to save iteration time. Skipping in-identical vertices, with the same in-links, helps reduce duplicate computations and thus could help reduce iteration time. Road networks often have chains which can be short-circuited before pagerank computation to improve performance. Final ranks of chain nodes can be easily calculated. This could reduce both the iteration time, and the number of iterations. If a graph has no dangling nodes, pagerank of each strongly connected component can be computed in topological order. This could help reduce the iteration time, no. of iterations, and also enable multi-iteration concurrency in pagerank computation. The combination of all of the above methods is the STICD algorithm. [sticd] For dynamic graphs, unchanged components whose ranks are unaffected can be skipped altogether.
Opendatabay - Open Data Marketplace.pptxOpendatabay
Opendatabay.com unlocks the power of data for everyone. Open Data Marketplace fosters a collaborative hub for data enthusiasts to explore, share, and contribute to a vast collection of datasets.
First ever open hub for data enthusiasts to collaborate and innovate. A platform to explore, share, and contribute to a vast collection of datasets. Through robust quality control and innovative technologies like blockchain verification, opendatabay ensures the authenticity and reliability of datasets, empowering users to make data-driven decisions with confidence. Leverage cutting-edge AI technologies to enhance the data exploration, analysis, and discovery experience.
From intelligent search and recommendations to automated data productisation and quotation, Opendatabay AI-driven features streamline the data workflow. Finding the data you need shouldn't be a complex. Opendatabay simplifies the data acquisition process with an intuitive interface and robust search tools. Effortlessly explore, discover, and access the data you need, allowing you to focus on extracting valuable insights. Opendatabay breaks new ground with a dedicated, AI-generated, synthetic datasets.
Leverage these privacy-preserving datasets for training and testing AI models without compromising sensitive information. Opendatabay prioritizes transparency by providing detailed metadata, provenance information, and usage guidelines for each dataset, ensuring users have a comprehensive understanding of the data they're working with. By leveraging a powerful combination of distributed ledger technology and rigorous third-party audits Opendatabay ensures the authenticity and reliability of every dataset. Security is at the core of Opendatabay. Marketplace implements stringent security measures, including encryption, access controls, and regular vulnerability assessments, to safeguard your data and protect your privacy.
3. SQL
SQL is an acronym of Structured Query Language. It is a standard language
developed and used for accessing and modifying relational databases.
The SQL language was originally developed at the IBM research laboratory in
San José, in connection with a project developing a prototype for a relational
database management system called System R in the early 70s.
SQL is being used by many database management systems. Some of them are:
MySQL
PostgreSQL
Oracle
SQLite
Microsoft SQL Server
4. Interactive Language- This language can be used for communicating with the
databases and receive answers to the complex questions in seconds.
Multiple data views- The users can make different views of database structure and
databases for the different users.
Portability- SQL can be used in the program in PCs, servers, laptops, and even
some of the mobile phones and even on different dbms softwares
No coding needed- It is very easy to manage the database systems without any
need to write the substantial amount of code by using the standard SQL.
Well defined standards- Long established are used by the SQL databases that is
being used by ISO and ANSI. There are no standards adhered by the non-SQL
databases.
ADVANTAGES OF USING SQL
5. MySQL is currently the most popular open source database software. It
is the multi-user, multithreaded database management system. MySQL
is especially popular on the web. It is one of the parts of the very popular
LAMP platform. Linux, Apache, MySQL and PHP or WIMP platform
Windows,Apache,MySQL and PHP. MySQL AB was founded by Michael
Widenius (Monty), David Axmark and Allan Larsson in Sweden in year
1995.
6. Open Source & Free of Cost:
It is Open Source and available at free of cost.
Portability:
Small enough in size to instal and run it on any types of Hardware and OS like
Linux,MS Windows or Mac etc.
Security :
Its Databases are secured & protected with password.
Connectivity
Various APIs are developed to connect it with many programming languages.
Query Language
It supports SQL (Structured Query Language) for handling database.
MYSQL FEATURES
7. DDL (Data Definition Language)
To create database and table structure-commands like CREATE , ALTER ,
DROP etc.
DML (Data Manipulation Language)
Record/rows related operations.commands like SELECT...., INSERT...,
DELETE..., UPDATE.... etc.
DCL (Data Control Language)
used to manipulate permissions or access rights to the tables. commands like
GRANT , REVOKE etc.
Transactional Control Language
Used to control the transactions.commands like COMMIT, ROLLBACK,
SAVEPOINT etc.
TYPES OF SQL COMMANDS
8. Numeric Data Types:
INTEGER or INT – up to 11 digit number without decimal.
SMALLINT – up to 5 digit number without decimal.
FLOAT (M,D) or DECIMAL(M,D) or NUMERIC(M,D)
Stores Real numbers upto M digit length (including .) with D
decimal places.
e.g. Float (10,2) can store 1234567.89
Date & Time Data Types:
DATE - Stores date in YYYY-MM-DD format.
TIME - Stores time in HH:MM:SS format.
String or Text Data Type:
CHAR(Size) - A fixed length string up to 255 characters. (default is 1)
VARCHAR(Size) - A variable length string up to 255 characters.
Char, Varchar, Date and Time values should be enclosed with single (‘ ‘) or double ( “”) quotes inMySQL. varchar
is used in MySQL and varchar2 is used in Oracle.
DATA TYPE IN MYSQL
9. Getting listings of available databases
mysql> SHOW DATABASES;
Creating a database
mysql> CREATE database myschool;
Deleting a database
mysql> DROP database <databasename>;
To remove table
mysql> drop table <tablename>;
After database creation we can open the database using USE command
mysql> USE myschool;
To show list of tables in opened database
mysql> SHOW TABLES;
Creating a table in the database is achieved with CREATE table statement.
mysql> CREATE TABLE student (lastname varchar(15),firstname varchar(15), city
varchar(20), class char(2));
The command DESCRIBE is used to view the structure of a table.
mysql> DESCRIBE student;
DATABASE COMMANDS IN MYSQL
10. To insert new rows into an existing table use the INSERT command:
mysql>INSERT INTO student values(‘dwivedi’,’freya’,’Udaipur’,’4’);
We can insert record with specific column only
mysql>INSERT INTO student (lastname, firstname, city) values (‘dwivedi’, ’Mohak’,
’Udaipur’,);
With the SELECT command we can retrieve previously inserted rows:
A general form of SELECT is:
SELECT what to select(field name) FROM table(s)
WHERE condition that the data must satisfy;
• Comparison operators are: < ; <= ; = ; != or <> ; >= ; >
• Logical operators are: AND ; OR ; NOT
•Comparison operator for special value NULL: IS
mysql> SELECT * FROM student;
11. Selecting rows by using the WHERE clause in the SELECT command
mysql> SELECT * FROM student WHERE class=“4";
Selecting specific columns(Projection) by listing their names
mysql> SELECT first_name, class FROM student;
Selecting rows with null values in specific column
mysql> SELECT * FROM Student WHERE City IS NULL;
BETWEEN- to access data in specified range
mysql> SELECT * FROM Student WHERE class between 4 and 6;
IN- operator allows us to easily test if the expression in the list of values.
mysql> SELECT * FROM Student WHERE class in (4,5,6);
12. Pattern Matching – LIKE Operator
A string pattern can be used in SQL using the following wild card
% Represents a substring in any length
_ Represents a single character
Example:
‘A%’represents any string starting with ‘A’character.
‘_ _A’represents any 3 character string ending with ‘A’.
‘_B%’represents any string having second character ‘B’
‘_ _ _’ represents any 3 letter string.
A pattern is case sensitive and can be used with LIKE operator.
mysql> SELECT * FROM Student WHERE Name LIKE ‘A%’;
mysql> SELECT * FROM Student WHERE Name LIKE ’%Singh%’;
mysql> SELECT Name, City FROM Student WHERE Class>=8 AND Name LIKE
‘%Kumar%’;
13. To get data in ascending order.
mysql> SELECT * FROM Student ORDER BY class;
To get descending order use DESC key word.
mysql> SELECT * FROM Student ORDER BY class DESC;
To display data after removal of duplicate values from specific column.
mysql> select distinct class from student;
Deleting selected rows from a table using the DELETE command
mysql> DELETE FROM student WHERE firstname=“amar";
To modify or update entries in the table use the UPDATE command
mysql> UPDATE student SET class=“V" WHERE firstname=“freya";
14. Creating Table with Constraints
The following constraints are commonly used in SQL:
NOT NULL -It Ensures that a column cannot have a NULL value
UNIQUE - It Ensures that all values in a column are different
PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely
identifies each row in a table
FOREIGN KEY - It Uniquely identifies a row/record in another table
CHECK - It Ensures that all values in a column satisfies a specific condition
DEFAULT - It Sets a default value for a column when no value is specified
INDEX - It is Used to create and retrieve data from the database very quickly
15. Creating Table with Constraints
mysql> CREATE TABLE Persons (
ID int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
City varchar(255) DEFAULT ‘Jaipur',
CONSTRAINT CHK_Person CHECK (Age>=18) );
mysql> CREATE TABLE Orders (
OrderID int NOT NULL,
OrderNumber int NOT NULL,
PersonID int,
PRIMARY KEY (OrderID),
FOREIGN KEY (PersonID) REFERENCES Persons(ID) );
16. Altering Table
The SQL ALTER TABLE command is used to add, delete or modify columns in an
existing table. You should also use the ALTER TABLE command to add and drop various
constraints on an existing table.
Syntax
The basic syntax of an ALTER TABLE command to add a New Column in an existing
table is as follows.
ALTER TABLE table_name ADD column_name datatype;
The basic syntax of an ALTER TABLE command to DROP COLUMN in an existing table
is as follows.
ALTER TABLE table_name DROP COLUMN column_name;
The basic syntax of an ALTER TABLE command to change the DATA TYPE of a column
in a table is as follows.
ALTER TABLE table_name MODIFY COLUMN column_name datatype;
17. Altering Table
The basic syntax of an ALTER TABLE command to add a NOT NULL constraint to
a column in a table is as follows.
ALTER TABLE table_name MODIFY column_name datatype NOT NULL;
The basic syntax of ALTER TABLE to ADD UNIQUE CONSTRAINT to a
table is as follows.
ALTER TABLE table_name
ADD CONSTRAINT MyUniqueConstraint UNIQUE(column1, column2...);
The basic syntax of an ALTER TABLE command to ADD CHECK CONSTRAINT to
a table is as follows.
ALTER TABLE table_name
ADD CONSTRAINT MyUniqueConstraint CHECK (CONDITION);
18. Altering Table
The basic syntax of an ALTER TABLE command to ADD PRIMARY KEY
constraint to a table is as follows.
ALTER TABLE table_name
ADD CONSTRAINT MyPrimaryKey PRIMARY KEY (column1, column2...);
The basic syntax of an ALTER TABLE command to DROP CONSTRAINT from a
table is as follows.
ALTER TABLE table_name
DROP CONSTRAINT MyUniqueConstraint;
19. Altering Table
ALTER TABLE table_name
DROP INDEX MyUniqueConstraint;
The basic syntax of an ALTER TABLE command to DROP PRIMARY KEY
constraint from a table is as follows.
ALTER TABLE table_name
DROP CONSTRAINT MyPrimaryKey;
If we are using MySQL, the code is asfollows −
ALTER TABLE table_name
DROP PRIMARY KEY;
20. MySQL Order By clause is used to sort the table data in either Ascending order or
Descending order. By default, data is not inserted into Tables in any order unless
we have an index.
So, If we want to retrieve the data in any particular order, we have to sort it by
using MySQL Order By statement.
Syntax:-
SELECT Column_Names
FROM Table_Name
ORDER BY {Column1}[ASC | DESC] {Column2}[ASC | DESC];
21. MySQL Order by – e.g.
Suppose we are having student table with following data.
Now we write the query – select * from student order by class;
Query result will be in ascending order of class.If we not specify asc/desc in
query then ascending clause is applied by default
22. MySQL Order by– e.g.
Suppose we are having student table with following data.
Now we write the query – select * from student order by class desc;
Query result will be in descending order of class
23. MySQL Order by – e.g.
Suppose we are having student table with following data.
Now we write query–select * from student order by class asc, marks asc;
Query result will be ascending order of class and if same class exists then
ordering will done on marks column(ascending order)
24. MySQL Order by– e.g.
Suppose we are having student table with following data.
Now we write query–select * from student order by class asc, marks desc;
Query result will be ascending order of class and if same class exists then
ordering will done on marks column(descending order)
25. An aggregate function performs a calculation on multiple values and returns a
single value. For example, you can use the AVG() aggregate function that takes
multiple numbers and returns the average value of the numbers. Following is
the list of aggregate functions supported by mysql.
Name Purpose
SUM() Returns the sum of given column.
MIN() Returns the minimum value in the given column.
MAX() Returns the maximum value in the given column.
AVG() Returns the Average value of the given column.
COUNT() Returns the total number of values/ records as per given
column.
26. Aggregate Functions & NULL
Consider a table Emp having following records as-
Null values are excluded while (avg) aggregate function is used
SQL Queries
mysql> Select Sum(Sal) from EMP;
mysql> Select Min(Sal) from EMP;
mysql> Select Max(Sal) from EMP;
mysql>Select Count(Sal) from EMP;
mysql>Select Avg(Sal) from EMP;
mysql>Select Count(*) from EMP;
Emp
Code Name Sal
E1 Mohak NULL
E2 Anuj 4500
E3 Vijay NULL
E4 Vishal 3500
E5 Anil 4000 Result of query
12000
3500
4500
3
4000
5
27. The GROUP BY clause groups a set of rows/records into a set of summary
rows/records by values of columns or expressions. It returns one row for each
group.
We often use the GROUP BY clause with aggregate functions such as SUM,
AVG, MAX, MIN, and COUNT. The aggregate function that appears in the
SELECT clause provides information about each group.
The GROUP BY clause is an optional clause of the SELECT statement.
Syntax –
SELECT c1, c2,..., cn, aggregate_function(ci)
FROM table WHERE where_conditions GROUP BY c1 , c2,...,cn;
Here c1,c2,ci,cn are column name
28. MySQL group by – e.g.
Suppose we are having student table with following data.
Now we write query–select class from student group by class;
Query result will be unique occurrences of class values, just similar to use
distinct clause like (select distinct class from student).
29. MySQL GROUP BY with aggregate functions
The aggregate functions allow us to perform the calculation of a set of rows and
return a single value. The GROUP BY clause is often used with an aggregate
function to perform calculation and return a single value for each subgroup.
For example, if we want to know the number of student in each class, you can use
the COUNT function with the GROUP BY clause as follows:Suppose we are
having student table with following data.
Now we write query–
select class,count(*) from
student group by class;
Query result will be unique occurrences of class
values along with counting of students(records) of
each class(sub group).
30. MySQL GROUP BY with aggregate functions
We are having student table with following data.
Now we write query–select class,avg(marks) from student group by class;
Query result will be unique occurrences of class values along with
average marks of each class(sub group).
31. MySQL GROUP BY with aggregate functions (with where and order by clause)
we are having student table with following data.
Now we write query–
select class, avg(marks) from student where class<10 group by class order by marks desc;
Query result will be unique occurrences of class values where
class<10 along with average marks of each class(sub group)
and descending order of marks.
32. The HAVING clause is used in the SELECT statement to specify filter conditions for a
group of rows or aggregates. The HAVING clause is often used with the GROUP BY
clause to filter groups based on a specified condition. To filter the groups returned by
GROUP BY clause, we use a HAVING clause.
WHERE is applied before GROUP BY
, HAVING is applied after (and can filter on
aggregates).
33. MySQL GROUP BY with aggregate functions & having clause
we are having student table with following data.
Now we write query–
select class,avg(marks) from student group by class having avg(marks)<90;
Query result will be unique occurrences of class values along with
average marks of each class(sub group) and each class having
average marks<90.
34. MySQL GROUP BY with aggregate functions & having clause
we are having student table with following data.
Now we write query–
select class,avg(marks) from student group by class having count(*)<3;
Query result will be unique occurrences of class values along
with average marks of each class(sub group) and each class
having less than 3 rows.
35. Cartesian product (X)/cross join
Cartesian Product is denoted by X symbol. Lets say we
have two relations R1 and R2 then the cartesian product
of these two relations (R1 X R2) would combine each
tuple of first relation R1 with the each tuple of second
relation R2.
36. Cartesian product (X) example
Table a and Table b as shown below
Mysql query –
Select * from a,b;
Select * from a cross join b;
Degree of cartesion product is 3(2 + 1) and cardinality is 4 (2 rows of a X 2 rows of b)
37. Join – Join is used to fetch data from two or more tables, which is
joined to appear as single set of data. It is used for combining column
from two or more tables by using values common to both tables.
Types of JOIN
Following are the types of JOIN that we can use in SQL:
• Inner
• Outer
• Left
• Right
38. EQUI JOIN (INNER JOIN)
Equi join is a special type of join in which we use only an equality operator.
Hence, when you make a query for join using equality operator then that join
query comes under Equi join.
39. mysql> SELECT * FROM UNIFORM U, COST C WHERE
U.UCode = C.UCode;
mysql> SELECT * FROM UNIFORM U JOIN COST C ON
U.Ucode=C.Ucode;
40. mysql> SELECT * FROM UNIFORM NATURAL JOIN COST;
It is clear from the output that the result of this query is same as that of queries
written in (a) and (b) except that the attribute Ucode appears only once.
41. Natural JOIN
Natural Join is a type of Inner join which is based on column having
same name and same datatype present in both the tables to be joined.