Mysql Commands
Mysql Commands
NEED OF DATABASE :
Database makes complex memory management easy to
handle .In filee systems ,files are indexed in place of objects.
It increase organizational accessibility of data which in trurn
helps the end user share data quickly and effectively.
FEATURES OF SQL –
PORTABILITY,SECURITY,CONNECTIVITY,QUERY LANGUAGE
ALTERNATE KEY : Apart from primary key other column is know as alternate
key.
EXAMPLE :
CLASSIFICATION OF SQL
SQL STATEMENT
CREATE INSERT
ALTER UPDATE
DROP DELETE
SQL COMMANDS
ADD NEW COLUMN IN THE TABLE :Alter table students add marks
decimal(25);
AGGREGATE FUNCTION
SUM :
Select sum (marks) from students;
MAX :
Select max(marks) from students;
MIN:
Select min(marks) from students;
AVERAGE:
Select avg (marks) from students;
COUNT:
Select count (marks) from students;
COUNT(*):
Select count (distinct (marks)) from students;
GROUP BY HAVING CLAUSE:
Select marks,ID from students group by marks having min(marks>67);
JOINS
Example Table:
TABLE :STUDENT