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) {
_________ ________ ________ ___ __________ ______ __________ ___ __________ _____.
_________ __________ ________ ________ _______.
____ __________ __________ _______ ______ ______ ______ ____ ______ ___ _____.
_____ _________ ____ ____ ________ _____ _______ __________ ______ ___ ________.
______ _______ ________ ___ ___ ______ ___ _______ _________ _________ _________.
_____ _____ __________ _____ _________ ____ ____ _________ ________ __________ __________.
_____ _______ ___ ____ _____ ___ ____ ___ _________.
____ _________ ________ ______ _________ _______ ________ ____ __________ ___.
______ ________ _________ _________ ___ ______ ________ _______ __________ __________ ___ ____.
_______ ___ _________ ________ ______ ____ ______ ______ __________ _________.
_____ ___ ______ ______ ____ ____ ______ ______.
__________ _______ _____ __________ __________ ___ __________ _________ ________ ________ _____ __________.
_____ __________ __________ __________ _____ _____ ____ ___ ______.
_______ ____ ________ ________ ______ _______ ______ ______ __________ __________.
____ _______ ______ ______ _________ _________ _________ _____ ___ _______ ________ ___.
____ _______ _____ __________ ______ __________ ______ ______ ___.
___ ______ ________ ________ _______ _____ _____.
_____ ____ _________ _____ _________ __________.
_____ ______ _____ ________ _____ _____ __________ __________ ____ _________.
_________ _______ _____ _______ _______ __________ ___ ______.
____ _____ _______ _____ _______ ________ ______ _____ _______ __________ _______.
____ _______ _________ ________ ___ ______ _______ _________ ______ ____.
________ _____ ________ _____ _____ ___ _________ ___ _______ _________.
__________ _____ ____ _______ ____ ___.
________ ____ ____ ______ ____ _______.
_____ ______ _____ _________ ________ _____ ________.
________ __________ ___ __________ ___ _____ ___ ______ ________ _______ _________.
__________ ____ _________ _______ ________ _______ _________ _______ _____.
_____ ________ ___ ___ ___.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required