This document summarizes SQL statements, functions, and joins. It defines SQL as a programming language for managing relational databases and describes common SQL statements like DDL, DML, and DCL. It also outlines functions like aggregate functions to return single calculated values and scalar functions to modify values. Finally, it explains join operations to combine data from multiple tables based on common fields.
Feeder stripe, Engineering stripe and Auto stripe mechanismAzmir Latif Beg
Auto stripe machine give stable structure with auto-stripper device, which could get various colors. Auto stripe & Engineering is commonly mark in use that does not goes with their definition. Today I will discuss regarding knit stripe patter.
Knit fragments dating back to 250 BC
◦
Compared to 9,000 years for wovens
y
Introduced to Europe by the Arabs
◦
Did not gain popularity until around 1,000 AD
Ring spinning produces yarn in a package form called cops. Since cops from ringframes are not suitable for further processing, the winding process serves to achieve additional objectives made necessary by the requirements of the subsequent processing stages.
Feeder stripe, Engineering stripe and Auto stripe mechanismAzmir Latif Beg
Auto stripe machine give stable structure with auto-stripper device, which could get various colors. Auto stripe & Engineering is commonly mark in use that does not goes with their definition. Today I will discuss regarding knit stripe patter.
Knit fragments dating back to 250 BC
◦
Compared to 9,000 years for wovens
y
Introduced to Europe by the Arabs
◦
Did not gain popularity until around 1,000 AD
Ring spinning produces yarn in a package form called cops. Since cops from ringframes are not suitable for further processing, the winding process serves to achieve additional objectives made necessary by the requirements of the subsequent processing stages.
This PPT will help to understand how learning happens in brain. How you can adjust your skill acquisition in the right way so that maximum output is obtained.
Baabtra.com has a solution to provide programming for kids in school. This is based on the CBSE curriculum of India. The main subjects covered are Mathematics and Physics.
99LMS is a mobile based comprehensive enterprise learning environment in which learning processes of a company can be managed and integrated. It ensures employees have the right skills by enabling course content management, providing classroom training and e-learning. Through the APIs, you can develop your resources before they join your company.
3. Disclaimer: This presentation is prepared by trainees of
baabtra.com as a part of mentoring program. This is not
official document of baabtra.com – Mentoring Partner
4. SQL
Structured Query Language
SQL is Special purpose programming language designed
for managing data held in Relational Data Base
Management System(RDBMS)
5. SQL STATEMENTS
• Data Definition Language (DDL)
- Define database structure/schema.
• Data Manipulation Language (DML)
-Manipulation on table data.
Query one or more tables.
• Data Control Language (DCL)
-Set database permissions and privileges.
8. DDL Commands
• CREATE - To create objects in data base.
o CREATE DATABASE <database name>;
E.g. CREATE DATABASE db_student;
o CREATE TABLE tablename
(
field1 datatype,
field2 datatype
);
E.g. CREATE TABLE tbl_student(vchr_name varchar(20),int_roll int);
vchr_name int_roll
NULL NULL
9. • ALTER – Alter the structure of database. i.e., to add or drop
columns on existing table.
ALTER TABLE tablename ADD column datatype;//add column
ALTER TABLE tablename DROP column; //delete a column
E.g. ALTER TABLE tbl_student ADD int_mark int; //added new
column mark of
type integer
E.g. ALTER TABLE tbl_student DROP int_mark; //deleted mark
vchr_name int_roll int_mark
NULL NULL NULL
10. • TRUNCATE – To remove all records from table.
TRUNCATE TABLE tablename;
E.g. TRUNCATE TABLE tbl_student;
• RENAME - to rename a table
RENAME TABLE oldname TO newname’;
E.g. RENAME TABLE tbl_student TO tbl_studentrecord;
11. DML Commands
• INSERT – Add data into the table.
insert into table_name values(data1,data2,...);
insert into tbl_student values(‘john’, 11);
tbl_student
vchr_name int_roll
john 11
12. • UPDATE – to update a value in a table.
UPDATE table_name SET column_name=value WHERE condition.
E.g. UPDATE tbl_student set vchr_name=‘james’ where chr_name=‘john’;
vchr_name int_roll
steve 10
james 11
vchr_name int_roll
steve 10
john 11
Before update
After update
13. • DELETE – to delete a row from table.
DELETE FROM tablename ;
DELETE from tbl_student where chr_name=‘james’;
pk_id vchr_name int_roll
1 steve 10
2 james 11
Before deletion
After deletion
pk_id vchr_name int_roll
1 steve 10
14. • SELECT – Retrieve data from database.
SELECT column FROM tablename;
E.g1. SELECT * FROM tbl_student; //gives all columns of table
pk_id vchr_name int_roll
1 steve 10
2 James 11
E.g2. SELECT pk_id,vchr_name FROM tbl_student; //gives
specified columns of table
pk_id vchr_name
1 steve
2 james
16. Aggregate Functions
Function that returns a single value, calculated from values
in column.
• SUM() – returns sum of column.
• COUNT() – returns number of rows.
• AVG() – returns average value of column.
• MIN() – returns smallest value of column.
• MAX() – returns largest value of column.
• LAST() – returns the last value.
• FIRST() – returns the first value.
17. Use of aggregate functions.
SELECT avg(emp_count), sum(emp_count), max(emp_count)
min(emp_count), count(emp_count) from tbl_employee;
brnch_num brnch_name region_num emp_count
108 New york 100 10
110 Boston 100 6
21 Chicago 200 5
404 San Diego 400 6
415 San jose 400 3
avg(emp_count) sum(emp_count) max(emp_count) min(emp_count) count(emp_count)
6 30 10 3 5
18. Scalar Functions
Function that returns a single value, based on input value.
• UCASE() – converts a field to upper case.
• LCASE() - converts a field to lower case.
• LEN() – returns the length of a text filed.
• ROUND() – rounds a numeric field to number of decimal
specified
SELECT UCASE(column_name) FROM table_name;
19. JOIN OPERATION
Combine rows from two or more tables, based on a common
field between them.
• INNER JOIN (SIMPLE JOIN OR JOIN) – Returns rows when there is a
match in both tables
• OUTER JOIN –Returns all the rows of both table whether it has matched
or not
-LEFT OUTER JOIN (LEFT JOIN) – Returns all rows from left
table and matched rows from right table.
- RIGHT OUTER JOIN (RIGHT JOIN)- Returns all rows from
right table and matched rows from left table
20. Pk_emp_id vchr_emp_name vchr_company
1 James Dell
2 John Sony
3 Albert Hp
Pk_desig_id vchr_desig
1 System
engineer
2 Tester
4 Tech support
Tbl_emp Tbl_empdesig
SELECT * FROM tbl_emp JOIN tbl_empdesig on
tbl_emp.pk_emp_id=tbl_empdesig.pk_desig_id
Pk_emp_id vchr_emp_name vchr_company Pk_desig_id vchr_desig
1 James Delll 1 System engineer
2 john Sony 2 Tester
E.g. JOIN
Common value
21. LEFT OUTER JOIN
Pk_emp_id vchr_emp_name Chr_company
1 James Dell
2 John Sony
3 Albert Hp
Pk_desig_id vchr_desig
1 System
engineer
2 Tester
4 Tech support
Tbl_emp Tbl_empdesig
SELECT * FROM tbl_emp LEFT JOIN tbl_empdesig on
tbl_emp.pk_emp_id=tbl_empdesig.pk_desig_id
Pk_emp_id vchr_emp_name vchr_company Pk_desig_id vchr_desig
1 James Delll 1 System engineer
2 john Sony 2 Tester
3 Albert Hp Null null
22. RIGHT OUTER JOIN
Pk_emp_id vchr_emp_name vchr_company
1 James Dell
2 John Sony
3 Albert Hp
Pk_desig_id vchr_desig
1 System
engineer
2 Tester
4 Tech support
Tbl_emp Tbl_empdesig
SELECT * FROM tbl_emp RIGHT JOIN tbl_empdesig on
tbl_emp.pk_emp_id=tbl_empdesig.pk_desig_id
Pk_emp_id vchr_emp_name vchr_company Pk_desig_id vchr_desig
1 James Delll 1 System engineer
2 john Sony 2 Tester
null null null 4 Tech suport
24. Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course
@ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designed
to make a quick, good software professional out of anybody who holds a passion for coding.
25. Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
26. Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us