Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- Using Cron Job to process PHP scripts
- Install PHPMailer 5.2.4 and use smtp gmail
- Datatable export excel wraptext and newline
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- Set up a child account and set screen time limit in Windows 8
- PHP connect IBM db2 database in XAMPP
- PHP - Export Content to MS Word document
- PHP: add a download as pdf file button in report page
- Ajax autosave selection without submit button
Friday, February 21, 2014
Many to many relations in relational database design
Many to many relations are important in relational database design.
For example in publication database, one publication has many authors and one author has many publications.
In publication table: pub_id is primary key
pub_id, pub_title, jour_name, pub_date, volume, start_page, end_page, pub_date
In author table: author_id is primary key
author_id, prefix, firstnme, lastname, institute, position
Bad design 1) in publication table, add author1, author2, author3 columns.
Bad design 2) in publication table, add one author column, which requires 3,4,5 (authors are separated by comma) in input.
The good design is to create another junction or linking table, i.e.
pub_id, author_id
(both of them are not primary keys)/
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDeleteThank you for sharing this knowledge in a blogpost.Really simple and even more effective and this worked great, very useful tips
ReplyDeletesas training in hyderabad
ReplyDeletethis blog is new and informative , it is really interesting and useful too , thanks for sharing this information.
sas training in chennai