Question

Change table structure (add,edit,remove column of a table)at runtime

i. Add a column address in the EMP_SELECTION table.
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.

13 Sep 2024
Answer :
Word Count : 942

### Managing Table Structure and Data Operations in SQL and Python/C Lab

1. Changing Table Structure at Runtime

In SQL, changing the structure of a table, such as adding, editing, or removing columns, is typically done using `ALTER TABLE` statements. Below is how you can manage these operations.

#### i. Add a Column to the Table

To add a new column named `address` to the existing `EMP_SELECTION` table, use the following SQL statement:

```sql
ALTER TABLE EMP_SELECTION
ADD COLUMN address VARCHAR(255);
```

In this statement:
- `ALTER TABLE EMP_SELECTION`: Specifies the table to modify.
- `ADD COLUMN address VARCHAR(255)`: Adds a new column named `address` with a data type of `VARCHAR` and a maximum length of 255 characters.

#### ii. Execute SQL INSERT Statement to Create a Record

To insert a new record into the `EMP_SELECTION` table, use the `INSERT INTO` statement. For example, if you want to add a record with specific values, the SQL statement might look like this:

```sql
INSERT INTO EMP_SELECTION (id, name, gender, age, address)
VALUES (1, 'John Doe', 'M', 30, '123 Elm Street');
```

In this statement:
- `INSERT INTO EMP_SELECTION (id, name, gender, age, address)`: Specifies the table and columns where the new data will be inserted.
- `VALUES (1, 'John Doe', 'M', 30, '123 Elm Street')`: Provides the values for each column in the specified order.

#### _________ ___ ___ _______ ____ ____.
__________ _____ __________ _________ __________.
__________ ___ ____ ________ ______.
_______ __________ _________ ________ _________ _____ _____ ____ ________ __________.
___ _______ ___ ________ _____ _____ ______ ___.
________ ______ _________ ______ ______ ___ _________ _____ ___ _______ ________ _______.
______ _____ ____ _______ ______ _____ __________ _____ ________ _________ ______ ____.
____ __________ ________ __________ ________ __________ _________ _______ __________.
____ __________ ________ _____ ________ ________ ______ _____ _________ _________.
_______ _________ ________ ____ _________ __________ _____.
__________ _____ _________ _____ __________ ____ _________ __________.
_______ ______ ________ ________ _____ _________ ________ ___ _________ ____.
_____ ___ ________ ______ _____ ___ __________ ________ ________.
_____ ____ ____ ____ ___ ___ __________ _____ _______ __________ ______.
_________ __________ ________ _______ ________ ___ ___ _____ ___.
______ _______ _________ _________ __________ ______ ________ ____ ____.
_____ __________ _____ _______ __________ ____ ______.
_____ _________ _____ ____ ___ ____ __________ __________ __________ _____ ________.
______ ________ _____ __________ __________ _____ _____ ______ ________ ____.
__________ _________ _____ ________ _____.
___ ______ _______ ________ ______.
____ ___ ___ _________ ________ ____.
_________ _________ ___ ___ _________ ____ _________ __________ __________ ____.
_________ ______ ______ ______ ______.
_______ _____ __________ ________ __________.
_____ _______ _________ _________ __________ ____ _______.
__________ _______ __________ ______ _______.
___ ______ ________ __________ _________ _______ _______ ____.
_________ ________ _____ ____ __________ _______ __________ ___ _________ ____ ____.
_____ _________ ________ ______ __________.
___ ______ ___ _________ _________ _____ _______ _____ _____ _____ _____.
__________ _____ _________ _______ _____ ________ ___ ________ _________ ____ __________ ________.
___ ___ ____ ___ ________ ____ _____ ________ ______ _____.
________ __________ __________ _______ ______ ____.
_______ ________ ___ _______ ___ _____ __________ _____ _______ ______ ________.
_____ ________ ____ _______ ________ _____ __________.
______ _____ __________ ____ ___ ___ _________ ____ __________ ___ ______.
___ ____ ______ ___ ____ ____ _______.
_____ __________ ______ ____ __________.
_______ ________ _____ ______ ____ __________.
______ _______ ________ _____ _______ _______ ______ ________.
______ _______ ___ _____ ________ ____.
_____ ______ ______ ___ ____ ________ _________ ________.
_________ ___ ____ __________ ____ ______.
_______ ______ _____ __________ ___ ____ _________ _____ _________ _____ ________.
__________ ___ _____ ______ ____ _____ ________ _______ _________ __________ _____ __________.
_______ __________ _________ _____ _____ __________ __________ ________.
_______ ________ ___ ____ __________.
__________ _________ _______ ________ _________ ______ ______ _________ ________ ______.
__________ _______ ______ __________ _________ ___ _____ _____ ________ ________ _________ ________.
___ _______ _________ _____ ______.
___ ________ ______ _______ _________ ________.
_______ _______ _________ ________ _____ _______.
__________ ________ ______ ______ _______ ________ __________ ____ ______ ___.
___ ___ ______ _________ _______ _______ ___ _______ ________ __________.
________ __________ ________ ___ _____ __________ _______ ____ _____ ___.
________ ____ ____ ________ ________ _______ _____.
_________ ________ _________ ____ _________ ________ ________.
___ _______ ________ _________ __________ ____ ____ ______ ____ ___ _____ __________.
_________ ____ ____ ____ _________ ___ ________ _________.
_____ __________ _______ ____ ____ _____ _______ ______ _______ ______ _______.
___ __________ _______ __________ __________ _____ _____.
____ ________ ________ ______ ________ ___ ______ ___ ____ __________ ___.
____ _________ ___ ______ _________ ______.
________ ______ ________ _________ _____ _____ ______ _______ _________ ______ ____.
_________ _________ ___ ________ _________.
_________ ________ ___ _______ _______ _______ _____ ______ __________.
__________ _______ _____ _____ ________ ________ _____ ____ ____ ______ ____ __________.
___ _______ ______ _____ ___ _____ _________ ____.
__________ ______ _______ ___ __________.
________ ___ ___ _____ ________.
____ ________ ______ ____ ____.
________ ____ ____ _____ ____ _______ _________.
_____ _________ __________ _______ _________.
__________ _________ ____ _______ _________.
__________ _________ __________ __________ _________ _____ ________ __________.
__________ __________ _______ ___ _____ ___ ________ ________ ______ ______ ________.
________ __________ __________ __________ _____ _____.
_______ ______ _____ ______ ___ _________ ______ __________ ______ _____ ____ _____.
_____ _______ _________ _________ _____ _______ _________ ___ ________ __________ ____ ________.
_____ ___ ____ _____ _______ __________ __________ ___.
___ _____ _____ ______ ____ _______ _____ _____ _______.
__________ ________ ______ _______ _____ __________ _____ _________ ____ ______ __________.
________ ______ __________ _________ __________.
__________ ____ ____ _______ _______ _____ _____ _________ _____.
____ _________ __________ ______ _____ _______ _______ ____ _______ ___ ________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Change table structure (add,edit,remove column of a table)at runtime
🟢
WhatsApp Chat Fast live messaging
Email Us Business enquiries & support