+ 1
Can i use a single query to create a table and simultaneously insert data into another different table
Example : when new user is registered . 1. A table must be created separately for that user with some columns and 2. simultaneously the userid ,usrname etc should be inserted in a general table which consists info of all registered users . if possible give some hint or example. Thanks in advance !!!
3 ответов
+ 5
Yes, if I understood what you need. Look for triggers, they are functions that literally triggers when a certain event comes up, for example a creation of a new user. At this trigger you can create a table and insert its values.
+ 1
The best is to use views .
+ 1
views at list safe guards the original data in the database to be tempered with unnecessarily as views put a restriction that won't corrupt data.