## NOT EXISTS with two subquery fields that match 2 fields in main query

Background: Two different document types in a document management system. Both Doc Type A and Doc Type B have a Ticket #, and a Ticket Date. What we’re looking for: Doc Type A docs that don’t have a matching Doc Type B doc (NOT EXISTS) with the same Ticket # and Ticket Date. There like are Doc Type B docs that have the same Ticket # but NOT the same Ticket Date. We want to ignore those. Seems simple…. but I am stuck. So far what I have is something like this:

SELECT distinct ki110.keyvaluechar AS "Ticket #", ki101.keyvaluedate AS "Ticket Date"  FROM itemdata  left outer join hsi.keyitem110 ki110 on ( itemdata.itemnum = ki110.itemnum ) left outer join hsi.keyitem101 ki101 on ( itemdata.itemnum = ki101.itemnum ) WHERE   ki101.keyvaluedate BETWEEN '01-01-2021' AND '01-31-2021' AND ( itemdata.itemtypenum  = 178  ) -- this is Doc Type A  AND NOT EXISTS (select ki110.keyvaluechar, ki101.keyvaluedate from itemdata, keyitem110 ki110 , keyitem101 ki101 where --(itemdata.itemnum = ki110.itemnum) --Ticket # 

— ** the problem is here for Date: I need to say Date in Doc Type B doc is not the same as Date in Doc Type A doc using ki101.keyvaluedate)

AND itemdata.itemtypenum = 183) -- this  is DOC Type B 

## Query to polybase external table giving error “Access to the remote server is denied because no login-mapping exists.”

we have successfully created all pre-requisite of creating external tables using SQL Server 2017 Standard Edition CU22 Polybase.

The issue we have is the non-sysadmin login can’t query those external tables .It shows below error.

Msg 7416, Level 16, State 2, Line 29 Access to the remote server is denied because no login-mapping exists.

The sysadmin login can query external tables without any issue. Is there anybody saw this issue and can help to resolve it.

## Is there need for messengers in DnD 5e, if spell Sending exists?

In my campaign (DnD 5e) I would like to send players on a quest to save a kidnapped person. The person has high value information. He/she was ambushed and taken prisoner.

My question is: is there a logical reason for sending a person to deliver a message instead of using 3rd level spell Sending? The spell has no range limitations, and message can be up to 25 words long. What are good reasons for not using a spell? The sender and the receiver would both have resources to hire a Wizard, Bard or Cleric to cast spell, so not using the spell option should be more complex than just “Caster is not available”. In addition the length of a message is less than 25 words.

I would like to keep the idea of sending party on a rescue mission, just need a logical reason for doing so.

## Can Alert prevent Surprise if you don’t know the enemy exists?

In a large dark temple, a player with the Alert feat and Darkvision can only see out to 60 ft, but at 100 ft there is an enemy with 120 ft Truesight sitting in a Silence spell and firing a crossbow. If the player rolls 20 for initiative and the enemy rolls 10, does the player get to attack first? Or should the enemy get to fire the shot before initiative is rolled? Or should the enemy roll initiative for itself, fire a shot, and then have the player roll into the initiative?

## Ensuring relationship between child tables exists prior to SQL insert

I have a situation where I have three tables: user, assignment and test. A user must have completed an assignment before he can take the test. This means the test table has both both a user foreign key and an assignment foreign key on it.

I could write a sql statement like this: insert into test (name, user_id, assignment_id) values ("final exam", 1, 1) which would check to see if the user and assignment exist before doing the insert. However it would not check to see if the user and assignment were related.

The easy way to solve this problem is to do a separate query before the insert to ensure the user has an assignment. I’m wondering if I can accomplish both in one query though. I’m not all that experienced with constraints or subqueries, both of which could be solutions. Looking for a best practice here as it will be used throughout an application.

## Does a function $f$ exists such that: $f(n-k) \ne \Theta(f(n))$ for some constant $k\geq1$?

I have encountered the following question in my homework assignment in Data Structures course:

"Does a function $$f$$ exists such that: $$f(n-k) \ne \Theta(f(n))$$ for some constant $$k\geq1$$ ?"

I think no such function $$f$$ exists, but I do not know how to prove it (or give a counter-example if one exists).

## Why to use captcha when SOP exists? [closed]

I just read about SOP (same origin policy), and I tried to learn this more and learn how it works. I tried to reset my password (In a chat forum) using HTTP Requests in Python, and most of them have captcha, why do websites need captcha when SOP exists?

The SOP doesn’t allow other places to perform those tasks, right? And how can attackers bypass the SOP and try to reset other people’s passwords?

## What happens when a banished creature would return to an extradimensional space that no longer exists?

Consider the following scenarios.

### 1. Banished from a portable hole, portable hole is destroyed.

A portable hole is described as a ten foot deep, six foot diameter extradimensional space. Suppose I jump into my portable hole after spreading it out on the ground, and I am followed by an enemy. Once we are both inside my portable hole, I cast banishment:

If the target is native to a different plane of existence than the one you’re on, the target is banished with a faint popping noise, returning to its home plane. If the spell ends before 1 minute has passed, the target reappears in the space it left or in the nearest unoccupied space if that space is occupied. Otherwise, the target doesn’t return.

My enemy is banished to its home plane. Next, I climb out of my hole, get a safe distance away, and toss in my bag of holding:

Placing a bag of holding inside an extradimensional space created by a handy haversack, portable hole, or similar item instantly destroys both items and opens a gate to the Astral Plane.

The portable hole is destroyed, and finally I break my concentration on banishment before the full minute has passed.

### 2. Banished from a rope trick right before the spell ends.

Rope trick says:

an invisible entrance opens to an extradimensional space that lasts until the spell ends. […] Anything inside the extradimensional space drops out when the spell ends.

So I cast rope trick while I’m being chased, and my pursuer pursues me into my little rope trick room, where I am patiently holding banishment. I banish my pursuer, climb out of my rope trick room, and and cast dispel magic on the rope:

Choose one creature, object, or magical effect within range. Any spell of 3rd level or lower on the target ends.

Again, no space to return to as I break my concentration on banishment before the one minute is up.

What happens to the banished creature when banishment ends? Banishment is very specific that the creature returns to the space it left from. Both the actual extradimensional space and the 5 foot square space the creature previously occupied is gone, as well as all nearest unoccupied spaces. What happens?

## Show that for every language $A$, this language $B$ exists

I came across this problem that I could not figure out… For every language $$A$$, there is supposed to be a language $$B$$ such that:

$$A \leq_T B$$

but:

$$B \not \leq_T A$$

If it is $$A \leq_TB$$ and $$B \leq_T A$$, this is easy since we can just let $$B := \bar{A}$$, but for the above I could not think of anything. Any help ?

## Is this language L = {w $\in$ {a,b}$^*$ : ($\exists n \in \mathbb{N}$)[$w|_b = 5^n$]} regular?

Let’s say we have the language L = {w $$\in$$ {a,b}$$^*$$ : ($$\exists n \in \mathbb{N}$$)[$$w|_b = 5^n$$]}. I want to know if this is a regular language or not. How do I go about doing this? I’m familiar with the Myhill-Nerode theorem but I don’t know how to apply it.