Vacation Horror Stories...

At the end of the year, most people try to get some vacation time in.  If you're one of them, we hope that you're having a wonderful time and that your vacation is nothing like the ones these folks had:

The Unexpected Visitor..“We were in Denver and one of the guys we were traveling with woke up in the middle of the night with a strange, drunk man passed out next to him,” reports one travel writer.  Apparently, the drunk man had forgotten his room key and when asked for his room number by the hotel staff, just blurted out a random number.  The night clerk then handed over the key, no questions asked! - Courtesy of New York Post

A Christmas to Remember...“My mum's side of the family consists of about 20 Irish people and we often hire out hostels to ourselves for the Christmas holidays.  One year we stayed by the seaside and my uncle overheard in the local pub that a dead whale had washed up on the beach and that someone was going to blow it up to get rid of it.”

“Obviously we all wanted to see this spectacle.  When we finally arrived there were bits of dead whale everywhere with the worst rotting smell I have experienced to this day.  My mum decided to kick a piece of whale blubber that was lying around which exploded and splattered ALL OVER ME.  I was 11 years old, covered head to toe in dead whale.” - Submitted by Poppy Izzard, courtesy of Buzzfeed

Derailed by an Ice Storm...“We drove 2.5 hours to my parents' house.  There was a terrible ice storm and we used 4 hours for the trip only to get 100 yards from their house before sliding off the road on the last hill.  We walked through the woods carrying food because it was too icy to walk on their road.” - Submitted by Brenda Owen, courtesy of Conde Nast Traveler

Brrr....stay warm and from those of us here at Scisbo, have a safe and happy holiday!

SQL - Creating relations

When we talked about datatypes in SQL, we said that we can directly associate an attribute with a predefined data type.  Another way of specifying a domain is using the SQL create domain statement:

create domain NAME as char(15);
This creates a domain and assigns a name to it.  Now we can use that domain when defining a new attribute, instead of using a predefined SQL type.  A useful consequence of using this kind of approach is the fact that, if, for example, we need the NAME domain to be extended to char(20), we only need to make one change - at the declaration of the domain.

 

In SQL, permanent relations - tables - are created using the create table statement.  The statement must include the specification of the table name and attribute names and domains.  Optionally, the statement can also include constraint specifications, such as primary or foreign key constraints.  A typical form of the create table statement is:

create table table_name
(
   column_name1 datatype [constraint for column1]
   column_name2 datatype [constraint for column2]
   column_name3 datatype [constraint for column3]
   ...
   [integrity constraint 1],
   [integrity constraint 2]
   ...
);
where table_name is the name of the relation (table) being created, column_name1 the name of an attribute, and datatype a predefined datatype (with optional specification of precision, scale value or length) or the name of a declared domain.  Constraints for columns are optional and most often contain the not null specification, which means that null values are not allowed.

 

Other constraints regarding the value of columns (attributes) can contain specifications of uniqueness, referential integrity (referencing another table's [primary] key) or other limitations which can be specified using the check constraint.  Typical integrity constraints are:

  • Uniqueness specification with the following form:
    primary key (column_name1, column_name2, ...)
    This means that the values on the attributes which constitute the primary key must be unique (they are by default, and must always be, not null).

  • Referential integrity (foreign key specification):
    foreign key (list of referencing columns) references name_of_ref_table(list of referenced columns)
    where list of referencing columns is in the form of column_name1, column_name2, ..., and the listed columns are the attributes constituting the foreign key.  The list of referenced columns is a list of attributes from the name_of_ref_table table referenced by the foreign key.

  • Check constraint, in the form of:
    check(P)
    where P is a predicate/condition which has to be satisfied for each entity of the table.

 

Now we will see a couple of examples - statements for creating relations of the uni database we modeled earlier:

create table faculty
(
   FacName char(30) not null, 
   Address char(50),
   primary key(FacName)
);

create table phone
(
   FacName char(30) not null,
   FacPhone char(10) not null,
   primary key(FacName, FacPhone),
   foreign key(FacName) references faculty(FacName)
);

create table person
(
   PersonID long not null,
   Name char(50) not null,
   DateOfBirth date not null,
   Address varchar(50),
   primary key(PersonID)
);
In the following articles we will cover authorization and privileges, editing/deleting relations and attributes, and start learning about basic SQL queries.

 

More of the Biggest Social Media Fails from 2016

In a previous post, we listed some of the biggest social media fails of 2016.  However, there were so many of them that we have more for you!  Here are the rest of 2016’s most noteworthy social media fails:

  1. Society Creates a Jerk.  Microsoft made an “AI” Twitter bot that was designed to learn from its users through conversation.  Sounds great, right?  Maybe it would have been if the experiment had gone as planned.  In less than a day, Twitter trolls turned the bot, Tay, into a racist jerk.  Microsoft ended up having to delete Tay’s tweets and put the project on hold.

  2. It’s Good to Be a Girl” Campaign Is Bad, Bad, Bad.  Fashion brand Vera Bradley attempted to modernize its brand by launching the campaign, “It’s Good to be a Girl.”  The company created subway posters with the hashtag, “itsgoodtobeagirl,” that included messages like, “We’ll take a handbag over a briefcase any day,” “That moment when a gentleman offers you his seat,” and “Ordering a soy-milk half-caf vanilla latte without judgment.”  The campaign was derided as a sexist fail by many in its target audience with one tweeter stating that the campaign reduces women to “lipsticks, purses, and subservience.”   

3 Outrageous Office Xmas Party Stories

For fun, we've compiled some of the most outrageous behavior we've heard of at office XMas parties.  Read them and rest assured that however nervous you might be about your next office party, you're unlikely to bomb as badly as these people did:

  1. From Party Attendee to Arrestee...“M*, an IT guy at our company had so much whiskey at our Christmas party's after-party that he attacked random plates of food that weren't his, broke glasses on the floor, started a fist fight with our CFO in the 'put up your dukes' style, and when the cops came to calm him down he fought them and got arrested.  He was promptly fired—while sitting in the back of a police cruiser a week before Christmas.” - Anonymous

  2. When an Office Party Becomes More Like Animal House...“The CEO threw an evening holiday party at his house, and gave me a half day off to shop for food and drinks, set everything up, and decorate.  I did my best but since I was a billing coordinator, not a party planner, it looked a little...askew.

    The actual party was like a frat house run amok.  The A/P director drank too much and threw up shrimp cocktail on the white shag carpet.  The plant manager got into a screaming fight with his wife in the driveway.  The chemist was found making out with the loading dock supervisor, who was about 30 years her senior and more importantly not her husband.  And I accidentally walked in on the sales director peeing in the unlocked hallway bathroom (which I thought was the coat closet; we were both surprised).  The president himself got completely hammered and went around telling people totally inappropriate stories, gave me a giant bear hug that lasted a little too long, and broke the sliding door to his patio.” - Anonymous

  3. A Cocaine Christmas... “Two days before my first work Christmas party, a memo came out saying if you were arrested the company would not bail you out of jail.  A year before, several people were arrested for doing coke outside the Christmas party.  The CEO had to bail them all out of jail.” - Anonymous

5 Tips for Stress-Free Traveling this Holiday Season

If you've ever traveled in December, then you already know how chaotic airports are around the holidays.  However, there are ways to make your airline travel as stress-free as possible.  Read on to hear our tips for surviving your next holiday trip:

  1. TSA Pre-Check.  If you want to whisk through security, definitely consider TSA Pre-Check.  For just $85, you'll receive a 5-year membership, allowing you to leave your jacket, shoes, and belt on when going through security.  Additionally, you'll no longer have to remove your laptop or liquids when traveling.  Depending on which city you're located in, you can get your TSA Pre-Check flier number in as little as 3 days.

  2. Get Bumped.  We'll admit that getting bumped can actually be quite stressful.  However, if you're more anxious about your budget than time this holiday season, you may want to volunteer to be bumped from a full flight to another one.  In doing so, you'll be given a voucher for future travel, typically in the $200-$300 range.  Sometimes the flight you're bumped to will get you to your destination even earlier than your original flight.

  3. Ship Gifts.  Rather than trying to pack a lot of gifts, consider buying them online and having them shipped to your destination.  Alternatively, you may want to buy gift cards instead—they make it easy to travel light.

  4. Don't Go Overboard when Packing.  Speaking of traveling light, keep packing to a minimum.  On your return flight, you're going to need space in your suitcase for any gifts you receive.

  5. Book an Early or Late Flight.  If spending time in a crowded airport sounds nightmarish to you, choose a very early or late flight.  You'll encounter less people traveling then and while you won't have the airport all to yourself, you'll find it much more enjoyable than chaotic midday travel.