I’ve purchased headphones in a foreign country and declared them when coming back. Do I have to re-declare them on subsequent trips?

A few months back I’ve purchased a set of expensive headphones in the US and dutifully declared them when coming back to Canada. Now I would like to travel to the US again and carry the same headphones in my backpack. When coming back to Canada, would I need to re-declare the item as technically it wasn’t purchased in Canada? If not, how do I prove that the headphones have already been imported to Canada and I don’t need to pay duty on them any longer?

If it matters, in the first trip I’ve verbally declared that I’m carrying the headphones when re-entering Canada by car and thus didn’t have to fill out a customs declaration. I did not pay any duty as I was below the duty free limit at that time.

Too many foreign passports for ESTA

I am a UK citizen, and also a citizen of two non-VWP countries. I am planning to travel to the US and therefore I’m applying for ESTA.

I’m trying to answer the question “Have you ever been issued a passport or national identity card for travel by any other country?”. The answer to that is that I have five such passports (including current, expired and stolen), but the form only allows me to enter four foreign passports. When I click the “Add another” button, nothing happens on the form, and “Only a maximum of 4 cards allowed” is displayed in the Javascript console.

What should I do? Would I have any problems if I omit the oldest one (stolen and expired), and mention the other four? Or do I need to give up thinking about ESTA and get a visa instead?

I’m a flight attendant with dual citizenship of USA and South Korea. Can I enter US using foreign passport?

If I want to use my staff ticket I have to book the ticket under my Korean name (which is completely different from my English name) and Korean passport number. The only thing is I know that for the US you have to enter and leave using your US passport if you’re a citizen. Would it be possible for me to just buy my ticket using my Korean name and passport but when I enter the US just explain my situation and show my US passport to show that I’m a US citizen?

Is there any limitation on foreign nationals travelling by passenger boat Omsk – Salekhard or Salekhard – Antipayuta?

Severflot in summer and autumn operates passenger boats on the Yenisey and Ob rivers, from Omsk in the south to Antipayuta in the north. On this river-forum post, someones writes that Обязательно привезти копию первой страницы паспорта и копию свидетельства о рождении (emphasis mine). I would have a па́спорт (passport) in any case, but the need for a свидетельство о рождении (birth certificate) makes me wonder if they might limit foreign nationals. There are certainly places with travel restrictions for foreign or even Russian nationals. As a foreigner, can I simply buy a ticket on one of those river boats or might they be for Russian nationals only?

Doubt regarding foreign key and referential integrity

I am studying database from Database System Concepts.

The author was explaining foreign keys and referential integrity with the help of following schemas:

$ $ instructor(\underline{ID},\space name,\space dept\text_name,\space salary)$ $ $ $ course(\underline{course\text_id},\space title, \space dept\text_name,\space credits) $ $ $ $ department(\underline{dept\text_name}, \space building,\space budget)$ $ $ $ section(\underline{course\text_id,\space sec\text_id,\space semester,\space year},\space building,\space room\text_no,\space time\text_slot\text_id) $ $ $ $ teaches(\underline{ID,\space course\text_id, \space sec\text_id,\space semester, \space year})$ $

The primary keys are underlined.

The relation $ section$ is used so that each course could be offered multiple times, across different semesters, or even within a semester.

Foreign key was explained with the help of schemas $ instructor$ and $ department$ . The attribute $ dept\text_name$ in in $ instructor$ is a foreign key from $ instructor$ referencing $ department$ .

It need not be the case that all $ dept\text_name$ values are referenced by $ instructor$ relation.

Referential integrity constraint was explained with the help of $ section$ and $ teaches$ schema.

If a section exists for a course it must be taught by at least one instructor(it could be taught by more than one instructor)

So all the combinations of $ (course\text_id,\space sec\text_id,\space semester, \space year)$ that appear in $ section$ relation must also appear in $ teaches$ relation.

But we cannot declare a foreign key from $ section$ to $ teaches$ since multiple instructors could teach a single section.

We could define a foreign key from $ teaches$ to $ section$ .

Since we could form a referential integrity constraint from $ instructor$ to $ department$ by using foreign key but without foreign key we have referential integrity constraint from $ section$ to $ teaches$ .

So how is referential integrity different from foreign key constraints?

Also if you know some free resources that could clear database concepts please share.

Erro nas foreign keys

estou tentando fazer uma base de dados para um projeto academico, acontece que ao fazer as foreign keys acontece sempre o mesmo erro, mas nao consigo perceber que erro é este, é bem especifico, dai ter procurado no google e nao ter encontrado solução.

   -- MySQL Workbench Synchronization -- Generated: 2018-12-31 01:55 -- Model: New Model -- Version: 1.0 -- Project: Name of the project -- Author: nelson  SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';  CREATE TABLE IF NOT EXISTS `libraryRat`.`users` (   `userID` INT(11) NOT NULL AUTO_INCREMENT,   `name` VARCHAR(45) NULL DEFAULT NULL,   `email` VARCHAR(45) NULL DEFAULT NULL,   `password` VARCHAR(80) NULL DEFAULT NULL,   `birthdate` DATE NULL DEFAULT NULL,   `booksReaden` VARCHAR(45) NULL DEFAULT NULL,   `wishList` VARCHAR(45) NULL DEFAULT NULL,   `bookRegistration_userID` INT(11) NOT NULL,   PRIMARY KEY (`userID`),   INDEX `fk_users_bookRegistration_idx` (`bookRegistration_userID` ASC) VISIBLE,   CONSTRAINT `fk_users_bookRegistration`     FOREIGN KEY (`bookRegistration_userID`)     REFERENCES `libraryRat`.`bookRegistration` (`userID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`books` (   `bookID` INT(11) NOT NULL,   `name` VARCHAR(80) NULL DEFAULT NULL,   `description` VARCHAR(200) NULL DEFAULT NULL,   `isbn` INT(11) NULL DEFAULT NULL,   `cover` VARCHAR(150) NULL DEFAULT NULL,   `rating` DECIMAL(50) NULL DEFAULT NULL,   `genres` VARCHAR(45) NULL DEFAULT NULL,   PRIMARY KEY (`bookID`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`author` (   `authorID` INT(11) NOT NULL AUTO_INCREMENT,   `name` VARCHAR(45) NULL DEFAULT NULL,   `birthdate` DATE NULL DEFAULT NULL,   `about` VARCHAR(500) NULL DEFAULT NULL,   PRIMARY KEY (`authorID`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`admin` (   `idAdmin` INT(11) NOT NULL AUTO_INCREMENT,   `name` VARCHAR(45) NULL DEFAULT NULL,   `password` VARCHAR(45) NULL DEFAULT NULL,   `approvals` VARCHAR(45) NULL DEFAULT NULL,   `bookApprovals_adminID` INT(11) NOT NULL,   PRIMARY KEY (`idAdmin`),   INDEX `fk_admin_bookApprovals1_idx` (`bookApprovals_adminID` ASC) VISIBLE,   CONSTRAINT `fk_admin_bookApprovals1`     FOREIGN KEY (`bookApprovals_adminID`)     REFERENCES `libraryRat`.`bookApprovals` (`adminID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`ratings` (   `ratingID` DECIMAL(50) NOT NULL,   `bookID` INT(11) NOT NULL,   `date` DATE NULL DEFAULT NULL,   `rating` INT(11) NULL DEFAULT NULL,   `comments` VARCHAR(150) NULL DEFAULT NULL,   PRIMARY KEY (`ratingID`, `bookID`)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`bookRegistration` (   `userID` INT(11) NOT NULL AUTO_INCREMENT,   `date` VARCHAR(45) NULL DEFAULT NULL,   `bookID` INT(11) NOT NULL,   `name` VARCHAR(45) NULL DEFAULT NULL,   `authorID` VARCHAR(45) NULL DEFAULT NULL,   `genres` VARCHAR(45) NULL DEFAULT NULL,   `state` VARCHAR(45) NULL DEFAULT NULL,   `books_bookID` INT(11) NOT NULL,   `isbn` VARCHAR(45) NULL DEFAULT NULL,   PRIMARY KEY (`userID`, `bookID`),   INDEX `fk_bookRegistration_books1_idx` (`books_bookID` ASC) VISIBLE,   CONSTRAINT `fk_bookRegistration_books1`     FOREIGN KEY (`books_bookID`)     REFERENCES `libraryRat`.`books` (`bookID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`bookApprovals` (   `adminID` INT(11) NOT NULL AUTO_INCREMENT,   `date` VARCHAR(45) NULL DEFAULT NULL,   `bookID` VARCHAR(45) NULL DEFAULT NULL,   `name` VARCHAR(45) NULL DEFAULT NULL,   `authorID` VARCHAR(45) NULL DEFAULT NULL,   `genres` VARCHAR(45) NULL DEFAULT NULL,   `userID` VARCHAR(45) NULL DEFAULT NULL,   `state` VARCHAR(45) NULL DEFAULT NULL,   `bookRegistration_userID` INT(11) NOT NULL,   PRIMARY KEY (`adminID`),   INDEX `fk_bookApprovals_bookRegistration1_idx` (`bookRegistration_userID` ASC) VISIBLE,   CONSTRAINT `fk_bookApprovals_bookRegistration1`     FOREIGN KEY (`bookRegistration_userID`)     REFERENCES `libraryRat`.`bookRegistration` (`userID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`books_has_ratings` (   `books_bookID` INT(11) NOT NULL,   `ratings_ratingID` DECIMAL(50) NOT NULL,   `ratings_bookID` INT(11) NOT NULL,   PRIMARY KEY (`books_bookID`, `ratings_ratingID`, `ratings_bookID`),   INDEX `fk_books_has_ratings_ratings1_idx` (`ratings_ratingID` ASC, `ratings_bookID` ASC) VISIBLE,   INDEX `fk_books_has_ratings_books_idx` (`books_bookID` ASC) VISIBLE,   CONSTRAINT `fk_books_has_ratings_books`     FOREIGN KEY (`books_bookID`)     REFERENCES `libraryRat`.`books` (`bookID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION,   CONSTRAINT `fk_books_has_ratings_ratings1`     FOREIGN KEY (`ratings_ratingID` , `ratings_bookID`)     REFERENCES `libraryRat`.`ratings` (`ratingID` , `bookID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`users_has_ratings` (   `users_userID` INT(11) NOT NULL,   `ratings_ratingID` DECIMAL(50) NOT NULL,   `ratings_bookID` INT(11) NOT NULL,   PRIMARY KEY (`users_userID`, `ratings_ratingID`, `ratings_bookID`),   INDEX `fk_users_has_ratings_ratings1_idx` (`ratings_ratingID` ASC, `ratings_bookID` ASC) VISIBLE,   INDEX `fk_users_has_ratings_users1_idx` (`users_userID` ASC) VISIBLE,   CONSTRAINT `fk_users_has_ratings_users1`     FOREIGN KEY (`users_userID`)     REFERENCES `libraryRat`.`users` (`userID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION,   CONSTRAINT `fk_users_has_ratings_ratings1`     FOREIGN KEY (`ratings_ratingID` , `ratings_bookID`)     REFERENCES `libraryRat`.`ratings` (`ratingID` , `bookID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;  CREATE TABLE IF NOT EXISTS `libraryRat`.`author_has_books` (   `author_authorID` INT(11) NOT NULL,   `books_bookID` INT(11) NOT NULL,   PRIMARY KEY (`author_authorID`, `books_bookID`),   INDEX `fk_author_has_books_books1_idx` (`books_bookID` ASC) VISIBLE,   INDEX `fk_author_has_books_author1_idx` (`author_authorID` ASC) VISIBLE,   CONSTRAINT `fk_author_has_books_author1`     FOREIGN KEY (`author_authorID`)     REFERENCES `libraryRat`.`author` (`authorID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION,   CONSTRAINT `fk_author_has_books_books1`     FOREIGN KEY (`books_bookID`)     REFERENCES `libraryRat`.`books` (`bookID`)     ON DELETE NO ACTION     ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;   SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; 

Obrigado pessoal!

Why isn’t my PHP properly creating foreign keys in MySQL?

I’m creating a very simple databases admin with PHP but for some reason I can’t get functioning foreign keys with “on delete cascade”. To add a foreign key column I am first creating the new column:

alter table '.$  _SESSION["table"]." add ".$  _SESSION["table"] 

And then converting it to foreign:

alter table ' .$  _SESSION["table"]." add foreign key (".$  _SESSION["field"].") references ".$  _SESSION["referencedtable"]."(".$  _SESSION["referencedfield"].") on delete cascade 

I am showing the resulting SQL sentence on screen, it looks right, there aren’t php nor SQL errors, but when I create a new element which foreign column information corresponds with the foreign table key (I am using its primary key) and then I delete the “master” element, the “son” element isn’t being deleted on cascade. Just in case I was taking the concept the opposite way, I deleted the “son” element to check if the “master” was being deleted on cascade but it isn’t.

The “foreign_key_checks” is set to 1 so it’s ok.

What’s the exact usage of the term “foreign function interfaces”?

I’m working on a project that requires using multiple programming languages. I’m confused about what term to use to specify the interfaces available to bind two languages, e.g JNI, ctypes, jpype, etc. I don’t want to limit the meaning to say that the binding exists only between high level and low level languages(java-c or python-c). Most definitions mention this to be a criteria for FFIs. What would be a better term to use? FFI, bridging technology or something else?

Foreign Luxembourg resident with passport less than 6 months validity

I am not sure if this was asked already.

I am researching for passport validity for Schengen for non-EU long term residents but I cant find any answer.

My passport will expire on May 2019 and I am currently on holiday outside of EU and returning to Luxembourg on Jan 2019. I understand that passport should have a validity at least 3 months from the departure date. I have a long term resident status and my residence permit is still valid for at least 3 years.

Will I have an issue to enter the Schengen area?

Thanks a lot for your help.