dbms_file
dbms_file
OUTPUT:-
OUTPUT:-
1
Q 3. List the names in capital of the male teachers who are in
Science or commerce.
Department in the descending order of their salary.
OUTPUT:-
OUTPUT:-
2
Q 5. Increase the salary of all those teachers who have joined
before 10-jan-2018 by 20%.
Update teacher set salary = salary * 1.20 where Date_of_join < ‘2018-01-
12’;
OUTPUT:-
OUTPUT:-
Select Dept from teacher group by Dept having sum(salary) > 500000.
3
OUTPUT:-
OUTPUT:-
4
OUTPUT:-
Q 12. Display the highest and lowest salary value for each
department.
OUTPUT:-
OUTPUT:-
5
Q 14. Display those department names where the maximum
bonus given is more than 20000.
OUTPUT:-
OUTPUT:-
OUTPUT:-
6
Q 17. Display the name of teachers who have joined in the
month of January, April and July.
OUTPUT:-
OUTPUT:-
PART-B
7
OUTPUT:-
OUTPUT:-
OUTPUT:-
8
OUTPUT:-
OUTPUT:-
OUTPUT:-
9
PART-C
OUTPUT:-
OUTPUT:-
10
B) Table of orders
OUTPUT:-
OUTPUT:-
OUTPUT:-
11
Q 29. join these two tables using ‘FULL JOIN’.
OUTPUT:-
OUTPUT:-
12
Q31 . join these two tables using ‘RIGHT OUTER JOIN’.
OUTPUT:-
OUTPUT:-
13
Q33 . MYSQL C PROGRAM SQL VERSION.
#include <mysql.h>
#include <stdio.h>
#include <stdlib.h>
exit(0);
OUTPUT:-
14
#include<stdlib.h>
if (con == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
exit(1);
}
mysql_close(con);
exit(0);
OUTPUT:-
15
Q35. MYSQL C PROGRAM CREATE AND POPULATE TABLE.
#include <mysql.h>
#include <stdio.h>
#include <stdlib.h>
if (con == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
exit(1);
}
16
}
17
if (mysql_query(con, "INSERT INTO cars VALUES(7,'Hummer',41400)"))
{
finish_with_error(con);
}
mysql_close(con);
exit(0);
}
OUTPUT:-
#include <mysql.h>
#include <stdio.h>
18
#include <stdlib.h>
if (con == NULL)
{
fprintf(stderr, "mysql_init() failed\n");
exit(1);
}
if (result == NULL)
{
finish_with_error(con);
}
19
int num_fields = mysql_num_fields(result);
MYSQL_ROW row;
printf("\n");
}
mysql_free_result(result);
mysql_close(con);
exit(0);
}
OUTPUT:-
20
#include <mysql.h>
#include <stdio.h>
#include <stdlib.h>
if (con == NULL)
{
fprintf(stderr, "mysql_init() failed\n");
exit(1);
}
if (mysql_query(con, sql))
{
21
finish_with_error(con);
}
int id = mysql_insert_id(con);
mysql_close(con);
exit(0);
}
OUTPUT:-
22
Q38. MYSQL C PROGRAM COLUMNS HEADERS
#include <mysql.h>
#include <stdio.h>
#include <stdlib.h>
if (con == NULL)
{
fprintf(stderr, "mysql_init() failed\n");
exit(1);
}
if (result == NULL)
23
{
finish_with_error(con);
}
MYSQL_ROW row;
MYSQL_FIELD* field;
printf("\n");
}
printf("\n");
mysql_free_result(result);
mysql_close(con);
exit(0);
}
OUTPUT:-
24
25