It is currently 21 Feb 2018, 07:18

Anything GoesI didnt think you can do this in MySQL (Showcase | Slideshow)

Anything, almost anything at all
(even advertisement if it's decent, spammers will be banned)
Post Reply
User avatar
trandoductin

Forum Member
View: Showcase | Slideshow
Topic Posts: 1/1
Posts: 189
Joined: 26 Sep 2016, 00:21
Cash on hand: 317.58 GLP
Gender: Guy
Location: Canada
Website: https://gimplearn.net
x 7
Contact:
Canada

I didnt think you can do this in MySQL

Post#1 by trandoductin » 26 Sep 2016, 20:11


For some reason, this forum is preventing me from entering "insert into" as a string it gives me 406 error when i try to preview or submit.
so to work around that i have to put either "insert" or "into" in underline or bold so that the 2 strings are not together.

but anyways.
Here's what i wanted to say.

Code: Select all

create table t(id int auto_increment primary key);
insert into t values (),(),();


To my surprise it lets me do it...inserting empty set into table which is awesome.
This is used for when for example you want to have multi tables that are classified as the same object, for example company, business, and person all can be taxpayer, but if company, business and person have completely different information details (not sharing any fields, obviously if they shared things like name, then name could be put in taxpayer table...but as an example when taxpayer has no columns other than the fact that it's a taxpayer with taxpayerid referenced in company,business and person then you can just add taxpayerid as primary key auto_increment in taxpayer table and make the other tables reference taxpayer(taxpayerid), then you can make it so that if you ever update or delete taxpayer it deletes company,business, or person entities automatically.

I thought that was cool to find out (adding empty set just adds an auto_increment id to table).

I still want an opportunity to implement this in real life situations however i think it's rare because usually you have some common information that you put in taxpayer table (ie. phonenumber, address since company, business and person most likely will have these information).
0 x



T.
please don't message me, message tim(admin) instead as I am tim(admin). I don't check this account very often.
To message tim(admin), click here. Thanks.

Registered members enjoy ads-free content
Post Reply

Last 20 Members Who Visited This Topic

User avatar gnerd (1)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: oldmangrumpy
2: Pat625
3: Ella
4: RJKD
5: Conbagui
6: tim
7: Conbagui

Who is online

Users browsing this forum: No registered users and 1 guest