sql commands
sql commands
1: To create the given table and name as stu1 and insert values:
mysql> create table stu1(sno int, name varchar(20), stipend int, stream
varchar(30), avgmarks float(5,2), grade char(1), class varchar(5));
mysql> insert into stu1 values(1, ‘karan’ ,400, ‘medical’, 78.5, ‘B’, ‘12B’);
(adding some more values into this table, let the table be as shown below)
2: To display name and avgmarks in descending order:
mysql> select name, avgmarks from stu1 order by avgmarks desc;
Query:
10.Having clause:
Query: