I) Write Program to perform following tasks
a. Create a database SELECTION_DB
b. Set connection with mysql.connector.connect.
c. Create a table EMP_SELECTION in database SELECTION_DB with following data FIRST_NAME,LAST_NAME,AGE,GENDER,INCOME.
d. Change table structure (add,edit,remove column of a table)at runtime
ii. Execute SQL INSERT statement to create a record into EMP_SELECTION table
iii. run the query to updates all the records having GENDER as 'M', and increase AGE of all the males by one year.
iv. Delete all the records from EMP_SELECTION Table where AGE is less than 18.
II) Write a python code to read a dataset (may be CSV file) and print all features i.e. columns of the dataset. Determine the descriptive statistics i.e. Maximum, Minimum Mean Median, Count, Variance, Standard Deviation etc. of the numeric features like age, salary etc., maybe present in the dataset.
Sure, let's break down your question and address each part individually.
### I) C Program to Perform Database Operations:
```c
#include <stdio.h>
#include <stdlib.h>
#include <mysql/mysql.h>
void execute_query(MYSQL *conn, char *query) {
if (mysql_query(conn, query)) {
fprintf(stderr, "Error: %s\n", mysql_error(conn));
mysql_close(conn);
exit(1);
}
}
int main() {
MYSQL *conn;
conn = mysql_init(NULL);
if (conn == NULL) {
_____ _______ __________ ______ _________ _________ _______.
________ ___ ________ ___ _________ ___ _________ _______ ______ ___.
______ ______ ___ ______ ________.
________ ___ __________ ____ ___ _________ ___ ___.
__________ ___ _____ ___ __________ _____.
_________ ________ ______ ________ ________ _________ _________.
________ ________ ____ ______ __________ _________ __________.
____ ______ ________ ____ _______.
_________ __________ ___ _____ ______ ___ _________ ________ _______ ____ _____ ______.
___ ___ __________ ____ ________ ___.
__________ ______ __________ __________ ___ ____ ______ _____ _______ ________.
_______ __________ _________ ______ __________ _________ ___ ________ _____ ____ _____.
_____ _________ ______ ______ __________ __________ _________ ____ _______ _________.
________ _______ _________ ________ _______ ____ ________ ________.
______ _______ _________ ___ ________.
_____ ___ _________ ____ ________ _______ ______ _______ __________ ________ ____.
_________ ____ ______ ______ _______ ________ ________ _____ _______ ________.
____ _____ _______ ______ __________ _____ _________ _________ ___ ___ ______ _______.
____ ______ __________ ____ ___ ________ ______ ____ ______.
_________ _____ _________ ______ _____ ___ _____ ___ ___ _________ ______.
____ ____ _______ _____ ____ _________ ________ _______ ___ ______ ________.
________ ____ ______ ________ _____ ________ __________ __________ _____ _________.
____ ________ ____ ____ _______ _______ _____ ___ ________ __________ ______.
_____ _______ _________ _______ ___ ____ ___ ___.
_________ ______ _____ _____ __________ _______ ___ _________ __________ ____ _____.
_______ ________ _________ ________ __________ __________ ____ __________ ______ ________.
____ __________ ____ _______ _____ ___ ______ ______ ___ ___.
_______ ________ _____ _____ ______ __________.
_______ ______ _____ ___ ______ ________ ______.
________ __________ __________ __________ ________ ___ _________ ______ _____ ______ _______ _________.
___ __________ _________ ______ __________.
___ _____ __________ ____ _______ _____.
Get Full Answer on WhatsApp