Skip to content
Advertisement

Tag: triggers

What’s wrong with this PL/SQL Trigger?

I have this table, and I want to create a trigger on Magazine, that verifies “after insert” if the name of the Magazine inserted is either Vogue or People. If it’s not one of them, it gets deleted. Table: MAGAZINE (ISBN, MAG_NOM, PRIX_Mois); My trigger: But the problem is my teacher told me: This is not suitable for every situation

Validation trigger not working in SQL Server

I am working on a trigger for a class project. I have a table named salesman with a column named type. All employees in the table currently have a type of full, part or temp. The purpose of the trigger is to check a newly inserted row’s type and make sure that it matches one of the three that already

Limit number of occurrences of value in a table oracle sql

I have oracle sql table of students, students are assigned to groups. I have to set constraint so there will be no more than 10 students in a group (ideally no more than N students in a group). Basically restrict table from having more than N rows with the same GROUP_ID value. Here is table declaration. I’ve tried to use

Trigger for INSERT to validate input data in SQL Server?

My problem: table dbo.student has StudentID like SV001. How can I create a trigger to check data inserted into dbo.student has a StudentID that begins with SV and the numbers in the range 000 to 100? Example: SV099 is valid id to insert, while SV101 is not valid Answer Use SQL constraints: Example : Demo in db<>fiddle Or if you

How to insert result of select query (with default if return no rows) as part of Postgres Function?

For my Nextjs website, I am configuring the backend to automatically add user information to a public.profiles table whenever a row is inserted into the auth.users table (automatically done through Supabase’s authentication). I have a public.college_emails table that contains the names of over 1700 colleges and the email tag associated with them. When a user creates an account with their

Advertisement