This document provides an overview of SQL (Structured Query Language). It discusses SQL functions including data manipulation language (DML) and data definition language (DDL). DML commands like SELECT, UPDATE, DELETE and INSERT are covered. The SELECT statement syntax and use of clauses like WHERE, ORDER BY, GROUP BY and JOINs are explained. Aggregate functions like COUNT, AVG, SUM etc and scalar functions are also summarized. Examples are provided throughout to illustrate the concepts and syntax.
Its about a sql topic for basic structured query languageIMsKanchanaI
油
this is containning about structured query language and database concepts , commands, queries and queries to create and database and inserting values and rows. rows cannot be inserted at a time. only one row can be inserted at a time.
This document provides an overview of querying and reporting in SQL, covering topics like arithmetic operators, built-in functions, selecting data, grouping results, joins, and subqueries. The agenda includes learning objectives, descriptions of SELECT statements, and explanations of concepts like aggregate functions, limiting results, sorting data, and correlating subqueries.
The MySQL LIKE operator is used in SELECT statements to search for a pattern within a column and works with wildcard characters. It allows finding rows that match or contain a certain substring. The % wildcard represents zero, one, or multiple characters while _ represents a single character. Some examples of LIKE queries include finding rows where a column starts with, ends with, or contains a substring.
The document discusses various SQL concepts including creating and dropping databases and tables, data types, SQL statements for inserting, updating and deleting records, joining tables, and aggregation functions. It provides syntax and examples for commands like CREATE DATABASE, CREATE TABLE, INSERT, UPDATE, DELETE, SELECT, WHERE, GROUP BY, UNION and functions like COUNT, SUM, AVG, MAX, MIN. The document is meant as a guide for students to learn fundamental SQL concepts through explanations, syntax and hands-on activities like creating a table.
SQL stands for Structured Query Language and is used to manage relational database objects and data. SQL commands are divided into categories like DDL, DML, DQL etc. DDL commands are used to define database schemas and objects, DML commands manipulate the data within database tables, and DQL commands are used to query or retrieve data from databases. Some key SQL commands include CREATE, ALTER, DROP, SELECT, INSERT, UPDATE, DELETE. SQL also supports integrity constraints, data types, joins, aggregations and more.
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.
The document discusses SQL DML statements like SELECT, INSERT, UPDATE, and DELETE. It provides examples of using each statement to manipulate data in tables. It also covers additional SQL clauses and functions like WHERE, ORDER BY, GROUP BY, JOIN, and aggregate functions that can be used with the SELECT statement to filter, sort, group, and perform calculations on the result set.
The document provides an overview of Data Query Language (DQL) syntax for SELECT statements including:
- Selecting columns from tables
- Using column aliases
- Filtering rows with the WHERE clause
- Working with NULL values
- Sorting results with the ORDER BY clause
- Grouping rows with the GROUP BY clause and aggregate functions
- Filtering groups with the HAVING clause
- Sorting on multiple columns
- Nested subqueries
The document discusses SQL SELECT statements and their capabilities. It explains how to write basic SELECT statements to retrieve data from one or more tables, including selecting specific columns, filtering rows, sorting results, and performing calculations. It also covers JOIN operations, including inner joins to combine data from multiple tables and self joins to join a table to itself.
The document discusses SQL SELECT statements and their capabilities. It explains how to write basic SELECT statements to retrieve data from one or more tables, including selecting specific columns, filtering rows, sorting results, and performing calculations. It also covers JOIN operations, including inner joins to combine data from multiple tables and self joins to join a table to itself.
The document contains several SQL queries:
1. Queries to find the second and third highest salaries from an employee table, and the nth highest salary.
2. A query to find the maximum salary for each department from an employee table.
3. Queries to get the current date, check if a date is valid, and alter a table to add a date column.
4. Queries to find duplicate and unique records, and delete duplicate records from a table.
5. Queries to find above average employees, employees that are also managers, and employees between salary ranges.
6. Additional queries for counts, names, odd rows, copying tables, common/uncommon records between tables.
The document discusses various SQL commands used for managing databases and querying data. It covers commands for creating and deleting databases and tables, inserting, updating, and deleting records, modifying table structures, grouping and filtering query results using aggregate functions and conditions, and ordering query results. Key SQL commands covered include CREATE, DROP, INSERT, UPDATE, DELETE, ALTER, SELECT, GROUP BY, HAVING, and ORDER BY.
This document discusses database management systems and SQL. It provides examples of creating tables, inserting and retrieving data using commands like SELECT, UPDATE, and DELETE. It also covers SQL sublanguages, data types, logical operators, and pattern matching operators. Key points include that a DBMS manages a database using software, SQL is the standard language used to communicate with databases, and tables are used to store data in rows and columns.
1) The document provides information on various SQL functions for string manipulation, date functions, aggregate functions, and selecting rows from tables based on conditions.
2) String functions include concatenation, conversion between ASCII and character values, indexing and pattern matching. Date functions include adding/subtracting dates and retrieving date parts. Aggregate functions include average, count, max, min and sum.
3) Row selection can be done using comparison, range, list, string and logical operators to specify conditions in the WHERE clause. Distinct, TOP and PERCENT clauses can also be used for result set filtering.
This document provides an overview of SQL commands and examples, including SELECT, WHERE, ORDER BY, INSERT, UPDATE, DELETE, JOIN, UNION and more. Key points include:
- SQL is a standard language for accessing and manipulating databases and became an ANSI and ISO standard in the 1980s.
- Common SQL commands allow users to query data with SELECT, insert/update/delete records, and perform other data management tasks.
- Logical operators like WHERE, AND, OR, NOT allow for filtering query results.
- JOINs combine data from multiple tables by common columns.
- Aggregate functions like COUNT, SUM, AVG perform calculations across record sets.
- Examples
The document provides information about MySQL including:
1. MySQL is an open source relational database management system based on SQL that is used to add, remove, and modify information in databases.
2. It describes basic MySQL commands like CREATE TABLE, DROP TABLE, SELECT, INSERT, UPDATE, and provides syntax examples.
3. It also covers advanced commands, functions in MySQL like aggregate functions, numeric functions and string functions as well as stored procedures.
The document discusses various SQL statements that can be used in PL/SQL programs including SELECT, INSERT, UPDATE, DELETE, and MERGE. It provides examples of using each statement to retrieve, manipulate, and manage data in Oracle databases. The SELECT statement is used to query data, INSERT adds new rows, UPDATE modifies rows, DELETE removes rows, and MERGE can insert or update rows in a single statement. Joins and cursors are also introduced.
The document discusses various commands used in database management systems like Oracle. It explains commands to create, alter, delete and modify database tables. Additional commands covered include inserting, updating, selecting and displaying data from tables. Examples are provided for each command syntax. The document also discusses creating tables from other tables and inserting records between tables using queries. Finally, multiple exercises are provided to apply the covered commands.
This document discusses different types of joins in SQL, including:
1) Equijoins to retrieve records that match between two tables using column equality.
2) Nonequijoins using operators like BETWEEN to join on non-equal columns.
3) Outer joins to return both matching and non-matching record results from the left or right tables.
4) Self-joins to join a table to itself.
5) Cross joins to generate the Cartesian product between two tables without a join condition.
Introduction to Oracle Functions--(SQL)--Abhishek Sharma爐爐爐逗し爛爐 爐謹ぐ爛爐爐
油
Functions make query results easier to understand and manipulate data values. There are two categories of functions: single row/scalar functions that return one value per row, and group/aggregate functions that operate on sets of values to return a single result. The GROUP BY clause groups rows based on columns and is used with aggregate functions to return summary results for each group.
Why Data Visualization?
What is Data Visualization?
What is matplotlib?
Types of charts
Basic of matplotlib
Bar chart,
Histogram
Pie chart
Scatter chart
Stack plot
Subplot
References
adding extra feature to all types of chart like Bar chart, Histogram, Stack plot
The MySQL LIKE operator is used in SELECT statements to search for a pattern within a column and works with wildcard characters. It allows finding rows that match or contain a certain substring. The % wildcard represents zero, one, or multiple characters while _ represents a single character. Some examples of LIKE queries include finding rows where a column starts with, ends with, or contains a substring.
The document discusses various SQL concepts including creating and dropping databases and tables, data types, SQL statements for inserting, updating and deleting records, joining tables, and aggregation functions. It provides syntax and examples for commands like CREATE DATABASE, CREATE TABLE, INSERT, UPDATE, DELETE, SELECT, WHERE, GROUP BY, UNION and functions like COUNT, SUM, AVG, MAX, MIN. The document is meant as a guide for students to learn fundamental SQL concepts through explanations, syntax and hands-on activities like creating a table.
SQL stands for Structured Query Language and is used to manage relational database objects and data. SQL commands are divided into categories like DDL, DML, DQL etc. DDL commands are used to define database schemas and objects, DML commands manipulate the data within database tables, and DQL commands are used to query or retrieve data from databases. Some key SQL commands include CREATE, ALTER, DROP, SELECT, INSERT, UPDATE, DELETE. SQL also supports integrity constraints, data types, joins, aggregations and more.
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.
The document discusses SQL DML statements like SELECT, INSERT, UPDATE, and DELETE. It provides examples of using each statement to manipulate data in tables. It also covers additional SQL clauses and functions like WHERE, ORDER BY, GROUP BY, JOIN, and aggregate functions that can be used with the SELECT statement to filter, sort, group, and perform calculations on the result set.
The document provides an overview of Data Query Language (DQL) syntax for SELECT statements including:
- Selecting columns from tables
- Using column aliases
- Filtering rows with the WHERE clause
- Working with NULL values
- Sorting results with the ORDER BY clause
- Grouping rows with the GROUP BY clause and aggregate functions
- Filtering groups with the HAVING clause
- Sorting on multiple columns
- Nested subqueries
The document discusses SQL SELECT statements and their capabilities. It explains how to write basic SELECT statements to retrieve data from one or more tables, including selecting specific columns, filtering rows, sorting results, and performing calculations. It also covers JOIN operations, including inner joins to combine data from multiple tables and self joins to join a table to itself.
The document discusses SQL SELECT statements and their capabilities. It explains how to write basic SELECT statements to retrieve data from one or more tables, including selecting specific columns, filtering rows, sorting results, and performing calculations. It also covers JOIN operations, including inner joins to combine data from multiple tables and self joins to join a table to itself.
The document contains several SQL queries:
1. Queries to find the second and third highest salaries from an employee table, and the nth highest salary.
2. A query to find the maximum salary for each department from an employee table.
3. Queries to get the current date, check if a date is valid, and alter a table to add a date column.
4. Queries to find duplicate and unique records, and delete duplicate records from a table.
5. Queries to find above average employees, employees that are also managers, and employees between salary ranges.
6. Additional queries for counts, names, odd rows, copying tables, common/uncommon records between tables.
The document discusses various SQL commands used for managing databases and querying data. It covers commands for creating and deleting databases and tables, inserting, updating, and deleting records, modifying table structures, grouping and filtering query results using aggregate functions and conditions, and ordering query results. Key SQL commands covered include CREATE, DROP, INSERT, UPDATE, DELETE, ALTER, SELECT, GROUP BY, HAVING, and ORDER BY.
This document discusses database management systems and SQL. It provides examples of creating tables, inserting and retrieving data using commands like SELECT, UPDATE, and DELETE. It also covers SQL sublanguages, data types, logical operators, and pattern matching operators. Key points include that a DBMS manages a database using software, SQL is the standard language used to communicate with databases, and tables are used to store data in rows and columns.
1) The document provides information on various SQL functions for string manipulation, date functions, aggregate functions, and selecting rows from tables based on conditions.
2) String functions include concatenation, conversion between ASCII and character values, indexing and pattern matching. Date functions include adding/subtracting dates and retrieving date parts. Aggregate functions include average, count, max, min and sum.
3) Row selection can be done using comparison, range, list, string and logical operators to specify conditions in the WHERE clause. Distinct, TOP and PERCENT clauses can also be used for result set filtering.
This document provides an overview of SQL commands and examples, including SELECT, WHERE, ORDER BY, INSERT, UPDATE, DELETE, JOIN, UNION and more. Key points include:
- SQL is a standard language for accessing and manipulating databases and became an ANSI and ISO standard in the 1980s.
- Common SQL commands allow users to query data with SELECT, insert/update/delete records, and perform other data management tasks.
- Logical operators like WHERE, AND, OR, NOT allow for filtering query results.
- JOINs combine data from multiple tables by common columns.
- Aggregate functions like COUNT, SUM, AVG perform calculations across record sets.
- Examples
The document provides information about MySQL including:
1. MySQL is an open source relational database management system based on SQL that is used to add, remove, and modify information in databases.
2. It describes basic MySQL commands like CREATE TABLE, DROP TABLE, SELECT, INSERT, UPDATE, and provides syntax examples.
3. It also covers advanced commands, functions in MySQL like aggregate functions, numeric functions and string functions as well as stored procedures.
The document discusses various SQL statements that can be used in PL/SQL programs including SELECT, INSERT, UPDATE, DELETE, and MERGE. It provides examples of using each statement to retrieve, manipulate, and manage data in Oracle databases. The SELECT statement is used to query data, INSERT adds new rows, UPDATE modifies rows, DELETE removes rows, and MERGE can insert or update rows in a single statement. Joins and cursors are also introduced.
The document discusses various commands used in database management systems like Oracle. It explains commands to create, alter, delete and modify database tables. Additional commands covered include inserting, updating, selecting and displaying data from tables. Examples are provided for each command syntax. The document also discusses creating tables from other tables and inserting records between tables using queries. Finally, multiple exercises are provided to apply the covered commands.
This document discusses different types of joins in SQL, including:
1) Equijoins to retrieve records that match between two tables using column equality.
2) Nonequijoins using operators like BETWEEN to join on non-equal columns.
3) Outer joins to return both matching and non-matching record results from the left or right tables.
4) Self-joins to join a table to itself.
5) Cross joins to generate the Cartesian product between two tables without a join condition.
Introduction to Oracle Functions--(SQL)--Abhishek Sharma爐爐爐逗し爛爐 爐謹ぐ爛爐爐
油
Functions make query results easier to understand and manipulate data values. There are two categories of functions: single row/scalar functions that return one value per row, and group/aggregate functions that operate on sets of values to return a single result. The GROUP BY clause groups rows based on columns and is used with aggregate functions to return summary results for each group.
Why Data Visualization?
What is Data Visualization?
What is matplotlib?
Types of charts
Basic of matplotlib
Bar chart,
Histogram
Pie chart
Scatter chart
Stack plot
Subplot
References
adding extra feature to all types of chart like Bar chart, Histogram, Stack plot
Virtual Power plants-Cleantech-RevolutionAshoka Saket
油
VPPs are virtual aggregations of distributed energy resources, such as energy storage, solar panels, and wind turbines, that can be controlled and optimized in real-time to provide grid services.
Production Planning & Control and Inventory Management.pptxVirajPasare
油
Production Planning and Control : Importance, Objectives and Functions . Inventory Management - Meaning, Types , Objectives, Selective Inventory Control : ABC Analysis
Self-Compacting Concrete: Composition, Properties, and Applications in Modern...NIT SILCHAR
油
Self-Compacting Concrete (SCC) is a high-performance material that flows under its own weight, eliminating the need for vibration. It offers superior workability, durability, and structural efficiency, making it ideal for complex designs, congested reinforcement, and sustainable construction practices.
NFPA 70B & 70E Changes and Additions Webinar Presented By FlukeTranscat
油
Join us for this webinar about NFPA 70B & 70E changes and additions. NFPA 70B and NFPA 70E are both essential standards from the National Fire Protection Association (NFPA) that focus on electrical safety in the workplace. Both standards are critical for protecting workers, reducing the risk of electrical accidents, and ensuring compliance with safety regulations in industrial and commercial environments.
Fluke Sales Applications Manager Curt Geeting is presenting on this engaging topic:
Curt has worked for Fluke for 24 years. He currently is the Senior Sales Engineer in the NYC & Philadelphia Metro Markets. In total, Curt has worked 40 years in the industry consisting of 14 years in Test Equipment Distribution, 4+ years in Mfg. Representation, NAED Accreditation, Level 1 Thermographer, Level 1 Vibration Specialist, and Power Quality SME.
Barbara Bianco
Project Manager and Project Architect, with extensive experience in managing and developing complex projects from concept to completion. Since September 2023, she has been working as a Project Manager at MAB Arquitectura, overseeing all project phases, from concept design to construction, with a strong focus on artistic direction and interdisciplinary coordination.
Previously, she worked at Progetto CMR for eight years (2015-2023), taking on roles of increasing responsibility: initially as a Project Architect, and later as Head of Research & Development and Competition Area (2020-2023).
She graduated in Architecture from the University of Genoa and obtained a Level II Masters in Digital Architecture and Integrated Design from the INArch Institute in Rome, earning the MAD Award. In 2009, she won First Prize at Urban Promo Giovani with the project "From Urbanity to Humanity", a redevelopment plan for the Maddalena district of Genoa focused on the visual and perceptive rediscovery of the city.
Experience & Projects
Barbara has developed projects for major clients across various sectors (banking, insurance, real estate, corporate), overseeing both the technical and aesthetic aspects while coordinating multidisciplinary teams. Notable projects include:
The Sign Business District for Covivio, Milan
New L'Or辿al Headquarters in Milan, Romolo area
Redevelopment of Via C. Colombo in Rome for Prelios, now the PWC headquarters
Interior design for Spark One & Spark Two, two office buildings in the Santa Giulia district, Milan (Spark One: 53,000 m族) for In.Town-Lendlease
She has also worked on international projects such as:
International Specialized Hospital of Uganda (ISHU) Kampala
Palazzo Milano, a residential building in Taiwan for Chonghong Construction
Chua Lang Street Building, a hotel in Hanoi
Manjiangwan Masterplan, a resort in China
Key Skills
鏝 Integrated design: managing and developing projects from concept to completion
鏝 Artistic direction: ensuring aesthetic quality and design consistency
鏝 Project management: coordinating clients, designers, and multidisciplinary consultants
鏝 Software proficiency: AutoCAD, Photoshop, InDesign, Office Suite
鏝 Languages: Advanced English, Basic French
鏝 Leadership & problem-solving: ability to lead teams and manage complex processes in dynamic environments
In this PDF document, the importance of engineering models in successful project execution is discussed. It explains how these models enhance visualization, planning, and communication. Engineering models help identify potential issues early, reducing risks and costs. Ultimately, they improve collaboration and client satisfaction by providing a clear representation of the project.
PROJECT REPORT ON PASTA MACHINE - KP AUTOMATIONS - PASTA MAKING MACHINE PROJE...yadavchandan322
油
All the materials and content contained in Project report is for educational purpose and reflect the views of the industry which are drawn from various research on pasta machine. PM FME- Detailed Project Report of Multigrain Pasta Making Unit. 3. 1. PROJECT ... A pasta extruder is a machine that makes pasta dough through dies to.The process is quite simple and requires not much skilled labour. The machine itself is high technology and provides the manufacturers to produce noodles with. In this article, you will be able to get all the detail about a pasta-making business unit in India and the financial status of this business as well.ENGINEERS INDIA RESEARCH INSTITUTE - Service Provider of Project Report on PASTA PRODUCTION PLANT (SHORT PASTA) [CODE NO. 1632] based in Delhi, India.
Macaroni Machines are used to produce pasta from the raw material. With ... The views expressed in this Project Report are advisory in nature. SAMADHAN.
SIMULATION OF FIR FILTER BASED ON CORDIC ALGORITHMVLSICS Design
油
Coordinate Rotation Digital Computer (CORDIC) discovered by Jack E Volder. It is a shift-add operation and iterative algorithm. CORDIC algorithm has wide area for several applications like digital signal processing, biomedical processing, image processing, radar signal processing, 8087 math coprocessor, the HP-35 calculator, Discrete Fourier, Discrete Hartley and Chirp-Z transforms, filtering, robotics, real time navigational system and also in communication systems. In this paper, we discussed about the CORDIC algorithm and CORDIC algorithm based finite impulse response low pass & high pass filter. We have generated the M-code for the CORDIC Algorithm and CORDIC Algorithm based FIR filter with the help of MATLAB 2010a.We also discussed about the frequency response characteristics of FIR filter.
2. INSERT Command
MySQL INSERT statement is used to store or add data in MySQL
table within the database.
We can perform insertion of records in two ways using a single
query in MySQL:
Insert record in a single row
Insert record in multiple rows
Syntax:
INSERT INTO table_name ( field1, field2,...fieldN )
VALUES ( value1, value2,...valueN );
Example:
INSERT INTO People (id, name, occupation, age)
VALUES (101, 'Peter', 'Engineer', 32);
3. 遺看稼岳
Inserting Multiple records into table
Syntax:
INSERT INTO table_name VALUES
( value1, value2,...valueN ),( value1, value2,...valueN ),
...........,(value1, value2,...valueN );
Example:
INSERT INTO People VALUES (102, 'Joseph', 'Develope
r', 30),(103, 'Mike', 'Leader', 28),
(104, 'Stephen', 'Scientist', 45);
4. 遺看稼岳
If we want to store records without giving all fields,
we use the following partial field statements. In such
case, it is mandatory to specify field names.
Example:
INSERT INTO People (name, occupation)
VALUES ('Stephen', 'Scientist'), ('Bob', 'Actor');
5. Update command
MySQL UPDATE query is a DML statement used to
modify the data of the MySQL table within the
database.
The UPDATE statement is used with the SET and
WHERE clauses. The SET clause is used to change
the values of the specified column. We can update
single or multiple columns at a time.
6. 遺看稼岳
Syntax:
UPDATE table_name SET column_name1 = new -
value1,column_name2=new-value2, ...
[WHERE Clause]
Example:
1. update stud set city='pune' where name='aarti';
(Only city field of row having name as aarti will be changed as
pune)
2. . update stud set city='pune'
(city field of All row will be changed as Pune)
7. DELETE Command
MySQL DELETE statement is used to delete data from the
MySQL table within the database.
By using delete statement, we can delete records on the
basis of conditions.
Syntax:
DELETE FROM table_name WHERE (Condition specified);
Example:
delete from stud where grade='72';
DELETE FROM Stud;
8. DQL Commands:SELECT
The MySQL SELECT statement is used to fetch data from the one or
more tables in MySQL. We can retrieve records of all fields or
specified fields.
Syntax:
SELECT column list
FROM table
[WHERE conditions];
Example:
1. Select rno, name from stud;
2. Select * from stud;
3. Select * from stud where grade>60;
4. Select grade from Stud where name=aarti;
9. Where clause
MySQL WHERE Clause is used with SELECT, INSERT,
UPDATE and DELETE clause to filter the results.
It specifies a specific position where you have to do the
operation.
Example:
1.SELECT *FROM emp
WHERE ecity = pune' AND age >30;
2. select * from emp where(ecity='pune' and did=1)or
(age<33);
10. LIKE Operator- search for a specified pattern in a column
Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern
SQL Wildcards
SQL wildcards can substitute for one or more
characters when searching for data in a database.
SQL wildcards must be used with the LIKE operator.
Wildcard Description
% A substitute for zero or more characters
_ A substitute for exactly one character
11. LIKE Operator- Example
P_Id LastName Address
1 Heena Pune
2 Savita Pune
3 Sarika Bombay
"Persons" table
We use the following SELECT statement:
1. SELECT LastName from Person where LastName like S%
2.SELECT ename FROM emp WHERE address LIKE _________90';
3. SELECT ename FROM emp WHERE ecity NOT LIKE mum%';
12. Order By- clause
The ORDER BY keyword is used to sort the result-set by a specified column.
The ORDER BY keyword sort the records in ascending order by default.
If you want to sort the records in a descending order, you can use the DESC
keyword.
Syntax
SELECT column_name(s)
FROM table_name
ORDER BY column_name(s) ASC|DESC
Example
1. Select * from Stud order by rno desc;
2. Select * from Stud order by rno ;
3. Select * from Stud order by Name;
4. select name ,city from stud where grade>70 order by name asc, city
desc;
13. DISTINCT Operator
The DISTINCT keyword can be used to return only
distinct (different) values.
Syntax
SELECT DISTINCT column_name(s) FROM table_name;
Example
SELECT distinct(Address) from emp;
14. IN Operator
The MySQL IN condition is used to reduce the use of
multiple OR conditions in a SELECT, INSERT, UPDATE and
DELETE statement.
The IN operator allows you to specify multiple values in
a WHERE clause.
Syntax
SELECT column_name(s) FROM table_name
WHERE column_name IN (value1,value2,...)
Example
SELECT * FROM emp WHERE city IN ('Pune',mumbai');
15. NULL Operator-
To test if a value is NULL you cannot use =, because
every NULL is considered distinct from every other
one. Must use "IS NULL" or "IS NOT NULL
Syntax
SELECT Attr_List FROM table_name
WHERE Attr_name IS NULL;
Example
1. SELECT * FROM Stud WHERE city is null;
2. SELECT * FROM Stud WHERE city is not null;
16. Not Equal operator
MySQL Not Equal is an inequality operator that
used for returning a set of rows after comparing
two expressions that are not equal. The MySQL
contains two types of Not Equal operator, which are
(< >) and (! =).
Example:
SELECT * FROM emp WHERE city <> pune";
SELECT * FROM emp WHERE city != pune";
17. Between Operator
The MYSQL BETWEEN condition specifies how to
retrieve values from an expression within a specific
range. It is used with SELECT, INSERT, UPDATE and
DELETE statement.
Example:
SELECT * FROM stud
WHERE grade BETWEEN 70 AND 80;
18. Aggregate Functions
MySQL aggregate functions retrieve a single value
after performing a calculation on a set of values.
In general, aggregate functions ignore null values.
Used to find the minimum value of a
certain column
Min
Used to find the maximum value of a
certain column
Max
Used to calculate the average value of
the numeric type
Sum
Used to calculate the sum of all
selected columns
Avg
Used to Count the number of rows in a
database table
Count
19. Avg(),Min(),Max(),Sum()
Syntax
SELECT AVG( column_name) FROM table_name;
Example
SELECT AVG(Marks) FROM Stud;
Syntax
SELECT Min( column_name) FROM table_name;
Example
SELECT Min(Marks) FROM Stud;
Syntax of all other functions are similar.
20. Count()- Syntax
COUNT function is used to Count the number of rows in a
database table. It can work on both numeric and non-numeric
data types.
Syntax
SELECT COUNT( column_name) FROM table_name;
COUNT function uses the COUNT(*) that returns the count of all
the rows in a specified table. COUNT(*) considers duplicate
and Null.
Syntax
SELECT COUNT(*) FROM table_name;
21. Group By and Having Clause
The MYSQL GROUP BY Clause is used to collect data from
multiple records and group the result by one or more column. It
is generally used in a SELECT statement.
You can also use some aggregate functions like COUNT, SUM,
MIN, MAX, AVG etc. on the grouped column.
Syntax:
SELECT Column1, column2, ... Column_n,
aggregate_function (expression)
FROM tables
[WHERE conditions]
GROUP BY column1, column2, ... Column_n;
22. 遺看稼岳
Example:
1. SELECT city, COUNT(*) FROM stud
GROUP BY city;
2. SELECT ename, did, SUM(salary) AS "Total dept
salary" FROM emp GROUP BY did;
23. HAVING Clause
MySQL Having Clause is used only with GROUP BY
clause.
It always returns the rows where condition is TRUE.
Syntax:
SELECT column_name(s) FROM table_name
WHERE condition
GROUP BY column_name(s)
HAVING condition ;
24. GROUP BY & Having Clause- Example
id name type price
123451 Park's Great Hits Music 19
123452 Silly Puddy Toy 5
123453 Playstation Toy 89
123454 Men's T-Shirt Clothing 32
123455 Blouse Clothing 34
123456 Electronica 2002 Music 3
SELECT type, MIN(price) FROM
products GROUP BY type
Type Min(Prize)
Music 3
Toy 5
Clothing 32
Products Table
Out Put
SELECT type, Min(price) FROM
products GROUP BY type
having Min(price)>4
Type Min(Prize)
Toy 5
Clothing 32
26. MySQL first function
The MySQL first function is used to return the first
value of the selected column. Here, we use limit clause
to select first record or more.
Syntax:
SELECT column_name
FROM table_name
LIMIT 1;
27. SET Operations: Union
MySQL UNION operator allows you to combine two or more result sets of queries
into a single result set.
Syntax:
SELECT column_list
UNION [DISTINCT | ALL]
SELECT column_list
UNION [DISTINCT | ALL]
SELECT column_list ...
To combine result set of two or more queries using the UNION operator, there are the
basic rules that you must follow:
First, the number and the orders of columns that appear in all SELECT statements must
be the same.
Second, the data types of columns must be the same or convertible.
By default, the UNION operator removes duplicate rows even if you dont specify the
DISTINCT operator explicitly.
37. Assignment
Eid EName Address Salary Commision
1 Amit Pune 35000 5000
2 Sneha Pune 25000
3 Savita Nasik 28000 2000
4 Pooja Mumbai 19000
5 Sagar Mumbai 25000 3000
1. Find different locations from where employees belong to?
2. What is maximum and minimum salary?
3. Display the content of employee table according to the ascending order of salary amount.
4. Find the name of employee who lived in Nasik or Pune city.
5. Find the name of employees who does not get commission.
6. Change the city of Amit to Nashik.
7. Find the information of employees whose name starts with A.
8. Find the count of staff from Mumbai.
9. Find the count of staff from each city
10.Find the address from where employees are belonging as well as where projects are going on.
11.Find city wise minimum salary.
12.Find city wise maximum salary having maximum salary greater than 26000
13.Delete the employee who is having salary greater than 30,000.
Create Employee table, Project table and add rows shown below
PrNo Addr
10 Mumbai
20 Pune
30 Jalgoan