Skip to content

Tag: database

Using column from another table in trigger

I need to use a column from another table when i use trigger before insert but i get an error Unknown table in field list Here is an example code: the column from another table is “printing_time_hr” from table “slicer” Please help, what to do, how to use the column from another table A…

Find the number of employees working under a manager

I have three tables called branch,employee and manager structured like this I want to view the id of each manager and the count of the employees he has under his supervision like this I have made this so far that shows which branch each manager works on but i don’t know how to proceed with the counting.…

Filter table to leave out specific rows

I have the table and now I want to list every ProjectName where there is no specified Leader like this: Right now I only know how to filter all ProjectNames with Leaders, but not the way to filter them the other way! Any help is appreciated 🙂 Answer One way to do it is with aggregation and the condition in

Find duplicate data in last 1 hour

I am looking for a SQL script to find the data which has more than 2 entries in last 1 hour. I have a table having user_id & event_time. I want a way to find out if the user_id has more than 1 entries in last 1 hour. I have tried below till now: Create temp table to put all