Union 考題

Oracle OCP 19c 认证1Z0-082考试题库(第2题)

2.Which statement is true about the INTERSECT operator used in compound queries?

A. Multiple INTERSECT operators are not possible in the same SQL statement

B. It processes NULLs in the selected columns

C. INTERSECT is of lower precedence than UNION or UNION ALL

D. It ignores NULLs

来源:cuug

26、Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET operator such as UNION? (Choose two.)

A. Column positions must be used in the ORDER BY clause

B. Only column names from the first SELECT statement in the compound query are recognized

C. The first column in the first SELECT of the compound query with the UNION operator is used by default to sort output in the absence of an ORDER BY clause

D. Each SELECT statement in the compound query must have its own ORDER BY clause

E. Each SELECT statement in the compound query can have its own ORDER BY clause

source : cuug

来自 “ ITPUB博客 ” ,链接://blog.itpub.net/70010796/viewspace-2856176/,如需转载,请注明出处,否则将追究法律责任。

Questions 1 and 4 are based on this passage

Though great gains in membership, particularly among women, as well as success in gaining concessions from employers over working conditions and wages, characterized many United States labor unions during the First World War, by the postwar years of 1919 1921, many of these gains had begun to be undermined. Especially significant, then, is the story of consolidation and increase in power after the war by Local 36 of the International Laundry Workers' Union, whose members were primarily Black women.

On May 29, 1918 Local 36 struck all seven laundries in Little Rock, Arkansas. The case was referred to the National War Labor Board (NWLB), which ruled in favor ofLocal 36 Most of the laundry owners attempted to undermine the terms of the ruling by delaying or complicating its implementation. New hearings were held in May 1919, and again the NWLB decided in favor of the union By then, however, the NWLB- which had never held the power of enforcement—had lost even the persuasive advantage it had been able to employ during the war, and it regretfully informed the workers that they were on their own The laundry workers chose to continue the fight Local 36 declared a strike at the Fame Laundry, the worst offender among the city's laundries, and sued its owner to prevent him from using the treasured union label; the union's action inspired a citywide boycott. On June 27, Local 36 announced that it intended to open a cooperative laundry. The cooperative flourished, and the Fame Laundry went out of business.

Local 36's achievements during the war were facilitated by several factors. Because their work was essential to the military installations surrounding the city, the laundry workers' cause received immediate publicity and was quickly referred to the NWLB. Because several issues raised by Local 36's situation fit unusually well with the NWLB's concerns (for example, the recognition of workers' right to a wage on which they could live, and the principle of equal pay for equal work, regardless of race or gender), the workers received a great deal of institutional support, as well as the favorable ruling.

But it was the solidarity maintained by the laundry workers, both Black and White, that was responsible for their union's continuing success. Whereas after the war many United States labor organizations lost the feeling of community generated during the period of national crisis, Local 36 remained a singularly effective experiment in interracial cooperation. These women sustained their initiative and commitment through a four-year period, during which they mobilized an impressive community network. They demonstrated their determination by repeatedly threatening to strike.
Finally, by going into business for themselves, this group of historically disempowered workers displayed the flexibility and creativity necessary to provide themselves with steady, well- compensated employment and improved working conditions.

面試考題

1 explain #error

   

ref1
   ref2

     簡單地說:  compiler看到 它 就會停掉啦~
   為什麼要停掉?  ref3

   2. explain "struct" and "union"

   struct → 所佔記憶體空間為 member 相加
   union → 所佔記憶體空間由最大size member決定

   note: 所以union的member同一時間只會最多出現一個

     example:

  3. 修飾字 (const, volatile, static......)

explain "volatile" and "const".  can we use "volatile" and "const" in the same variable ? can we use "volatile" in a pointer?
最能幫我理解的就是舉 status register來當例子,如下:

"const volatile is used for defining Hardware Read-only Registers.example CPU status registers.
the value of these registers are read-only but the 
value of these registers may change depend on the processor status.  Thus const volatile variable can't be altered by the programmer but by the Hardware
" ref

中文版:
  "volatile變數代表其所儲存的內容會不定時地被改變,宣告volatile變數用來告訴編譯器 (Compiler) 不要對該變數做任何最佳化操作,凡牽涉讀取該volatile變數的操作,保證會到該變數的實體位址讀取,而不會讀取CPU暫存器的內容 (提升效能) 。舉個例子,某一硬體狀態暫存器 (Status Register)就必須宣告volatile關鍵字,因為該狀態暫存器會隨時改變,宣告volatile便可確保每次讀取的內容都是最新的"  cited from ref1

--------------------------------------------------

→ 何時可以用const?
      1 co-work一個function時,有時會用傳參考的方式,但傳參考有點風險(別人可以不懂,就直接改了某個不該改的變數) ,要避免的 你可以給這種 prototype:

             int foo(const int &bar)

------------------------------------------------------------

  幾個用法: (規則 * 和 & 左邊形容指向的值,右邊是本身),for example

  1. const int a=100;  // 沒有*和&,所以簡單: const和int通通是形容a
  2. int const b=100; // 同上
  3. const int *a=&b; // 套規則: * 左邊的const和int是指向的值,所以a指標指向的值不能改,*右邊的是本身,所以a可以改(沒有const和int修飾到它)
  4. int const *a=&b; //同上
  5.  int * const a = &b; //套規則: * 左邊的int是修飾a指向的值,所以,值可以改(因為沒const嘛),*右邊的是本身,已被const修飾到了,所以a不能改
  6. const int * const a = &b; // 也不用套三小規則了啦,都出現兩個const,就通通都不能改了啊!
  7. const int &a=100; ///套規則: & 左邊的int是修飾a指向的值,值可以改(因為沒const嘛),&右邊的是本身所以a可以改(沒有const修飾到它)

    note: 因為被const修飾到的東西未來都不能改了,所以宣告時要初始…不然就沒什用途了…(除非你希望該值是0?)

4. bit operation

example1:

可能是這樣解啦:

1 第四行和第五行 好像可以"約分"一下

→ 第5行會變成: v = (v1&(~v2)) |v2

再變成→ (V1|V2) & ((~V2) | v2)

→ &的右邊是1,所以V 就是V1|V2

example 2

a) #define set_bit(x, nth_bit) x|(1<<nth_bit)
b) #define clear_bit(x, nth_bit) x|(1<<nth_bit)
REF


? 難道要先展開成二進位? 再慢慢算?

5. ??

要考你 a+1 和 &a+1。
第一種的+1一次是跳一個int的大小(i.e., 4bytes in 32-bits cpu)
第二種的+1一次是跳一整個array的大小 (i.e., 4*5=20 bytes)

更清楚的說明在這 (see also this), 可以看到: a和&a值雖相同,但type不同。
所以 +1 時,要加的是 type的大小

所以*(a+1)是2,(*p-1)是garbage (unknown value)

答案: typedef void(*pf)(char *);

第一行那坨,眼睛只要看著 void (*)(char *)就好
它是一個function pointer的type

只要記得,function pointer的typedef 是把new type的name塞在第一個*後面

不要像我一開始還寫成:

typedef void(*)(char *) pf

先說:  我還看過規定 + - * /都不能用的。

解法1: 可以利用3的倍數的特性:  每個位數相加起來依舊是3的倍數。
例如: 369是3的倍數,那3+6+9=18也一定是3的倍數。
『每個位數相加』的動作一直做到只剩個位數為止,如上例 18還不是只剩個位數,所以繼續,1+8=9。最後的結果只要是3或6或9 那該數就是3的倍數。

      9. explain lvalue and rvalue

Toplist

最新的帖子

標籤