I am very new to the database and queries. I am not sure if this is very basic. Please help me to find a solution. I have two tables – subscription and customer with primary keys as subscription_id and customer_id respectively. the customer_id is foreign key pointing to customer table customer_id column. Below is a sample of table and its
Tag: database
How to list out management levels from Postgres table
I have a table with the following fields: Id, manager_id, and candidate_name The manager_id will point at id which allows me to reference the management chain. I want to generate an output like the …
SQL iterate UPDATE from python list
Do you guys know how to UPDATE a database from a python list without using cur.executemany? Using cur.executemany I have problems in API calls or something. What is another way to solve this below? Thank you! I know below is crazy ugly, but I did that. Answer Not an answer but I don’t want to edit your code as I
SQL trigger doesn’t allow to update
I have trigger trig_1 on racun table. I have some columns in racun table and i created trigger to don’t allow to update column iznos, but when i try to update another column in the same table, trigger doesn’t allow to do that. I tryed to delete and create trig_1 but nothing happend. I created that trigger in SQL 17
ORA-06553: PLS-801:Internal Error [55018]
I want to make a function call like SELECT URUN_GETIR(‘test1’) FROM DUAL; but i got ORA-06553: PLS-801: Internal Error [55018]. I tried ORA-06553: PLS-801: internal error [55018] when testing function returning ROWTYPE this like for ex URUN_GETIR(‘test1’).KULUSERNAME but getting same error. It didn’t work for me.Thanks in advance. My db table : My plsql function code : Answer You can
Making sense of database table references with foreign and primary keys
I am relatively new to database logic, and am trying to figure out how multiple tables should/shouldn’t reference each other. I have a table, ‘Book’, that should have columns: I want each book to have the possibility to have 1 or more genres. I want each book to have the possibility to have 1 or more authors. I want each
Insert additional text into table fields
I export a CSV-File with shipping weights from my webshop. The problem is there are bulk numbers and no unit Like this: +——+——+ | ID |weight| +——+——+ | 101 | 1,2 | +——+——+ …
What cause SQL syntax error in creating table in database
When creating a table in mysql query I get the error as below. I could not understand what is causing this error. The query is as below. Answer You appear to be using Java types in your create table statement. Try using proper MySQL types and it should work:
Django Sql ERROR 1064 when accessing table
I cannot access one of the tables in my database. I can’t even delete the table by myself, so I am not sure what to do. Here is the error: ERROR 1064 (42000): You have an error in your SQL syntax; …
Data Type for Lists
I’m creating a table and one of the requirements is that the only option that can be entered are QLD, NSW, VIC, SA, WA, NT and ACT (Australian states). What is this datatype and how is written in SQL, …