The above query will generate following screenshot: Through “Show create table” query: When we write the query as: UNIQUE (name) //college name will be in the table only once.Ĥ. Similarly, when we click on Print view for colleges table, then only two constraints will be displayed: Three Constraints have been shown for students table:įOREIGN KEY(college_id) REFERENCES colleges(id) On clicking of Print View Link, following screen will be displayed: Print View: A print View link is displayed at the bottom of table and to the left of Relation view Link as shown in Figure 3. With this approach, only foreign key constraints can be viewed of the selected table.ģ. The following screenshot will be displayed: Relation View: With Relation view link at bottom of table, for example students in our case, will display only foreign key constraints.Ĭlick on Relation view link to view foreign key constraint(s) for given table. With the above query, the output will be displayed in same form as shown in Figure 4, but records will be of given table ie. We can also view list of constraints for only single table with the following query: SELECT * FROM information_schema.table_constraints The output of above query is shown below:įrom Figure 4, we can see that two constraints viz PRIMARY and UNIQUE key constraints have been applied to table colleges and three constraints viz PRIMARY, UNIQUE and FOREIGN key constraints have been applied to students table. View applied constraints through Schema query: SELECT * FROM information_schema.table_constraints The table structure for colleges and students are shown in following screenshots:ġ. Suppose we have a database named CollegeDb having two tables colleges and students: There are various ways by which we can view the list of constraints applied to tables of given database in PhpMyadmin. How to view List of constraints of tables of Database in phpMyAdmin
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |