SlideShare a Scribd company logo
1 of 53
UNIT 3.3 SQL COMMANDS
INTRODUCTION :: My SQL is RDBMS that uses SQL to access
the data. It is downloaded from www.mysql.org.MySQL was
invented by Michael Widenius. The logo of My SQL is ,the
Dolphin.SQL stands for Structured Query Language. Initially SQL
was called Sequel.
MEANING :: SQL is simple query language used for accessing,
managing and handling data in relation database.
CLASSIFICATION OF SQL STATEMENTS :: SQL commands
can be divided into following categories.
1. Data Definition Language(DDL)
2. Data Manipulation Language(DML)
3. Data Control Language(DCL)
4. Transaction Control Language(TCL)
Data Definition language(DDL) :: (Defines storage structure.)
 Create
 Alter
 Drop
 Truncate
Data Manipulation Language(DML):: (Used to access and
manipulate data.)
 Select
 Insert
 Update
 Delete
Data Control Language(DCL)::
 Grant
 Revoke
Transaction Control Language(TCL)::
 Commit
 Rollback
 Savepoint
DATA DICTIONARY:: Data Dictionary contains data about
database. Data Dictionary contains information about tables. It
contains result of compilation of DDL statements.
Metadata means data about data.
Concept of Data type:: Data types indicate the type of value
the field will contain.
String, Character and date must always be enclosed in
single quotes/double quotes.
Difference between Char and Varchar :: Char refers to
Character and Varchar refers to Variable Character.
Char(7) – It always take 7 bytes of data whether you are
storing one character or 7 character. There is wastage of
space. Char is fixed length data type.
Varchar(10) – If you are storing one character then it will take
only one byte and if you are storing ten character then it will
take ten bytes. There is no wastage of space. Extra space is
automatically removed. Varchar is variable length data type.
Null Values :: If a column has no value then column is said to
be null. If column is assign as primary key then it must not
Null.
Comments :: Comments used in SQL are
/* text */ (for multiple lines)
# (for single lines)
-- (for single lines) and must be followed by a space
SQL Command Syntax ::
Keyword(select , insert…….)
Statements
Clauses(from , where)
Argument(where sales=5000) sales=5000 is an argument.
Grouping Result : Group by clause :: Group by clause
is used to divide the table into groups.
Table::emp
select job , count(*) , sum(comm)
from emp
group by job;
emp no empname Job hiredate sal comm deptno
7839 King President 17-Nov-81 5000 NULL
7698 Blake Manager 01-May-81 2850 80
7782 Clark Manager 09-June-81 2800 NULL
7566 Jones Manager 12-Apr-81 2450 21
7564 Martin Salesman 28-Sep-81 1250 1400 30
7499 Allen Salesman 20-Sep-81 1600 300 30
job count(*) sum(comm)
President 1 0
Manager 3 0
Salesman 2 1700
Placing condition on groups – having clause
select grade , avg(gross) , sum(gross)
from employee
group by grade
having grade=‘E2’;
grade avg(gross) sum(gross)
E2 8500 17000
Select job , count(*)
from emp
group by job
having count(*)<3;
Functions used in SQL ::
Avg :: Compute average value
Min :: Find minimum value
Max :: Find maximum value
job count(*)
Presidnt 1
Salesman 2
Sum :: Find total value
Count :: to count NOT NULL values in a column
Count(*) :: to count total number of rows in a table
Joins:: A join is a query that combines rows from two
or more tables. In a join query , more than one table
are listed in from clause.
View Command ::
View is a Virtual table with no data. If data is changing in
underlying table, the same change is reflect in view.
create view taxpayee as
select * from employee
where gross>8000;
taxpayee is a view(virtual table) that contain details of those
employees from employee table that have gross > 8000
Select * from taxpayee;
This query dislays all rows present in view.
If any column in the view is to be given a different name
other than the name of the column from which it is delivered,
it is done as follows.
create view taxpayee
(empcode, empname, sex, empgrade, empgross) as
select * from employee
where gross > 8000;
create view taxpayee(ecode,ename,tax) as
select ecode,ename,gross*.1
from employee
Where gross > 8000;
The above created view has an additional column tax
which is 10% of the gross
You can use insert , delete , update command on view
Assignment – 5
Consider the following tables games and players and answer (a) and (b) part of this
question.
TABLE :: Games
TABLE :: Players
Gcode Gname Type Number PrizeMoney Scheduled date
101 Carrom Board Indoor 2 5000 23-Jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 1-Jan-2004
108 Lawn Tennis Outdoor 4 25000 19-Mar-2004
Pcode Name Gcod
e
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazreen 103
(a) Write SQL commands for the following statement
(i) To display the name of all Games with their Gcode.
(ii) To display details of those Games which are having PrizeMoney
more than 7000
(iii) To display the content of the Games table in ascending order of
Schedule date
(iv) To display sum of PrizeMoney for each type of Games.
(b) Give the output of the following SQL Queries
(i) Select count(distinct Number) from Games;
(ii) Select max(Schedule date), min(Schedule date);
(iii) Select Name Gname from Game G Players P
Where G.Gcode=P.Gcode and G.PrizeMoney>10000;
(iv) Select distinct Gcode from Players;
Assignment - 7
SQL (1).pptx

More Related Content

Similar to SQL (1).pptx

SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxBhupendraShahi6
 
IBM Informix dynamic server 11 10 Cheetah Sql Features
IBM Informix dynamic server 11 10 Cheetah Sql FeaturesIBM Informix dynamic server 11 10 Cheetah Sql Features
IBM Informix dynamic server 11 10 Cheetah Sql FeaturesKeshav Murthy
 
Sq lite functions
Sq lite functionsSq lite functions
Sq lite functionspunu_82
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql newSANTOSH RATH
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Finalmukesh24pandey
 
Mysqlppt
MysqlpptMysqlppt
MysqlpptReka
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfpradnyamulay
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016Mir Mahmood
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersBRIJESH KUMAR
 
Module 02 teradata basics
Module 02 teradata basicsModule 02 teradata basics
Module 02 teradata basicsMd. Noor Alam
 

Similar to SQL (1).pptx (20)

Sql 2006
Sql 2006Sql 2006
Sql 2006
 
lect 2.pptx
lect 2.pptxlect 2.pptx
lect 2.pptx
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
 
IBM Informix dynamic server 11 10 Cheetah Sql Features
IBM Informix dynamic server 11 10 Cheetah Sql FeaturesIBM Informix dynamic server 11 10 Cheetah Sql Features
IBM Informix dynamic server 11 10 Cheetah Sql Features
 
Oracle notes
Oracle notesOracle notes
Oracle notes
 
Sq lite functions
Sq lite functionsSq lite functions
Sq lite functions
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Final
 
Lab
LabLab
Lab
 
Les09
Les09Les09
Les09
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for Developers
 
Module 02 teradata basics
Module 02 teradata basicsModule 02 teradata basics
Module 02 teradata basics
 
Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
Dbms
DbmsDbms
Dbms
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 

SQL (1).pptx

  • 1. UNIT 3.3 SQL COMMANDS INTRODUCTION :: My SQL is RDBMS that uses SQL to access the data. It is downloaded from www.mysql.org.MySQL was invented by Michael Widenius. The logo of My SQL is ,the Dolphin.SQL stands for Structured Query Language. Initially SQL was called Sequel. MEANING :: SQL is simple query language used for accessing, managing and handling data in relation database. CLASSIFICATION OF SQL STATEMENTS :: SQL commands can be divided into following categories. 1. Data Definition Language(DDL) 2. Data Manipulation Language(DML)
  • 2. 3. Data Control Language(DCL) 4. Transaction Control Language(TCL) Data Definition language(DDL) :: (Defines storage structure.)  Create  Alter  Drop  Truncate Data Manipulation Language(DML):: (Used to access and manipulate data.)  Select  Insert  Update  Delete
  • 3. Data Control Language(DCL)::  Grant  Revoke Transaction Control Language(TCL)::  Commit  Rollback  Savepoint DATA DICTIONARY:: Data Dictionary contains data about database. Data Dictionary contains information about tables. It contains result of compilation of DDL statements. Metadata means data about data. Concept of Data type:: Data types indicate the type of value the field will contain.
  • 4.
  • 5. String, Character and date must always be enclosed in single quotes/double quotes. Difference between Char and Varchar :: Char refers to Character and Varchar refers to Variable Character. Char(7) – It always take 7 bytes of data whether you are storing one character or 7 character. There is wastage of space. Char is fixed length data type. Varchar(10) – If you are storing one character then it will take only one byte and if you are storing ten character then it will take ten bytes. There is no wastage of space. Extra space is automatically removed. Varchar is variable length data type.
  • 6. Null Values :: If a column has no value then column is said to be null. If column is assign as primary key then it must not Null. Comments :: Comments used in SQL are /* text */ (for multiple lines) # (for single lines) -- (for single lines) and must be followed by a space SQL Command Syntax :: Keyword(select , insert…….) Statements Clauses(from , where) Argument(where sales=5000) sales=5000 is an argument.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Grouping Result : Group by clause :: Group by clause is used to divide the table into groups. Table::emp select job , count(*) , sum(comm) from emp group by job; emp no empname Job hiredate sal comm deptno 7839 King President 17-Nov-81 5000 NULL 7698 Blake Manager 01-May-81 2850 80 7782 Clark Manager 09-June-81 2800 NULL 7566 Jones Manager 12-Apr-81 2450 21 7564 Martin Salesman 28-Sep-81 1250 1400 30 7499 Allen Salesman 20-Sep-81 1600 300 30
  • 35. job count(*) sum(comm) President 1 0 Manager 3 0 Salesman 2 1700 Placing condition on groups – having clause select grade , avg(gross) , sum(gross) from employee group by grade having grade=‘E2’; grade avg(gross) sum(gross) E2 8500 17000
  • 36. Select job , count(*) from emp group by job having count(*)<3; Functions used in SQL :: Avg :: Compute average value Min :: Find minimum value Max :: Find maximum value job count(*) Presidnt 1 Salesman 2
  • 37. Sum :: Find total value Count :: to count NOT NULL values in a column Count(*) :: to count total number of rows in a table Joins:: A join is a query that combines rows from two or more tables. In a join query , more than one table are listed in from clause.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. View Command :: View is a Virtual table with no data. If data is changing in underlying table, the same change is reflect in view. create view taxpayee as select * from employee where gross>8000; taxpayee is a view(virtual table) that contain details of those employees from employee table that have gross > 8000 Select * from taxpayee; This query dislays all rows present in view.
  • 48. If any column in the view is to be given a different name other than the name of the column from which it is delivered, it is done as follows. create view taxpayee (empcode, empname, sex, empgrade, empgross) as select * from employee where gross > 8000; create view taxpayee(ecode,ename,tax) as select ecode,ename,gross*.1 from employee Where gross > 8000;
  • 49. The above created view has an additional column tax which is 10% of the gross You can use insert , delete , update command on view
  • 50. Assignment – 5 Consider the following tables games and players and answer (a) and (b) part of this question. TABLE :: Games TABLE :: Players Gcode Gname Type Number PrizeMoney Scheduled date 101 Carrom Board Indoor 2 5000 23-Jan-2004 102 Badminton Outdoor 2 12000 12-Dec-2003 103 Table Tennis Indoor 4 8000 14-Feb-2004 105 Chess Indoor 2 9000 1-Jan-2004 108 Lawn Tennis Outdoor 4 25000 19-Mar-2004 Pcode Name Gcod e 1 Nabi Ahmad 101 2 Ravi Sahai 108 3 Jatin 101 4 Nazreen 103
  • 51. (a) Write SQL commands for the following statement (i) To display the name of all Games with their Gcode. (ii) To display details of those Games which are having PrizeMoney more than 7000 (iii) To display the content of the Games table in ascending order of Schedule date (iv) To display sum of PrizeMoney for each type of Games. (b) Give the output of the following SQL Queries (i) Select count(distinct Number) from Games; (ii) Select max(Schedule date), min(Schedule date); (iii) Select Name Gname from Game G Players P Where G.Gcode=P.Gcode and G.PrizeMoney>10000; (iv) Select distinct Gcode from Players;