Skip to content

Tag: oracle

‘SET’ must be a type

I created the following types : A person can have a set of PhoneNumbers, when I try to create the Type Person : I get the following error : Errors: TYPE PERSON Line/Col: 0/0 PL/SQL: Compilation unit analysis terminated Line/Col: 1/90 PLS-00488: ‘SET’ must be a type Answer If you want an array of p…

How to get list of cars with a specific ID of wheel?

I have the following code snippet : I want to get the Voitures having number of Roue = 554 : What is the difference of using the table in the EXISTS subquery directly in the WHERE clause? Answer The right way to write your first query would be: This query, written this way, is doubtfully usefull, because it s…

Foreign key as primary key?

I currently have 2 tables STUDENTS and SUBJECTS. I need to create another table for ENROLLMENTS, the thing is that in that table I need to know the minimal attendance, which is both dependent on …

joining temporal tables in oracle

I am looking for better solutions to a fairly generic problem with temporal tables. say we have table_a (some_value int, date_from date, date_to date) and a series of similar tables table_b, table_c, …

SQL timestamp filtering based only on time

I want to create a query in Oracle SQL that will grab records from a given time interval, during certain hours of the day, e.g. records between 10am to noon, in the past 10 days. I tried this, but it does not work: where timestamp is of type TIMESTAMP. I have also thought of using a join, but I am