ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
SQLStructured Query Language
SQL-Create tableCreate table table_name(column_name1 datatype, column_name2 datatype……)Eg:create table example (id int ,name varchar(10),address varchar(10))Msg:Command(s) completed successfully.
SQL-Insert ValuesInsert into table_name(column1,column2,…..)values(values1,values2,…)Eg:insert into example (id,name,address) values(123,'xxxx','yyyyy')Msg:(1 row(s) affected)
SQL-Select Commandselect *from exampleId     name  address123	xxxxyyyyy456	jjjjrrrr456	iiiinnnn567	eeeeffff
SQL-Alter CommandAlter table table_name add or drop column_namedatatypeEg: alter table example add mobilenointMsg: Command(s) completed successfully.Id     name address  mobileno123	xxxxyyyyy     NULL456	jjjjrrrr	      NULL888	iiiinnnn	      NULL567	eeeeffff	      NULL
SQL-Update CommandUpdate table_name set column_name=new value where column_name=any valueEg: Update example set id=888 where name='iiii‘Msg: (1 row(s) affected)Id      name address123	xxxxyyyyy456	jjjjrrrr888	iiiinnnn567	eeeeffff
SQL-Delete CommandDelete  table_name where conditionEg: delete example where id=888Msg: (1 row(s) affected)Id    name address mobileno123	xxxxyyyyy     NULL456	jjjjrrrr         NULL567	eeeeffff	     NULL
SQL-Drop CommandDrop table table_nameEg: drop table exampleMsg:Command(s) completed successfully.
SQL-Primary Key & Foreign Key CREATE TABLE table_name (column1 datatype null/not null, column2 datatype null/not null,...CONSTRAINT constraint_namePRIMARY KEY (column1, column2, . column_n));CREATE TABLE table_nameÌý(column1 datatype,Ìý column2 datatype,Ìýcolumn3 datatype,ÌýÌýPrimary Key (column_any),ÌýForeign Key (Column_any) references Table_any(datatype));
SQL-Primary Key & foreign Keycreate table example (id intprimary key,namevarchar(10),address varchar(10))AÌýprimary keyÌýis used to unique and Not Null identify each row in the table.create table example2 (salary int,expamountint, id int references example(id))A foreign keyÌýis a referential constraint between two tables.Ìý
SQL-Primary Key & Foreign Key Id     name address    123	rrrrtttt369	klkliooo456	iiiihhhh7889	wswswewwSalary   expamount id10000	4235	788912369	8526	45612369	865	  45665894	12589	123Example (primary Key tale)Example2 (Foreign Key tale)
SQL-DISTINCTselect distinct address from exaddressioioklkkyuyu
SQL-Primary Key & Foreign Key select name,address,salary from example e,example2 e2 where e.id=e2.idO/PName address    salarywswsweww	10000iiiihhhh	12369iiiihhhh 	12369rrrrtttt	          65894
SQL-BETWEEN & COUNTSELECT "column_name“ FROM "table_name"WHERE "column_name" BETWEEN 'value1' AND 'value2‘select id from ex where id between 100 and 500ID123456SELECT COUNT("column_name") FROM "table_name“select count(id)'No Of Records' from exNo Of Records4
SQL-Connection Stringstring strcon = "Data Source=172.16.0.1;Initial Catalog=BatchThree;User ID=magnum;Password=Magnum";SqlConnectionsqlcon = new SqlConnection(strcon);sqlcon.Open();stringstrsql = "insert into datab values	('" + txtmarks1.Text + "','" + txtmarks2.Text + "','" + txtmarks3.Text + "','" + txtname.Text + "')";SqlCommandcmd = new SqlCommand(strsql, sqlcon);cmd.CommandType = CommandType.Text;cmd.ExecuteNonQuery();sqlcon.Close();
SQL-Connection String
SQL-Connection String
SQL-Connection String
SQL-Stored Procedurecreate procedure proexample(@id int,@namevarchar(10),@address varchar(10)) as insert into example(id,name,address) values (@id,@name,@address)Command(s) completed successfully.exec proexample 666,'hghg','yuyu’(1 row(s) affected)
SQL-Stored Procedureselect *from exampleId    name address123	rrrrtttt369	klkliooo456	iiiihhhh666	hghgyuyu7889	wswsweww
SQL-JOINSSQL joinsÌýare used to query data from two or more tables, based on a relationship between certain columns in these tablesInner JoinLeft JoinRight JoinFull Join
SQL-INNER JOINThe INNER JOIN keyword return rows when there is at least one match in both tables.SELECT column_name(s)FROM table_name1INNER JOIN table_name2ON table_name1.column_name=table_name2.column_name
SQL-INNER JOINselect name,address,salary from example inner join example2 on example.id=example2.id order by nameName address   salaryiiiihhhh	12369iiiihhhh	12369rrrrtttt	          65894Wswsweww	10000
SQL-LEFT JOINThe LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2)SELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name
SQL_LEFT JOINselect name,address,salary from example left join example2 on example.id=example2.id order by nameName  address   salaryhghgyuyu	NULLiiiihhhh	12369iiiihhhh	12369klkliooo	           NULLrrrrtttt      	65894wswsweww         10000
SQL-RIGHT JOINThe RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1)SELECT column_name(s)FROM table_name1RIGHT JOIN table_name2ON table_name1.column_name=table_name2.column_name
SQL_RIGHT JOINselect name,address,salary from example right join example2 on example.id=example2.id order by nameName address salaryiiiihhhh     12369iiiihhhh     12369rrrrtttt	       65894wswsweww   10000
SQL-FULL JOINThe FULL JOIN keyword return rows when there is a match in one of the tables.SELECT column_name(s)FROM table_name1FULL JOIN table_name2ON table_name1.column_name=table_name2.column_name
SQL-FULL JOINselect name,address,salary from example full join example2 on example.id=example2.id order by nameName address salaryhghgyuyu	     NULLiiiihhhh	    12369iiiihhhh	    12369klkliooo       NULLrrrrtttt	    65894wswsweww   10000
SQL-VIEWviews can be considered as virtual tables and it physically stores the data. A view also has a set of definitions,and it does not physically store the data.The syntax for creating a view is as follows: CREATE VIEW "VIEW_NAME" AS "SQL Statement"
SQL-VIEWcreate view vex as select *from exselect *from vexid    name address123	pop	yuyu456	huh	ioioexareredrop view vex
SQL-DISTINCTTheÌýSELECT UNIQUEÌýterm is an Oracle-only SQL statement. It is equivalent toÌýSELECT DISTINCT.ÌýSyntaX:SELECT DISTINCT "column_name"FROM "table_name“Eg: select *from exId   name address123	pop	yuyu456	huh	ioio856	exaklkk856	exaklkk
SQL-IN & LIKESELECT "column_name“ FROM "table_name"WHERE "column_name" IN ('value1', 'value2', ...)select name,address from ex where id in(456)name addresshuh	ioioSELECT "column_name“ FROM "table_name"WHERE "column_name" LIKE {PATTERN}select name,address from ex where id like(456)name addressHuh ioio
End)Prabhu.ftz@gmail.com

More Related Content

What's hot (14)

Sql
SqlSql
Sql
Priyank Tewari
Ìý
Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schools
farhan516
Ìý
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
Bishal Ghimire
Ìý
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
webhostingguy
Ìý
SQL querys in detail || Sql query slides
SQL querys in detail || Sql query slidesSQL querys in detail || Sql query slides
SQL querys in detail || Sql query slides
gourav kottawar
Ìý
R for you
R for youR for you
R for you
Andreas Chandra
Ìý
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
Sherif Gad
Ìý
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Dmitriy Kiriyenko
Ìý
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big ThingWriteable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
PostgreSQL Experts, Inc.
Ìý
SQL || overview and detailed information about Sql
SQL || overview and detailed information about SqlSQL || overview and detailed information about Sql
SQL || overview and detailed information about Sql
gourav kottawar
Ìý
12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns
Connor McDonald
Ìý
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
Giuseppe Maxia
Ìý
Python data structures
Python data structuresPython data structures
Python data structures
Harry Potter
Ìý
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
Mohan Kumar.R
Ìý
Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schools
farhan516
Ìý
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
Bishal Ghimire
Ìý
SQL querys in detail || Sql query slides
SQL querys in detail || Sql query slidesSQL querys in detail || Sql query slides
SQL querys in detail || Sql query slides
gourav kottawar
Ìý
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
Sherif Gad
Ìý
SQL || overview and detailed information about Sql
SQL || overview and detailed information about SqlSQL || overview and detailed information about Sql
SQL || overview and detailed information about Sql
gourav kottawar
Ìý
12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns12c Mini Lesson - Invisible Columns
12c Mini Lesson - Invisible Columns
Connor McDonald
Ìý
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
Giuseppe Maxia
Ìý
Python data structures
Python data structuresPython data structures
Python data structures
Harry Potter
Ìý
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
Mohan Kumar.R
Ìý

Viewers also liked (14)

Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
Ìý
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
pandey3045_bit
Ìý
RDBMS and SQL
RDBMS and SQLRDBMS and SQL
RDBMS and SQL
Hamza Shah
Ìý
Sql basics
Sql basicsSql basics
Sql basics
Raghu nath
Ìý
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
Dr. C.V. Suresh Babu
Ìý
RDBMS SQL Basics
RDBMS SQL BasicsRDBMS SQL Basics
RDBMS SQL Basics
David Gloyn-Cox
Ìý
SQL Views
SQL ViewsSQL Views
SQL Views
baabtra.com - No. 1 supplier of quality freshers
Ìý
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
webhostingguy
Ìý
DBMS Practical File
DBMS Practical FileDBMS Practical File
DBMS Practical File
Dushmanta Nath
Ìý
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
1keydata
Ìý
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
Guru Ji
Ìý
Sql ppt
Sql pptSql ppt
Sql ppt
Anuja Lad
Ìý
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
Ram Sagar Mourya
Ìý
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
Ìý
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
Ìý
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
pandey3045_bit
Ìý
RDBMS and SQL
RDBMS and SQLRDBMS and SQL
RDBMS and SQL
Hamza Shah
Ìý
Sql basics
Sql basicsSql basics
Sql basics
Raghu nath
Ìý
DBMS Practical File
DBMS Practical FileDBMS Practical File
DBMS Practical File
Dushmanta Nath
Ìý
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
1keydata
Ìý
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
Guru Ji
Ìý
Sql ppt
Sql pptSql ppt
Sql ppt
Anuja Lad
Ìý
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
Ram Sagar Mourya
Ìý
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
Ìý

Similar to Sql (20)

Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01
sagaroceanic11
Ìý
Tables And SQL basics
Tables And SQL basicsTables And SQL basics
Tables And SQL basics
Amit Kumar Singh
Ìý
dbms.pdf
dbms.pdfdbms.pdf
dbms.pdf
walter brand
Ìý
Sql insert statement
Sql insert statementSql insert statement
Sql insert statement
Vivek Singh
Ìý
Commands
CommandsCommands
Commands
Ayushi Goyal
Ìý
SQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint PresentationSQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint Presentation
maitypradip938
Ìý
SQL
SQLSQL
SQL
Shyam Khant
Ìý
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
Shakila Mahjabin
Ìý
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
DevKartikSharma1
Ìý
Introduction sql
Introduction sqlIntroduction sql
Introduction sql
sagarasuri
Ìý
SQL Data Manipulation language and DQL commands
SQL Data Manipulation language and DQL commandsSQL Data Manipulation language and DQL commands
SQL Data Manipulation language and DQL commands
sonali sonavane
Ìý
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)
Huda Alameen
Ìý
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in database
Hemant Suthar
Ìý
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
pitchaiah yechuri
Ìý
Oraclesql
OraclesqlOraclesql
Oraclesql
Priya Goyal
Ìý
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
Abdelhay Shafi
Ìý
Query
QueryQuery
Query
Raj Devaraj
Ìý
Sql
SqlSql
Sql
baabtra.com - No. 1 supplier of quality freshers
Ìý
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
RaviRajput416403
Ìý
Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH
AmIt Prasad
Ìý
Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01Mysql 120831075600-phpapp01
Mysql 120831075600-phpapp01
sagaroceanic11
Ìý
Tables And SQL basics
Tables And SQL basicsTables And SQL basics
Tables And SQL basics
Amit Kumar Singh
Ìý
Sql insert statement
Sql insert statementSql insert statement
Sql insert statement
Vivek Singh
Ìý
SQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint PresentationSQL Class Note By Amit Maity PowerPoint Presentation
SQL Class Note By Amit Maity PowerPoint Presentation
maitypradip938
Ìý
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
DevKartikSharma1
Ìý
Introduction sql
Introduction sqlIntroduction sql
Introduction sql
sagarasuri
Ìý
SQL Data Manipulation language and DQL commands
SQL Data Manipulation language and DQL commandsSQL Data Manipulation language and DQL commands
SQL Data Manipulation language and DQL commands
sonali sonavane
Ìý
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)
Huda Alameen
Ìý
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in database
Hemant Suthar
Ìý
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
pitchaiah yechuri
Ìý
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
Abdelhay Shafi
Ìý
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
RaviRajput416403
Ìý
Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH
AmIt Prasad
Ìý

Recently uploaded (20)

8. Essential Skills: Application of Number: Ratio
8. Essential Skills: Application of Number: Ratio8. Essential Skills: Application of Number: Ratio
8. Essential Skills: Application of Number: Ratio
leigh441292
Ìý
Introduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptxIntroduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptx
Ms. Pooja Bhandare
Ìý
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir DotanThe Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
History of Stoke Newington
Ìý
Capitol Doctoral Presentation -March 2025.pptx
Capitol Doctoral Presentation -March 2025.pptxCapitol Doctoral Presentation -March 2025.pptx
Capitol Doctoral Presentation -March 2025.pptx
CapitolTechU
Ìý
TELPAS Proficiency Level Descriptors.pdf
TELPAS Proficiency Level Descriptors.pdfTELPAS Proficiency Level Descriptors.pdf
TELPAS Proficiency Level Descriptors.pdf
Sean Fisher
Ìý
Kothari Commission Recommendations And Their Implementation.pptx
Kothari Commission Recommendations And Their Implementation.pptxKothari Commission Recommendations And Their Implementation.pptx
Kothari Commission Recommendations And Their Implementation.pptx
JITENDRANATH GORAI
Ìý
Adrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic DrugsAdrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic Drugs
Dr C Vignesh
Ìý
Pests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptx
Pests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptxPests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptx
Pests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptx
Deepali Shid
Ìý
Sub Task Management with odoo Project Module
Sub Task Management with odoo Project ModuleSub Task Management with odoo Project Module
Sub Task Management with odoo Project Module
Celine George
Ìý
THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...
THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...
THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...
PRADEEP ABOTHU
Ìý
How to Manage Reporting in Events of Odoo 18
How to Manage Reporting in Events of Odoo 18How to Manage Reporting in Events of Odoo 18
How to Manage Reporting in Events of Odoo 18
Celine George
Ìý
7. Analysing Language And Techniques copy.pdf
7. Analysing Language And Techniques copy.pdf7. Analysing Language And Techniques copy.pdf
7. Analysing Language And Techniques copy.pdf
jpinnuck
Ìý
Health and Fitness Facts and Fads -Example: Weight Loss and Fad Diets -Effe...
Health and Fitness Facts and Fads  -Example: Weight Loss and Fad Diets  -Effe...Health and Fitness Facts and Fads  -Example: Weight Loss and Fad Diets  -Effe...
Health and Fitness Facts and Fads -Example: Weight Loss and Fad Diets -Effe...
alvinlorana1
Ìý
Pharmacognosy in various systems of medicine.pptx
Pharmacognosy in various systems of medicine.pptxPharmacognosy in various systems of medicine.pptx
Pharmacognosy in various systems of medicine.pptx
Ms. Pooja Bhandare
Ìý
20250310 McGuinness Institute Submission on Gene Technology Bill.pptx
20250310 McGuinness Institute Submission on Gene Technology Bill.pptx20250310 McGuinness Institute Submission on Gene Technology Bill.pptx
20250310 McGuinness Institute Submission on Gene Technology Bill.pptx
McGuinness Institute
Ìý
7. ES: Application of Number: Percentages
7. ES: Application of Number: Percentages7. ES: Application of Number: Percentages
7. ES: Application of Number: Percentages
leigh441292
Ìý
4. ES: Application of Number: Decimal Numbers
4. ES: Application of Number: Decimal Numbers4. ES: Application of Number: Decimal Numbers
4. ES: Application of Number: Decimal Numbers
leigh441292
Ìý
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Sean Fisher
Ìý
The Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom WalkerThe Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom Walker
History of Stoke Newington
Ìý
BCBR Basic Course in Biomedical Research exam notes for studying before exam...
BCBR Basic Course in Biomedical  Research exam notes for studying before exam...BCBR Basic Course in Biomedical  Research exam notes for studying before exam...
BCBR Basic Course in Biomedical Research exam notes for studying before exam...
Satish Kumar
Ìý
8. Essential Skills: Application of Number: Ratio
8. Essential Skills: Application of Number: Ratio8. Essential Skills: Application of Number: Ratio
8. Essential Skills: Application of Number: Ratio
leigh441292
Ìý
Introduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptxIntroduction of secondary metabolities.pptx
Introduction of secondary metabolities.pptx
Ms. Pooja Bhandare
Ìý
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir DotanThe Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
History of Stoke Newington
Ìý
Capitol Doctoral Presentation -March 2025.pptx
Capitol Doctoral Presentation -March 2025.pptxCapitol Doctoral Presentation -March 2025.pptx
Capitol Doctoral Presentation -March 2025.pptx
CapitolTechU
Ìý
TELPAS Proficiency Level Descriptors.pdf
TELPAS Proficiency Level Descriptors.pdfTELPAS Proficiency Level Descriptors.pdf
TELPAS Proficiency Level Descriptors.pdf
Sean Fisher
Ìý
Kothari Commission Recommendations And Their Implementation.pptx
Kothari Commission Recommendations And Their Implementation.pptxKothari Commission Recommendations And Their Implementation.pptx
Kothari Commission Recommendations And Their Implementation.pptx
JITENDRANATH GORAI
Ìý
Adrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic DrugsAdrenergic Transmission & Adrenergic Drugs
Adrenergic Transmission & Adrenergic Drugs
Dr C Vignesh
Ìý
Pests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptx
Pests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptxPests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptx
Pests of Cruciferous Crops, their Damage Symptoms and Management Practices.pptx
Deepali Shid
Ìý
Sub Task Management with odoo Project Module
Sub Task Management with odoo Project ModuleSub Task Management with odoo Project Module
Sub Task Management with odoo Project Module
Celine George
Ìý
THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...
THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...
THE NEEDS OF NORMAL CHILDREN THROUGH THE STAGES OF DEVELOPMENTAL AND PARENTAL...
PRADEEP ABOTHU
Ìý
How to Manage Reporting in Events of Odoo 18
How to Manage Reporting in Events of Odoo 18How to Manage Reporting in Events of Odoo 18
How to Manage Reporting in Events of Odoo 18
Celine George
Ìý
7. Analysing Language And Techniques copy.pdf
7. Analysing Language And Techniques copy.pdf7. Analysing Language And Techniques copy.pdf
7. Analysing Language And Techniques copy.pdf
jpinnuck
Ìý
Health and Fitness Facts and Fads -Example: Weight Loss and Fad Diets -Effe...
Health and Fitness Facts and Fads  -Example: Weight Loss and Fad Diets  -Effe...Health and Fitness Facts and Fads  -Example: Weight Loss and Fad Diets  -Effe...
Health and Fitness Facts and Fads -Example: Weight Loss and Fad Diets -Effe...
alvinlorana1
Ìý
Pharmacognosy in various systems of medicine.pptx
Pharmacognosy in various systems of medicine.pptxPharmacognosy in various systems of medicine.pptx
Pharmacognosy in various systems of medicine.pptx
Ms. Pooja Bhandare
Ìý
20250310 McGuinness Institute Submission on Gene Technology Bill.pptx
20250310 McGuinness Institute Submission on Gene Technology Bill.pptx20250310 McGuinness Institute Submission on Gene Technology Bill.pptx
20250310 McGuinness Institute Submission on Gene Technology Bill.pptx
McGuinness Institute
Ìý
7. ES: Application of Number: Percentages
7. ES: Application of Number: Percentages7. ES: Application of Number: Percentages
7. ES: Application of Number: Percentages
leigh441292
Ìý
4. ES: Application of Number: Decimal Numbers
4. ES: Application of Number: Decimal Numbers4. ES: Application of Number: Decimal Numbers
4. ES: Application of Number: Decimal Numbers
leigh441292
Ìý
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Fillable Strategies for Understanding and Supporting Neurodivergent Multiling...
Sean Fisher
Ìý
The Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom WalkerThe Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom Walker
History of Stoke Newington
Ìý
BCBR Basic Course in Biomedical Research exam notes for studying before exam...
BCBR Basic Course in Biomedical  Research exam notes for studying before exam...BCBR Basic Course in Biomedical  Research exam notes for studying before exam...
BCBR Basic Course in Biomedical Research exam notes for studying before exam...
Satish Kumar
Ìý

Sql

  • 2. SQL-Create tableCreate table table_name(column_name1 datatype, column_name2 datatype……)Eg:create table example (id int ,name varchar(10),address varchar(10))Msg:Command(s) completed successfully.
  • 3. SQL-Insert ValuesInsert into table_name(column1,column2,…..)values(values1,values2,…)Eg:insert into example (id,name,address) values(123,'xxxx','yyyyy')Msg:(1 row(s) affected)
  • 4. SQL-Select Commandselect *from exampleId name address123 xxxxyyyyy456 jjjjrrrr456 iiiinnnn567 eeeeffff
  • 5. SQL-Alter CommandAlter table table_name add or drop column_namedatatypeEg: alter table example add mobilenointMsg: Command(s) completed successfully.Id name address mobileno123 xxxxyyyyy NULL456 jjjjrrrr NULL888 iiiinnnn NULL567 eeeeffff NULL
  • 6. SQL-Update CommandUpdate table_name set column_name=new value where column_name=any valueEg: Update example set id=888 where name='iiii‘Msg: (1 row(s) affected)Id name address123 xxxxyyyyy456 jjjjrrrr888 iiiinnnn567 eeeeffff
  • 7. SQL-Delete CommandDelete table_name where conditionEg: delete example where id=888Msg: (1 row(s) affected)Id name address mobileno123 xxxxyyyyy NULL456 jjjjrrrr NULL567 eeeeffff NULL
  • 8. SQL-Drop CommandDrop table table_nameEg: drop table exampleMsg:Command(s) completed successfully.
  • 9. SQL-Primary Key & Foreign Key CREATE TABLE table_name (column1 datatype null/not null, column2 datatype null/not null,...CONSTRAINT constraint_namePRIMARY KEY (column1, column2, . column_n));CREATE TABLE table_nameÌý(column1 datatype,Ìý column2 datatype,Ìýcolumn3 datatype,ÌýÌýPrimary Key (column_any),ÌýForeign Key (Column_any) references Table_any(datatype));
  • 10. SQL-Primary Key & foreign Keycreate table example (id intprimary key,namevarchar(10),address varchar(10))AÌýprimary keyÌýis used to unique and Not Null identify each row in the table.create table example2 (salary int,expamountint, id int references example(id))A foreign keyÌýis a referential constraint between two tables.Ìý
  • 11. SQL-Primary Key & Foreign Key Id name address 123 rrrrtttt369 klkliooo456 iiiihhhh7889 wswswewwSalary expamount id10000 4235 788912369 8526 45612369 865 45665894 12589 123Example (primary Key tale)Example2 (Foreign Key tale)
  • 12. SQL-DISTINCTselect distinct address from exaddressioioklkkyuyu
  • 13. SQL-Primary Key & Foreign Key select name,address,salary from example e,example2 e2 where e.id=e2.idO/PName address salarywswsweww 10000iiiihhhh 12369iiiihhhh 12369rrrrtttt 65894
  • 14. SQL-BETWEEN & COUNTSELECT "column_name“ FROM "table_name"WHERE "column_name" BETWEEN 'value1' AND 'value2‘select id from ex where id between 100 and 500ID123456SELECT COUNT("column_name") FROM "table_name“select count(id)'No Of Records' from exNo Of Records4
  • 15. SQL-Connection Stringstring strcon = "Data Source=172.16.0.1;Initial Catalog=BatchThree;User ID=magnum;Password=Magnum";SqlConnectionsqlcon = new SqlConnection(strcon);sqlcon.Open();stringstrsql = "insert into datab values ('" + txtmarks1.Text + "','" + txtmarks2.Text + "','" + txtmarks3.Text + "','" + txtname.Text + "')";SqlCommandcmd = new SqlCommand(strsql, sqlcon);cmd.CommandType = CommandType.Text;cmd.ExecuteNonQuery();sqlcon.Close();
  • 19. SQL-Stored Procedurecreate procedure proexample(@id int,@namevarchar(10),@address varchar(10)) as insert into example(id,name,address) values (@id,@name,@address)Command(s) completed successfully.exec proexample 666,'hghg','yuyu’(1 row(s) affected)
  • 20. SQL-Stored Procedureselect *from exampleId name address123 rrrrtttt369 klkliooo456 iiiihhhh666 hghgyuyu7889 wswsweww
  • 21. SQL-JOINSSQL joinsÌýare used to query data from two or more tables, based on a relationship between certain columns in these tablesInner JoinLeft JoinRight JoinFull Join
  • 22. SQL-INNER JOINThe INNER JOIN keyword return rows when there is at least one match in both tables.SELECT column_name(s)FROM table_name1INNER JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • 23. SQL-INNER JOINselect name,address,salary from example inner join example2 on example.id=example2.id order by nameName address salaryiiiihhhh 12369iiiihhhh 12369rrrrtttt 65894Wswsweww 10000
  • 24. SQL-LEFT JOINThe LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2)SELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • 25. SQL_LEFT JOINselect name,address,salary from example left join example2 on example.id=example2.id order by nameName address salaryhghgyuyu NULLiiiihhhh 12369iiiihhhh 12369klkliooo NULLrrrrtttt 65894wswsweww 10000
  • 26. SQL-RIGHT JOINThe RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1)SELECT column_name(s)FROM table_name1RIGHT JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • 27. SQL_RIGHT JOINselect name,address,salary from example right join example2 on example.id=example2.id order by nameName address salaryiiiihhhh 12369iiiihhhh 12369rrrrtttt 65894wswsweww 10000
  • 28. SQL-FULL JOINThe FULL JOIN keyword return rows when there is a match in one of the tables.SELECT column_name(s)FROM table_name1FULL JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • 29. SQL-FULL JOINselect name,address,salary from example full join example2 on example.id=example2.id order by nameName address salaryhghgyuyu NULLiiiihhhh 12369iiiihhhh 12369klkliooo NULLrrrrtttt 65894wswsweww 10000
  • 30. SQL-VIEWviews can be considered as virtual tables and it physically stores the data. A view also has a set of definitions,and it does not physically store the data.The syntax for creating a view is as follows: CREATE VIEW "VIEW_NAME" AS "SQL Statement"
  • 31. SQL-VIEWcreate view vex as select *from exselect *from vexid name address123 pop yuyu456 huh ioioexareredrop view vex
  • 32. SQL-DISTINCTTheÌýSELECT UNIQUEÌýterm is an Oracle-only SQL statement. It is equivalent toÌýSELECT DISTINCT.ÌýSyntaX:SELECT DISTINCT "column_name"FROM "table_name“Eg: select *from exId name address123 pop yuyu456 huh ioio856 exaklkk856 exaklkk
  • 33. SQL-IN & LIKESELECT "column_name“ FROM "table_name"WHERE "column_name" IN ('value1', 'value2', ...)select name,address from ex where id in(456)name addresshuh ioioSELECT "column_name“ FROM "table_name"WHERE "column_name" LIKE {PATTERN}select name,address from ex where id like(456)name addressHuh ioio