วันพฤหัสบดีที่ 18 ธันวาคม พ.ศ. 2557

ข้อสอบ o-net


1.ข้อใดไม่ใช่ระบบปฏิบัติการที่นำมาใช้บนอุปกรณ์พกพา
ประเภท  Smartphone.

1.  Ubumtu       2.  Iphone  os
3.  Android      4.  Symbian
เฉลยข้อ  1

2.ไฟล์ประเภทใดในข้อต่อไปนี้เก็บข้อมูลในลักษณะตัวอักษร.
1.  ไฟล์เพลง  MP 3 (mp 3)
2.  ไฟล์รูปประเภท  JPEG (jpeg)
3.  ไฟล์แสดงผลหน้าเว็บ (html)
4.  ไฟล์วีดีโอประเภท  Movie (movie)
เฉลยข้อ  3

3.ลิขสิทธิ์โปรแกรมประเภทรหัสเปิด(Open Source)อนุญาต
ให้ผู้ใช้ทำอะไรได้บ้าง.

ก.  นำโปรแกรมมาใช้งานโดยไม่ต้องเสียค่าลิขสิทธิ์
ข.  ทดลองใช้โปรแกรมก่อนถ้าพอใจจึงจ่ายค่าลิขสิทธิ์
ค.  แก้ไขปรับปรุงโปรแกรมเองได้
1.  ข้อ  ก กับ  ข้อ        2.  ข้อ    กับ  ข้อ 
3.  ข้อ    อย่างเดียว    
4.  ข้อ    อย่างเดียว
เฉลยข้อ  4

 4.ระบบกระดานสนทนาหรือเว็บบอร์ดแห่งหนึ่งมีความต้องการดังนี้
ก.  ต้องให้ผู้ใช้สามารถตั้งกระทู้โต้ตอบกันได้โดยผู้ใช้
ต้องแสดงตัวตน(ล็อกอิน)เพื่อเข้าระบบก่อน
ข.  ผู้ใช้สามารถตั้งกระทู้หรือเข้าไปตอบกระทู้ที่ตั้งไว้แล้วได้
ค.  ระบบจะบันทึกชื่อผู้ตั้งและผู้ตอบไว้ด้วย
ในการออกแบบฐานข้อมูลดังกล่าวข้อใดกล่าวได้ถูกต้อง.
1.  ต้องสร้างตารางผู้ใช้ ตารางกระทู้และตารางคำตอบ
2.  ไม่ต้องสร้างตารางผู้ใช้เนื่องจากสามารถบันทึกชื่อ
ผู้ใช้ในตารางกระทู้และตารางคำตอบได้เลย
3.  ต้องสร้างตารางผู้ใช้และตารางกระทู้ส่วนคำตอบจะอยู่
ในตารางกระทู้อยู่แล้ว
4.  ไม่ต้องสร้างตารางกระทู้เพราะสามารถบันทึกกระทู้ที่ผู้ใช้
ตั้งในตารางผู้ใช้ได้เลย
เฉลยข้อ  4

5.อุปกรณ์ข้อใดคือหน่วยประเมินผลกลางของคอมพิวเตอร์.
เฉลย  CPU

6.ข้อใดเป้นการปฏิบัติที่ถูกต้องตามหลักวิชาการเมื่อค้นคว้า
หาข้อมูลจากอินเทอร์เนตมาทำรายงาน.

1.  คัดลอกเนื้อหาจากเว็บไซต์
2.  ใช้เนื้อหาจากกระดานสนทนา(Web board)มาใส่ในรายงาน
3.  นำรูปภาพจากเว็บไซต์มาใส่ในรายงาน
4.  อ้างอิงชื่อผู้เขียนบทความ
เฉลยข้อ  4

5.ห้องสมุดแห่งหนึ่งต้องการพัมนาระบบยืมหนังสือโดยสามารถ
บันทึกข้อมูลการยืมหนังสือลงบนบัตรอิเลคโทรนิกส์โดยไม่ต้อง

เขียนด้วยมือระบบนี้ควรใช้เทคโนโลยีในข้อใด.
1.  Smart  Card          2.  Fingerprint
3.  Barcode                 4.  WiFi
เฉลยข้อ  3

6.ผู้ประกอบอาชีพเป็นผู้พัฒนาเว็บไซต์ต้องเชี่ยวชาญความรู้
ด้านใดบ้างจากตัวเลือกต่อไปนี้.

ก.  ฮาร์แวร์คอมพิวเตอร์       ข.  ระบบปฎิบัติการ
ค.  เว็บเซิร์ฟเวอร์                   ง.  HTML
จ.  ระบบฐานข้อมูล                ฉ.  ภาษาจาวา(Java)
1.  ข้อ  ก และ ค                    2.  ข้อ    และ 
3.  ข้อ    และ                     4.  ข้อ    และ 
เฉลยข้อ  3

7.ข้อใดเป็นเทคโนโลยีการเชื่อมต่อข้อมูลไร้สายทั้งหมด.
1.  Wi-Fi  ,  IP             
2.  Wi-Fi  ,Bluetooth
3.  3G  ADSL                4.  3G    Ethernet
เฉลยข้อ  2

8.ข้อใดไม่ใช่ข้อเสียของการละเมิดลิขสิทธิ์ซอฟต์แวร์.
1.  การทำผิดกฏหมายลิขสิทธิ์มีความผิดทางอาญา
2.  เป็นช่องทางหนึ่งในการระบาดของไวรัสคอมพิวเตอร์
3.  ผู้ใช้จะไม่ได้รับการบริการจากผู้พัมนาถ้าหากมีปัญหาการใช้งาน
4.  ทำให้ผู้พัมนาซอฟแวร์ไม่มีรายได้เพื่อประกอบการและพัฒนาต่อไปได้
เฉลยข้อ  2


9.ข้อใดต่อไปนี้ถูกต้องที่สุด.
1.  การบันทึกข้อมูลลงแผ่นดีวีดีใช้เทคโนโลยีแบบแม่เหล็ก
2.  หมายเลขไอพีเป็นหมายเลขที่ใช้กำกับ  Network Interce Card
3.  หน่วยความจำสำรองเป็นหน่วยความจำที่มีคุณลักษณะแบบ Volntile
4.  รหัส ACIIและEBCIDICเป็นการวางรหัสตัวอักษรที่ใช้ขนาด  8 บิด
เฉลยข้อ  3 

10. สิ่งใดที่หุ่นยนต์ไม่สามารถทำได้
   1.  การเปิดกล่องระเบิด           2. การเลือกผลไม้
   
3.  การก่อการร้าย            4. การปอกเลือกไข่ต้ม  
เฉลยข้อ 3


วันอังคารที่ 9 ธันวาคม พ.ศ. 2557

SQL TOP

SQL TOP 
เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) ที่สามารถกำหนดจำนวน Record ที่แสดงผลออกมาได้

Database : Microsoft Access,SQL Server

Syntax

SELECT TOP [Integer] Column1, Column2, Column3,... FROM [Table-Name] ORDER BY [Field] [ASC/DESC]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูลที่จำนวน Budget มากที่สุดออกมา 2 Record 

SELECT TOP 2 * FROM customer ORDER BY Budget DESC

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000

SQL DISTINCT

SQL DISTINCT
เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยทำการเลือกข้อมูลที่ซ้ำกันมาเพียงแค่ Record เดียว 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT DISTINCT Column1,Column2,Column3,... FROM [Table-Name]


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000


Sample1 การเลือกข้อมูล CountryCode ที่ไม่ซ้ำกัน 

SELECT DISTINCT CountryCode FROM customer

Output 

CountryCode
TH
EN
US

SQL UNION

SQL UNION 
เป็นคำสั่งที่ใช้สำหรับการรวมหลาย Query มารวมให้ใน Table เดียวกับ โดยจำนวน คอลัมบ์หรือฟิวด์นั้นจะต้องเท่ากันด้วย

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT Column1,Column2,... FROM [Table-Name]
UNION
SELECT Column1,Column2,... FROM [Table-Name]
...


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000

Table : country
CountryCode
CountryName
TH
Thailand
EN
English
US
United states


Sample1 การรวมข้อมูลของตาราง customer และ country

SELECT CustomerID,Name FROM customer
UNION
SELECT CountryCode,CountryName FROM country

Output 

CustomerID
Name
C001
Win Weerachai
C002
John Smith
C003
Jame Born
C004
Chalee Angel
TH
Thailand
EN
English
US
United states

SQL LEFT JOIN

SQL LEFT JOIN 
เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยเงื่อนไขการ LEFT JOIN จะทำการเลือกข้อมูลหลักและข้อมูลเชื่อมโยงที่สัมพันธ์กัน โดยจะทำการอิงจาก Table แรกสำคัญก่อน ถ้าไม่มีข้อมูลใน Table แรก ข้อมูล Table สองจะไม่ถูกสนใจและจะสนใจข้อมูลแค่ Table แรกเท่านั้น 

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT [Table-Name1].Column1, [Table-Name2].Column1,... FROM [Table-Name1]
LEFT JOIN [Table-Name2] ON [Table-Name1].Column = [Table-Name2].Column


Table : customer
CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
C006
Superman Returnsupermain.return@thaicreate.com
US
20000000

Table : audit
AuditID
CustomerID
Date
Used
1
C001
2008-07-01
100000
2
C001
2008-07-05
200000
3
C001
2008-07-10
300000
4
C002
2008-07-02
400000
5
C002
2008-07-07
100000
6
C002
2008-07-15
300000
7
C003
2008-07-20
400000
8
C003
2008-07-25
200000
9
C004
2008-07-04
100000
10
C005
2008-07-04
200000


Sample1 การเลือกข้อมูลแบบ LEFT JOIN ตาราง customer และ audit 

SELECT customer.*,audit.* FROM customer
LEFT JOIN audit ON customer.CustomerID = audit.CustomerID

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
AuditID
CustomerID
Date
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
1
C001
2008-08-01
100000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
2
C001
2008-08-05
200000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
3
C001
2008-08-10
300000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
4
C002
2008-08-02
400000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
5
C002
2008-08-07
100000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
6
C002
2008-08-15
300000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
7
C003
2008-08-20
400000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
8
C003
2008-08-25
200000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
9
C004
2008-07-04
100000
C006
Superman Returnsupermain.return@thaicreate.com
US
20000000
NULL
NULL
NULL
NULL


Sample2 การเลือกข้อมูลแบบ LEFT JOIN ตาราง customer และ audit และ CustomerID = C001 

SELECT customer.*,audit.* FROM customer
LEFT JOIN audit ON customer.CustomerID = audit.CustomerID
WHERE customer.CustomerID = 'C001'

Output 

CustomerID
Name
Email
CountryCode
Budget
Used
AuditID
CustomerID
Date
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
1
C001
2008-08-01
100000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
2
C001
2008-08-05
200000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
3
C001
2008-08-10
300000


Sample3 การเลือกข้อมูลแบบ LEFT JOIN ตาราง customer และ audit และ CustomerID = C001 และแสดงผลเฉพาะตาราง audit 

SELECT audit.* FROM customer
LEFT JOIN audit ON customer.CustomerID = audit.CustomerID
WHERE customer.CustomerID = 'C001'

Output 

AuditID
CustomerID
Date
Used
1
C001
2008-08-01
100000
2
C001
2008-08-05
200000
3
C001
2008-08-10
300000

SQL OUTER JOIN


SQL OUTER JOIN 
เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยเงื่อนไขการ OUTER JOIN จะทำการเลือกข้อมูลหลักและข้อมูลเชื่อมโยงที่สัมพันธ์กัน โดยจะทำการอิงจาก Table แรกและ Table สอง ถ้าไม่มีข้อมูลใน Table แรก และ Table สองที่เชื่อมโยงกัน ข้อมูล Table แรกและ Table สอง จะไม่ถูกสนใจ

Database : Microsoft Access,SQL Server,Oracle

Syntax

SELECT [Table-Name1].Column1, [Table-Name2].Column1,... FROM [Table-Name1],[Table-Name2]
WHERE [Table-Name1].Column (+)= [Table-Name2].Column


Table : customer

CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
C006
Superman Returnsupermain.return@thaicreate.com
US
20000000

Table : audit

AuditID
CustomerID
Date
Used
1
C001
2008-07-01
100000
2
C001
2008-07-05
200000
3
C001
2008-07-10
300000
4
C002
2008-07-02
400000
5
C002
2008-07-07
100000
6
C002
2008-07-15
300000
7
C003
2008-07-20
400000
8
C003
2008-07-25
200000
9
C004
2008-07-04
100000
10
C005
2008-07-04
200000


Sample1 การเลือกข้อมูลแบบเชื่อมตาราง customer และ audit

SELECT customer.*,audit.* FROM customer,audit
WHERE customer.CustomerID (+)= audit.CustomerID

Output

CustomerID
Name
Email
CountryCode
Budget
Used
AuditID
CustomerID
Date
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
1
C001
2008-08-01
100000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
2
C001
2008-08-05
200000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
3
C001
2008-08-10
300000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
4
C002
2008-08-02
400000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
5
C002
2008-08-07
100000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
6
C002
2008-08-15
300000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
7
C003
2008-08-20
400000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
8
C003
2008-08-25
200000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
9
C004
2008-07-04
100000


Sample2 การเลือกข้อมูลแบบเชื่อมตาราง customer และ audit และ CustomerID = C001

SELECT customer.*,audit.* FROM customer,audit
WHERE customer.CustomerID (+)= audit.CustomerID
AND customer.CustomerID (+)= 'C001'

Output

CustomerID
Name
Email
CountryCode
Budget
Used
AuditID
CustomerID
Date
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
1
C001
2008-08-01
100000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
2
C001
2008-08-05
200000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
3
C001
2008-08-10
300000


Sample3 การเลือกข้อมูลแบบเชื่อมตาราง customer และ audit และ CustomerID = C001 และแสดงผลเฉพาะตาราง audit

SELECT audit.* FROM customer,audit
WHERE customer.CustomerID = audit.CustomerID
AND customer.CustomerID = 'C001'

Output

AuditID
CustomerID
Date
Used
1
C001
2008-08-01
100000
2
C001
2008-08-05
200000
3
C001
2008-08-10
300000

SQL JOIN

SQL JOIN 
เป็นคำสั่งที่ใช้สำหรับการระบุเงื่อนไขการเลือกข้อมูลในตาราง (Table) โดยเงื่อนไขการ JOIN จะกระทำเมื่อมีข้อมูลตั้งแต่ 2 Table ขึ้นไป โดยข้อมูลเหล่านั้นเป็นข้อมูลที่มีความสัมพันธ์และเชื่อมโยงกับข้อมูลหลัก

Database : MySQL,Microsoft Access,SQL Server,Oracle

Syntax

SELECT [Table-Name1].Column1, [Table-Name2].Column1,... FROM [Table-Name1],[Table-Name2]
WHERE [Table-Name1].Column = [Table-Name2].Column


Table : customer


CustomerID
Name
Email
CountryCode
Budget
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
C003
Jame Bornjame.born@thaicreate.com
US
3000000600000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000

Table : audit


AuditID
CustomerID
Date
Used
1
C001
2008-07-01
100000
2
C001
2008-07-05
200000
3
C001
2008-07-10
300000
4
C002
2008-07-02
400000
5
C002
2008-07-07
100000
6
C002
2008-07-15
300000
7
C003
2008-07-20
400000
8
C003
2008-07-25
200000
9
C004
2008-07-04
100000


Sample1 การเลือกข้อมูลแบบเชื่อมตาราง customer และ audit

SELECT customer.*,audit.* FROM customer,audit
WHERE customer.CustomerID = audit.CustomerID

Output

CustomerID
Name
Email
CountryCode
Budget
Used
AuditID
CustomerID
Date
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
1
C001
2008-08-01
100000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
2
C001
2008-08-05
200000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
3
C001
2008-08-10
300000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
4
C002
2008-08-02
400000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
5
C002
2008-08-07
100000
C002
John Smithjohn.smith@thaicreate.com
EN
2000000800000
6
C002
2008-08-15
300000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
7
C003
2008-08-20
400000
C003
Jame Bornjame.smith@thaicreate.com
US
3000000600000
8
C003
2008-08-25
200000
C004
Chalee Angelchalee.angel@thaicreate.com
US
4000000100000
9
C004
2008-07-04
100000


Sample2 การเลือกข้อมูลแบบเชื่อมตาราง customer และ audit และ CustomerID = C001

SELECT customer.*,audit.* FROM customer,audit
WHERE customer.CustomerID = audit.CustomerID
AND customer.CustomerID = 'C001'

Output

CustomerID
Name
Email
CountryCode
Budget
Used
AuditID
CustomerID
Date
Used
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
1
C001
2008-08-01
100000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
2
C001
2008-08-05
200000
C001
Win Weerachaiwin.weerachai@thaicreate.com
TH
1000000600000
3
C001
2008-08-10
300000


Sample3 การเลือกข้อมูลแบบเชื่อมตาราง customer และ audit และ CustomerID = C001 และแสดงผลเฉพาะตาราง audit

SELECT audit.* FROM customer,audit
WHERE customer.CustomerID = audit.CustomerID
AND customer.CustomerID = 'C001'

Output

AuditID
CustomerID
Date
Used
1
C001
2008-08-01
100000
2
C001
2008-08-05
200000
3
C001
2008-08-10
300000