Order by increasing CGPA:
If we want to sort our data in ascending or descending
order according to a particular column then Order by statement we can use in
SQL. We can use the keyword DSC to sort in descending and ASC to sort in
ascending order.Here in our project we sort in ascending order using keyword ASC with a particular
column of CGPA from our created table.
Code:
cout<<”order
by inc order of CGPA”;
query=”SELECT
*FROM STUDENT ORDER BY CGPA ASC; ”;
/*execute
sql statement*/ rc=sqlite3_exec(DB,query.c_str(),callback,NULL,&messageError);
if(rc!=SQLITE_OK
{
fprintf(stderr,”SQL
error:%s\n”),messageError); sqlite3_free(messageError);
else
{
fprintf(stdout,”operation
successful”);
}
Output:
Group names by CGPA:
The group by statement groups the rows that have the
same values into summary rows.in our project we group the names according to
CGPA at output we get name and CGPA of that particular student.
Code:
cout<<”\n
Group by CGPA\n”;
query=”SELECT
NAME,SUM(CGPA) FROM STUDENT GROUP BY NAME;”;
rc=sqlite3_exec(DB,query.c_str(),callback,NULL,&messageError);
if(rc!=SQLITE_OK
{
fprintf(stderr,”SQL
error:%s\n”),messageError); sqlite3_free(messageError);
else
{
fprintf(stdout,”operation
successful”);
}
Output:
Applications:
The project finds the application for managing the large database
like Employee records,Student records,Library management system etc.
In our project we have performed various functions of
SQL like create a table,delete,insert,sort,search,modify and group by using
C++.And came to know how large data can be easily managed by SQL functions.
Amarja Chede
K10
With this we conclude our Blog series!
You can find all documents related to our Course Project in the links given below.
CP Title : SQL functionalitiy in OOP C++
Description:
Implementation of the following SQL functions in OOP C++ on a database of Student Information
1.Insert Record
2.Delete Record
3.Search Record
4.Modify Record
5.Group by
6.Order by
Video Link: https://drive.google.com/open?id=1CgJZZls-NsPPzJ2m2v3QNP2kJNWm4uvJ
Topic2
Rishita Jaiswal
TY K
Roll No:28
Gr No:1710413
Video Link: https://drive.google.com/open?id=1-nZI5yj_qLy73lTl9KLbgKkK8tHZ95gD
Topic3
Diksha Avhad
TY K
Roll No:3
Gr.No:182058
Video Link: https://drive.google.com/open?id=1fGWsvXYLHGc77-URXjjNPvgGtPlen1Td
Topic4
Amarja Chede
TY K
Roll no:10
Gr.No:182072
Thank you!With this we conclude our Blog series!
You can find all documents related to our Course Project in the links given below.
CP Title : SQL functionalitiy in OOP C++
Description:
Implementation of the following SQL functions in OOP C++ on a database of Student Information
1.Insert Record
2.Delete Record
3.Search Record
4.Modify Record
5.Group by
6.Order by
Topic1
Smruti Khire
TY K
Roll no:38
Gr No: 1710206Video Link: https://drive.google.com/open?id=1CgJZZls-NsPPzJ2m2v3QNP2kJNWm4uvJ
Topic2
Rishita Jaiswal
TY K
Roll No:28
Gr No:1710413
Video Link: https://drive.google.com/open?id=1-nZI5yj_qLy73lTl9KLbgKkK8tHZ95gD
Topic3
Diksha Avhad
TY K
Roll No:3
Gr.No:182058
Video Link: https://drive.google.com/open?id=1fGWsvXYLHGc77-URXjjNPvgGtPlen1Td
Topic4
Amarja Chede
TY K
Roll no:10
Gr.No:182072










