Skip to content

Create a database in python where user inputs the data?

I would like the program to ask the user for information (i.e. age and name) and for this information to be put into the database. I have tried the following: The error that keeps appearing is: I have Python 3.7 and I work in spyder. Answer Try this, student_name is a string and should be enclosed in single q…

SQL – Divide One Query by Another

I am trying to create a query which returns the workout percentage completion… Workout Percentage Completion = ((Sum of LogEntries WHERE date = IN list of dates and WorkoutID =1 ) / (Sum of all set numbers WHERE WorkoutID = 1)) x 100 Below is what I currently have, at the moment it is only returning the…

Pandas dataframe combine unique row values

I have a dataframe like the following with over 90000 rows. As you can see, some origin and destination values repeat for example there are multiple rows where origin=101011001, destination=101011002. My goal is to group the repeating origin and destination values and sum the the people column, so the datafra…

call value from another table when the value is not null

I want to get the value from table stage_cdl if it has value and from tale stage_vdl if it has value. Before this, I used this code (below) but I only receive the array until value 5 not include the table stage_vdl_id. The output: invoice_stud table stud_stage_cdl table stud_stage_vdl table license_cdl_module…