SELECT UCASE(employeename), Salary
FROM employee;
EVALUATE
SELECTCOLUMNS(
employee,
"EmployeeName_UpperCase", UPPER(employee[employeename]),
"Salary", employee[salary]
)
import pandas as pd
# Sample DataFrame
data = {
'employeename': ['John Doe', 'Jane Smith', 'Alice Brown'],
'salary': [70000, 50000, 60000]
}
df = pd.DataFrame(data)
# Convert the employeename to uppercase
df['EmployeeName_UpperCase'] = df['employeename'].str.upper()
# Select the necessary columns
result = df[['EmployeeName_UpperCase', 'salary']].values.tolist()
print(result)
| JOHN DOE | 70000 |
| JANE SMITH | 50000 |
| ALICE BROWN | 60000 |
UPPER(employee[employeename]): Converts the employeename to uppercase. SELECTCOLUMNS: Creates a new table with the columns EmployeeName_UpperCase and Salary from the employee table.
Leave a Comment