## How come Min function in this query statement print name rather than integers

This is a question on

Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output column headers should be Doctor, Professor, Singer, and Actor, respectively. Note: Print NULL when there are no more names corresponding to an occupation.

Input Format The OCCUPATIONS table is described as follows:

Column Type Name String Occupation String Occupation will only contain one of the following values: Doctor, Professor, Singer or Actor.

``Sample Input  Name    Occupation Samantha    Doctor Julia   Actor Maria   Actor Meera   Singer Ashely  Professor Ketty   Professor Christeen   Professor Jane    Actor Jenny   Doctor Priya   Singer ``

]

Sample Output

``Jenny Ashley Meera Jane Samantha Christeen Priya Julia NULL Ketty NULL Maria ``

Explanation The first column is an alphabetically ordered list of Doctor names. The second column is an alphabetically ordered list of Professor names. The third column is an alphabetically ordered list of Singer names. The fourth column is an alphabetically ordered list of Actor names. The empty cell data for columns with less than the maximum number of names per occupation (in this case, the Professor and Actor columns) are filled with NULL valu

``SET @r1=0, @r2=0, @r3 =0, @r4=0; SELECT MIN(Doctor), MIN(Professor), MIN(Singer), MIN(Actor) FROM (SELECT CASE Occupation WHEN 'Doctor' THEN @r1:=@r1+1                        WHEN 'Professor' THEN @r2:=@r2+1                        WHEN 'Singer' THEN @r3:=@r3+1                        WHEN 'Actor' THEN @r4:=@r4+1 END        AS RowLine,        CASE WHEN Occupation = 'Doctor' THEN Name END AS Doctor,        CASE WHEN Occupation = 'Professor' THEN Name END AS Professor,        CASE WHEN Occupation = 'Singer' THEN Name END AS Singer,        CASE WHEN Occupation = 'Actor' THEN Name END AS Actor        FROM OCCUPATIONS ORDER BY Name) AS t GROUP BY RowLine; ``

My doubt how come MIN(DOCTOR) print names This is from ..Here in this tutorials it comes as number

Please give me a solid answer .I am in the process of learning mysql

## Find Someone’s Name From Their Cell Phone Number

In reality, there is a more secure, USA Phone Number List  passable and effective option in contrast to playing out an opposite mobile phone query. Regardless of whether the portable numbers are not recorded in freely available reports or indexes, they  USA Phone Number List can be available in some inner data sets of phone partnerships. Positively, you will most likely be unable to get the outcomes without anyone else. A few organizations benefit USA Phone Number List  admittance to these data sets and accumulate data about cell numbers and incorporate them in a solitary colossal data set with

refreshed data. From that point,USA Phone Number List  you will actually want to lead the ventures and at last uncover the proprietor of the number. Be that as it may, admittance to these extensive would charge you a little expense, yet indeed this is great. Your choice is to pay the one-time expense for a solitary pursuit or pay for the all year limitless  USA Phone Number List  ventures.Leading an opposite look into telephone number can be incredibly productive in getting associated again with families or companions that you have lost ties for an extensive stretch USA Phone Number List  of time. Most likely you should refresh your arrangements of contacts for your letters on extraordinary events and what you just have available are telephone numbers. You may USA Phone Number List  likewise need to stop trick guests impeding you consistently.

Whatever your reasons USA Phone Number List  might be, converse telephone search is in reality much simple to achieve. Be that as it may, you ought to have the USA Phone Number List  telephone numbers and web association so you can play out the opposite query. You might begin your hunt by evaluating the free administrations. In case you are USA Phone Number List  adequately lucky, trust that your number available has a place with the recorded ones. Free registries don’t keep data of

## Which main problems could arise from adding a number to a domain name?

Consider the domains `star.com` and `star1.com`.

What could be the problems with adding number as in the second example?

I can think about the following, I speak Hebrew and in Hebrew I could say:

``star one dot com סטאר וואן דוט קום ``

I could also say:

``star ehad dot com סטאר אחד דוט קום ``

Either of the Hebrew phrases might confuse a listener (vocally); the listener might not be sure if either "one" or "ehad" would mean an actual number 1.

## Change of name due to copyright, will new name work for SEO?

A web hosting customer of mine has a domain, let’s say it is `curlybumm.com`. (These are examples that reasonably represent how it is playing out) The owners of a trademark `curly` have demanded she drop the name, they are in the same fashion category.

She has negotiated with them and they will allow `kerlybumm.com`. Not ideal after getting a brand established, but so far so good.

Her question (via me)​ is about using something like "Curl~e bumm" in content and also used `curly` in meta. From a search engine point of view (and customers being able to find her), would this would cause complications. SEO is a dark art to me 😛

## MSSQL 2012 Update (or create new certificate with same name) that uses Symmetric Key encryption

Super short version of my question:

For a MSSQL 2012 DB is it possible to update the current certificate with a new expiry date and new PW (or create new certificate with same name)? Or some other option I have not thought of that would be quick/easy to implement?

Now the details (there is probably simple answer I am just not able to find online):

We have a SQL 2012 DB and in lower environments (single server only for each) and our production which has failover server (so whatever my solution needs to include the ability to work with primary and failover server).

First two notes:

1. The key/certificate I know is outdated/not best way and we are working on redesiging our encryption.

2. We are working on upgrading this MS 2012 DB to 2019 soon, but not before I need to make this update/change.

The code for select (but we also do update/inserts) is used like this in SP’s (and also a trigger):

``OPEN SYMMETRIC KEY KeyNameHere DECRYPTION BY CERTIFICATE CertificateNameHere        Select DecryptByKey(EncryptedColumn)     From dbo.TableName  CLOSE SYMMETRIC KEY KeyNameHere;  ``

I thought I had a solution (and using these steps testing it does work):

1. Backups existing certificate

2. Creates new certificate (and then back it up)

3. Updates all SP’s using the certificate to use a new certificate name in code like:

Existing: OPEN SYMMETRIC KEY KeyNameHere DECRYPTION BY CERTIFICATE CertificateNameHere

New: OPEN SYMMETRIC KEY KeyNameHere DECRYPTION BY CERTIFICATE NewCertificateNameHere

1. Drops old certificate

As I said the above does work in testing on dummy DB but there are a LOT more SP’s than I was told and I can update them all to use new certificate name (as above) but I would prefer to find a way to not have to update all these SP’s code, but I can if needed.

Key question/concern is around the certificate in production (primary and failover servers) and what/how to ensure the update is completed on both and will work if/when a failover occurs.

If there is anything else I am missing or not considering please let me know.

## Output a specific link in WordPress post if the single post’s category’s name contain certain word

I want to output a specific link in every post, depending on the post’s category. For example, If a post is in "travel" category, then the link to https://www.example.com/travelbooking will be displayed in this post. If a post is in "hotel" category, then the link to https://www.example.com/hotelbooking will be displayed in this post.

I tried this code

``    <?php    \$  category = get_the_category();   \$  firstCategory = '\$  category[0]->cat_name';   if (strpos(\$  firstCategory, 'travel') !== false) { echo '<a href="https://www.example.com/travelbooking">Visit travelbooking</a>'; }        if (strpos(\$  firstCategory, 'hotel') !== false)  {     echo '<a href="https://www.example.com/hotelbooking">Visit hotelbooking</a>';    }          else {      echo '<a href="https://www.example.com">Visit homepage</a>'; }       ?>  ``

But it doesn’t work, any suggestion?

I migrated and restored the website in a new hosting with All-in-one WP Migration. Everything works fine for customer. However, when I tried to check the order in the Woocommerce, it says there is an critical error on the website. This is the log from the Woocommerce > Status. May I know how to fix it please? Thanks.

``2021-08-01T00:07:04+00:00 CRITICAL Uncaught TypeError: call_user_func_array(): Argument #1 (\$  function) must be a valid callback, function "misha_editable_order_meta_general" not found or invalid function name in /var/www/vhosts/yubake.my/httpdocs/wp-includes/class-wp-hook.php:292 Stack trace: #0 /var/www/vhosts/yubake.my/httpdocs/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #1 /var/www/vhosts/yubake.my/httpdocs/wp-includes/plugin.php(484): WP_Hook->do_action() #2 /var/www/vhosts/yubake.my/httpdocs/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php(310): do_action() #3 /var/www/vhosts/yubake.my/httpdocs/wp-admin/includes/template.php(1389): WC_Meta_Box_Order_Data::output() #4 /var/www/vhosts/yubake.my/httpdocs/wp-admin/edit-form-advanced.php(688): do_meta_boxes() #5 /var/www/vhosts/yubake.my/httpdocs/wp-admin/post.php(206): require('...') #6 {main}   thrown in /var/www/vhosts/yubake.my/httpdocs/wp-includes/class-wp-hook.php on line 292 ``

## Can a MySQL FOREIGN KEY CONSTRAINT reference a column value rather than a column name?

I have a child table whose rows are related to various parent tables by `parent_table_name`, and `parent_id` columns.

Can I set up a foreign key constraint for these relationships?

In the tables below, I can run queries such as `SELECT * FROM parent_1 p1 JOIN child c ON p1.id = c.parent_id AND c.parent_table_name = 'parent_1';` to get a row from `parent_1` and any related rows from `child`.

``CREATE TABLE parent_1 (       id INT NOT NULL AUTO_INCREMENT     , PRIMARY KEY(id) );  INSERT INTO parent_1 VALUES(1);  CREATE TABLE parent_2 (       id INT NOT NULL AUTO_INCREMENT     , PRIMARY KEY(id) );  INSERT INTO parent_2 VALUES(1);  CREATE TABLE child (       id INT NOT NULL AUTO_INCREMENT     , parent_table_name VARCHAR(16) NOT NULL     , parent_id INT NOT NULL     , some_interesting_value VARCHAR(255) NOT NULL     , PRIMARY KEY(id)     , KEY (parent_table_name, parent_id) );  INSERT INTO child VALUES(NULL, 'parent_1', 1, 'Hello world'); INSERT INTO child VALUES(NULL, 'parent_2', 1, 'Goodbye world'); ``

I have tried adding a constraint as below, but got a 1064 error.

``ALTER TABLE parent_1 ADD CONSTRAINT p1_children FOREIGN KEY ("parent_1", id)     REFERENCES child (parent_table_name, parent_id);  ERROR 1064 (42000): You have an error in your SQL syntax;     check the manual that corresponds to your MySQL server version     for the right syntax to use near '"parent_1", id) REFERENCES     child (parent_table_name, parent_id)' at line 1 ``

Is there some way to set up this sort of constraint? Or is the only way to have a third table that has the primary keys from the parent and child table?

## Stroring field name instead of referencing using objectId

This is my first question here

For example: I have a post document which contains list of people who like it and my question is Should i store each person in the array using `objectId` or `username`(it’s also a unique identifier) the reason i ask is that when we view a likes of a particular post i want to show only their `username` and profile pic in this case I think storing `username` will be much faster than query each `objectId` and fetch their `username`, but after all i still need to fetch their profile pic using either one of them.

Guide me if i’m wrong or misunderstood sth.

you can send me if you have any blogs related to this.

## Is it a legal concern if a procedural name generator might generate the names of real people?

(This question is similar in spirit to this question, but I think this case is sufficiently different and specific enough to warrant a new question.)

## Background

In one of my current side projects, I have a little procedural name generation system for NPCs. Its purpose is akin to the random profiler in Watch_Dogs and the way it procedurally generates little NPC identities and blurbs to flesh out the game world, in that the system exists to spit out some generic NPC identities and give bits of information about them. Which can sometimes give very funny results, in Watch_Dogs’s case.

The procedural system in my project is fairly basic, and it generates:

1. a random first name, taken from a list of the most common baby names in North America. (i.e. Anna, Nancy George, William, etc.)
2. a random last name, taken from a list of the most common surnames in North America. (i.e. Rogers, Smith, Walker, Brown, etc.)

As a result of this dataset, the generator typically spits out generic names like "John Smith" and "Marcy Walker," which is what I wanted it to do and it works as intended.

## The question

In the process of testing, I have noticed something about this generation system: because it is specifically designed to generate normal-sounding names that could plausibly exist, it can inadvertently generate the names of real, famous people. For example, it has the potential to spit out "Chris Pine," "Will Smith," "Tom Hanks," and probably a few others, simply because it pulls from lists of common names and could plausibly stumble across and combine those options. From a player’s point of view, it would probably be a little surprising to stumble across an NPC named Tom Hanks just wandering around the world.

This leads me to my question: If I were to ever release this game commercially, is it possibly going to be a legal concern if a procedural name generator sometimes inadvertently spits out the names of famous, real people? Are there other potential ways this could be a problem from a game design standpoint? Would it count as some kind of unauthorized-use-of-identity issue? And, if so, should I program in some "blacklists" of names that the procedural generator should avoid spitting out, i.e. by giving it lists of celebrity names to avoid?