Monday 25 May 2015

Computer Basics: 100 Sample Questions(solved)

· 1. All of the following are examples of real security and privacy risks EXCEPT:
A. hackers.
B. spam.
C. viruses.
D. identity theft.
Answer: B
2. A process known as ____________ is used by large retailers to study trends.
A. data mining
B. data selection
C. POS
D. data conversion
Answer: A
3. ____________terminals (formerly known as cash registers) are often connected to complex inventory and sales computer systems.
A. Data
B. Point-of-sale (POS)
C. Sales
D. Query
Answer: B
4. A(n) ____________ system is a small, wireless handheld computer that scans an item’s tag and pulls up the current price (and any special offers) as you shop.
A. PSS
B. POS
C. inventory
D. data mining
Answer: A
5. The ability to recover and read deleted or damaged files from a criminal’s computer is an example of a law enforcement specialty called:
A. robotics.
B. simulation.
C. computer forensics.
D. animation.
Answer: C
6. Which of the following is NOT one of the four major data processing functions of a computer?
A. gathering data
B. processing data into information
C. analyzing the data or information
D. storing the data or information
Answer: C
7. ____________ tags, when placed on an animal, can be used to record and track in a database all of the animal’s movements.
A. POS
B. RFID
C. PPS
D. GPS
Answer: B
8. Surgeons can perform delicate operations by manipulating devices through computers instead of manually. This technology is known as:
A. robotics.
B. computer forensics.
C. simulation.
D. forecasting.
Answer: A
9. Technology no longer protected by copyright, available to everyone, is considered to be:
A. proprietary.
B. open.
C. experimental.
D. in the public domain.
Answer: A
10. ____________ is the study of molecules and structures whose size ranges from 1 to 100 nanometers.
A. Nanoscience
B. Microelectrodes
C. Computer forensics
D. Artificial intelligence
Answer: A
11. ____________ is the science that attempts to produce machines that display the same type of intelligence that humans do.
A. Nanoscience
B. Nanotechnology
C. Simulation
D. Artificial intelligence (AI)
Answer: D
12. ____________ is data that has been organized or presented in a meaningful fashion.
A. A process
B. Software
C. Storage
D. Information
Answer: D
13. The name for the way that computers manipulate data into information is called:
A. programming.
B. processing.
C. storing.
D. organizing.
Answer: B
14. Computers gather data, which means that they allow users to ____________ data.
A. present
B. input
C. output
D. store
Answer: B
15. After a picture has been taken with a digital camera and processed appropriately, the actual print of the picture is considered:
A. data.
B. output.
C. input.
D. the process.
Answer: B
16. Computers use the ____________ language to process data.
A. processing
B. kilobyte
C. binary
D. representational
Answer: C
17. Computers process data into information by working exclusively with:
A. multimedia.
B. words.
C. characters.
D. numbers.
Answer: D
18. In the binary language each letter of the alphabet, each number and each special character is made up of a unique combination of:
A. eight bytes.
B. eight kilobytes.
C. eight characters.
D. eight bits.
Answer: D
19. The term bit is short for:
A. megabyte.
B. binary language.
C. binary digit.
D. binary number.
Answer: C
20. A string of eight 0s and 1s is called a:
A. megabyte.
B. byte.
C. kilobyte.
D. gigabyte.
Answer: B
21. A ____________ is approximately one billion bytes.
A. kilobyte
B. bit
C. gigabyte
D. megabyte
Answer: C
22. A ____________ is approximately a million bytes.
A. gigabyte
B. kilobyte
C. megabyte
D. terabyte
Answer: C
23. ____________ is any part of the computer that you can physically touch.
A. Hardware
B. A device
C. A peripheral
D. An application
Answer: A
24. The components that process data are located in the:
A. input devices.
B. output devices.
C. system unit.
D. storage component.
Answer: C
25. All of the following are examples of input devices EXCEPT a:
A. scanner.
B. mouse.
C. keyboard.
D. printer.
Answer: D
26. Which of the following is an example of an input device?
A. scanner
B. speaker
C. CD
D. printer
Answer: A
27. All of the following are examples of storage devices EXCEPT:
A. hard disk drives.
B. printers.
C. floppy disk drives.
D. CD drives.
Answer: B
28. The ____________, also called the “brains” of the computer, is responsible for processing data.
A. motherboard
B. memory
C. RAM
D. central processing unit (CPU)
Answer: D
29. The CPU and memory are located on the:
A. expansion board.
B. motherboard.
C. storage device.
D. output device.
Answer: B
30. Word processing, spreadsheet, and photo-editing are examples of:
A. application software.
B. system software.
C. operating system software.
D. platform software.
Answer: A
31. ____________ is a set of computer programs used on a computer to help perform tasks.
A. An instruction
B. Software
C. Memory
D. A processor
Answer: B
32. System software is the set of programs that enables your computer’s hardware devices and ____________ software to work together.
A. management
B. processing
C. utility
D. application
Answer: D
33. The PC (personal computer) and the Apple Macintosh are examples of two different:
A. platforms.
B. applications.
C. programs.
D. storage devices.
Answer: A
34. Apple Macintoshes (Macs) and PCs use different ____________ to process data and different operating systems.
A. languages
B. methods
C. CPUs
D. storage devices
Answer: C
35. Servers are computers that provide resources to other computers connected to a:
A. network.
B. mainframe.
C. supercomputer.
D. client.
Answer: A
36. Smaller and less expensive PC-based servers are replacing ____________ in many businesses.
A. supercomputers
B. clients
C. laptops
D. mainframes
Answer: D
37. ____________ are specially designed computers that perform complex calculations extremely rapidly.
A. Servers
B. Supercomputers
C. Laptops
D. Mainframes
Answer: B
38. DSL is an example of a(n) ____________ connection.
A. network
B. wireless
C. slow
D. broadband
Answer: D
39. The difference between people with access to computers and the Internet and those without this access is known as the:
A. digital divide.
B. Internet divide.
C. Web divide.
D. broadband divide.
Answer: A
40. ____________ is the science revolving around the use of nanostructures to build devices on an extremely small scale.
A. Nanotechnology
B. Micro-technology
C. Computer forensics
D. Artificial intelligence
Answer: A
41. Which of the following is the correct order of the four major functions of a computer?
A. Process à Output à Input à Storage
B. Input à Outputà Process à Storage
C. Process à Storage à Input à Output
D. Input à Process à Output à Storage
Answer: D
42. ____________ bits equal one byte.
A. Eight
B. Two
C. One thousand
D. One million
Answer: A
43. The binary language consists of ____________ digit(s).
A. 8
B. 2
C. 1,000
D. 1
Answer: B
44. A byte can hold one ____________ of data.
A. bit
B. binary digit
C. character
D. kilobyte
Answer: C
45. ____________ controls the way in which the computer system functions and provides a means by which users can interact with the computer.
A. The platform
B. The operating system
C. Application software
D. The motherboard
Answer: B
46. The operating system is the most common type of ____________ software.
A. communication
B. application
C. system
D. word-processing software
Answer: C
47. ____________ are specially designed computer chips that reside inside other devices, such as your car or your electronic thermostat.
A. Servers
B. Embedded computers
C. Robotic computers
D. Mainframes
Answer: B
48. The steps and tasks needed to process data, such as responses to questions or clicking an icon, are called:
A. instructions.
B. the operating system.
C. application software.
D. the system unit.
Answer: A
49. The two broad categories of software are:
A. word processing and spreadsheet.
B. transaction and application.
C. Windows and Mac OS.
D. system and application.
Answer: D
50. The metal or plastic case that holds all the physical parts of the computer is the:
A. system unit.
B. CPU.
C. mainframe.
D. platform.
Answer: A
Fill in the Blank:
51. Between PCs and Macs, the ____________ is the platform of choice for graphic design and animation.
Answer: Mac
52. The ____________ is the program that manages the hardware of the computer system, including the CPU, memory, storage devices, and input/output devices.
Answer: operating system
53. The type of operating system software you use depends on your computer’s ____________.
Answer: platform
54. ____________software helps you carry out tasks, such as typing a document or creating a spreadsheet.
Answer: Application
55. ____________are the fastest and most expensive computers.
Answer: Supercomputers
56. A ____________ is approximately 1,000 bytes.
Answer: kilobyte
57. Input devices are used to provide the steps and tasks the computer needs to process data, and these steps and tasks are called ____________.
Answer: instructions
58. A computer gathers data, processes it, outputs the data or information, and ____________ the data or information.
Answer: stores
59. The binary language consists of two digits: ____________ and ____________.
Answer: 0 and 1
60. A string of ____________ 0s and 1s is called a byte.
Answer: eight (8)
61. The devices you use to enter data into a computer system are known as ____________ devices.
Answer: input
62. The devices on a computer system that let you see the processed information are known as ____________ devices.
Answer: output
63. ____________ is the set of computer instructions or programs that enables the hardware to perform different tasks.
Answer: Software
64. When you connect to the ____________, your computer is communicating with a server at your Internet service provider (ISP).
Answer: Internet
65. ____________ are computers that excel at executing many different computer programs at the same time.
Answer: Mainframes
66. ____________is the application of computer systems and techniques to gather legal evidence.
Answer: Computer forensics
67. ____________ is the science that attempts to create machines that will emulate the human thought process.
Answer: Artificial intelligence (AI)
68. Macintosh computers use the Macintosh operating system (Mac OS), whereas PCs generally run ____________ as an operating system.
Answer: Microsoft Windows
69. A process known as ____________ tracks trends and allows retailers to respond to consumer buying patterns.
Answer: data mining
70. Hard disk drives and CD drives are examples of ____________ devices.
Answer: storage
71. You would use ____________ software to create spreadsheets, type documents, and edit photos.
Answer: application
72. ____________ are computers that support hundreds or thousands of users simultaneously.
Answer: Mainframes
73. ____________ is the term given to the act of stealing someone’s identity and ruining their credit rating.
Answer: Identity theft
74. Surgeons are using ____________ to guide robots to perform delicate surgery.
Answer: computers
75. Patient ____________ are life-sized mannequins that have a pulse and a heartbeat and respond to procedures just like humans.
Answer: simulators
True and False
76. Currently, the performance of tasks by robots is based on pre-programmed algorithms.
Answer: True
77. Data can be a number, a word, a picture, or a sound.
Answer: True
78. Strictly defined, a computer is a data processing device.
Answer: True
79. The discrepancy between the “haves” and “have-nots” with regard to computer technology is commonly referred to as the digital society.
Answer: False (digital divide)
80. One of the benefits of becoming computer fluent is being a savvy computer user and consumer and knowing how to avoid viruses, the programs that pose threats to computer security.
Answer: True
81. Trend-spotting programs, developed for business, have been used to predict criminal activity.
Answer: True
82. Employers do not have the right to monitor e-mail and network traffic on employee systems used at work.
Answer: False
83. Clicking on an icon with the mouse is a form of giving an instruction to the computer.
Answer: True
84. Output devices store instructions or data that the CPU processes.
Answer: False (memory)
85. The CPU and memory are located on a special circuit board in the system unit called the motherboard.
Answer: True
86. Nanostructures represent the smallest human-made structures that can be built.
Answer: True
87. The main difference between a supercomputer and a mainframe is that supercomputers are designed to execute a few programs as quickly as possible, whereas mainframes are designed to handle many programs running at the same time (but at a slower pace).
Answer: True
88. Being computer fluent means that you should be able to build a computer yourself.
Answer: False
89. Embedded computers are self-contained computer devices that have their own programming and do not receive input.
Answer: True
90. A Web browser is a special device that is installed in your computer that allows it to communicate with other devices on a network.
Answer: False (network adapter)
91. With a wireless network, it is easier to relocate devices.
Answer: True
92. The most common type of memory that the computer uses to process data is ROM.
Answer: False (RAM)
Matching:
93. Match the following terms with their approximate size:I. kilobyte A. one million bytes
II. byte B. eight bits
III. gigabyte C. one thousand bytes
IV. megabyte D. one billion bytes
V. terabyte E. one trillion bytes
Answer: C, B, D, A, E
94. Match the following terms with their meanings:I. printer A. storage device
II. scanner B. output device
III. RAM C. input device
IV. CPU D. a type of memory
V. CD drive E. processor
Answer: B, C, D, E, A
95. Match the following terms with their meanings:I. mainframe A. the most expensive computers that perform complex calculations extremely rapidly
II. supercomputer B. a computer that provides resources to other computers connected to a network
III. embedded computer C. a large, expensive computer that supports hundreds or thousands of users simultaneously
IV. PDA D. a self-contained computer device that usually performs preprogrammed functions such as temperature control
V. server E. a small mobile computing device
Answer: C, A, D, E, B
96. Match the following terms with their meanings:I. software A. transforming data into information
II. hardware B. data that has been organized or presented in a meaningful fashion
III. operating system C. any part of the computer that you can physically touch
IV. processing D. a set of computer programs that enables hardware to perform different tasks
V. information E. the most common type of system software, it controls the way in which the computer system functions
Answer: D, C, E, A, B
97. Match the following terms with their meanings:I. system software A. the set of programs that enables computer hardware devices and application software to work together
II. application software B. the kind of operating system software you will use depends on this
III. platform C. operating system software generally used on PCs
IV. Microsoft Windows D. a set of programs used to accomplish a specific task
V. Mac OS E. operating system software used on the Apple Macintosh
Answer: A, D, B, C, E
98. Match the following terms with their meanings:I. data A. the main circuit board in the system unit
II. memory B. the representation of a fact or idea (unprocessed information)
III. output C. processed data or information
IV. storage D. holds instructions or data that the CPU processes
V. motherboard E. data or information that can be accessed again
Answer: B, D, C, E, A
99. Match the following terms with their meanings:I. bit A. the science revolving around the use of nanostructures to build devices on an extremely small scale
II. binary language B. the case that contains the system components
III. instructions C. consists of 0s and 1s
IV. system unit D. short for binary digit
V. nanotechnology E. steps and tasks necessary to process data into usable information
Answer: D, C, E, B, A
100. Match the following fields to the related computer technology:I. medicine A. Internet research and virtual tours
II. business B. data mining
III. law enforcement C. robotics and simulation
IV. education D. computer forensics
V. archeology E. digital recreations of ruins
Answer: C, B, D, A, E

REASONING – SYLLOGISM

Based on the given Statements, You are required to evaluate which conclusion follows.
Mark 1. If the 1st statement follows
Mark 2. If the 2nd statement follows
Mark 3. If both follows
Mark 4. I f none follows

QUESTIONS

  1. Statement.1 All Doctors are engineers Statement.2 All Engineers are Advocates
Conclusion 1. All Advocates are Doctors Conclusion 2. All Doctors are Advocates
  1. Statement.1. Some Chairs are Furniture Statement.2. Some Furniture is Tables
Conclusion 1.Some Tables are Chairs Conclusion 2. Some furniture is chairs
  1. Statement.1. All flowers are buds Statement.2. No bud is bush
Conclusion 1. No bush is flower Conclusion 2. All flowers is flower
  1. Statement.1. No cat is elephant Statement.2. No elephant is animal
Conclusion 1. No cat is animal Conclusion 2. Some elephant is cat
  1. Statement.1. All monkeys are animals Statement.2. Anil is an animal
Conclusion 1. Anil is a monkey Conclusion 2. All monkey are animals
  1. Statement.1. Some Apples are bricks Statement.2. All grapes are bricks
Conclusion 1. Some Apples are grapes Conclusion 2. Al bricks are grapes
  1. Statement.1. All plants are trees Statement.2. No tree is stone
Conclusion 1. No stone is plants Conclusion 2. Some stones are plants
  1. Statement.1.All players are tall Statement.2.Rahul is tall
Conclusion 1. Rahul is player Conclusion 2. No player is tall
  1. Statement.1.All students read news paper Statement.2. Rahul doesn’t read newspaper
Conclusion 1. Rahul is a student. Conclusion 2. Rahul is not a student
  1. Statement.1. All rivers are ponds Statement.2. Some ponds are lakes
Conclusion 1. Some lakes are not ponds Conclusion 2. All lakes are rivers
  1. Statement.1All windows are doors Statement.2 No door is a bat
Conclusion 1. No window is bat `Conclusion 2. No bat is door
  1. Statement 1.All glasses are liquids Statement 2.All liquids are fluids
Conclusion 1. All glasses are fluids Conclusion 2. All fluids are glasses
  1. Statement 1. Some gold are bright. Statement 2. Some bright are silver
Conclusion 1. Some gold are silver Conclusion 2. Some bright are gold.
  1. Statement 1.All flowers are garden Statement. 2. All gardens are fruits.
Conclusion 1. All fruits are flowers Conclusion 2. All flowers are fruits.
  1. Statement 1. All poets are singers Statement 2. No singer is composer.
Conclusion 1. No composer is poet Conclusion 2. All singers are poet.
  1. Statement 1. All Tables are cupboards Statement 2. Some cupboards are chairs
Conclusion 1. Some chairs are Tables Conclusion 2. No chair is Table
  1. Statement 1. No tigers are rabbits Statement 2. No rabbit is a jackal
Conclusion 1. All tigers are jackal Conclusion 2. Some tigers are jackal
  1. Statement 1. Some blues are oranges Statement 2. Some oranges are green
Conclusion 1. Some blues are green Conclusion 2. No blue is green.
  1. Statement 1. Some hotels are teashop. Statement 2.All restaurants are teashop
Conclusion 1. Some Hotels are restaurants. Conclusion 2. No Hotel is restaurant.
  1. Statement 1. Some shops are footages Statement 2. All footages are slippers.
Conclusion 1. Some slippers are shops Conclusion 2. No slipper is shop
  1. Statement 1.No book is eraser Statement 2. Some erasers are not pens
Conclusion 1. Some books are pens Conclusion 2. Some erasers are pens.
  1. Statement.1.All MLAs are Ministers. Statement 2. No Minister is MP.
Conclusion 1. All MLAs are MPs. Conclusion 2. No MP is MLA
  1. Statement 1. Some Kings are queens Statement 2. All queens are bishops.
Conclusion 1. Some Kings are bishops Statement 2. All Kings are Bishops
  1. Statement 1.No teacher is Engineer Statement 2. Some engineers are not Doctor
Conclusion 1. All teachers are Doctors Conclusion 2. Some teachers are Doctors.
  1. Statement 1.All Politicians are Sociologist. Statement 2. All sociologists are fighters.
Conclusion 1. All politicians are fighters. Conclusion 2. Some fighters are Politicians.

Key and explanation

  1.  Answer is 2. Both are SAP type premises, hence, the conclusion may be SAP type. Incase of first conclusion the term ‘Advocate’ which is distributed is not distributed in question.
  2. Answer is 4. Both Statements are SIP type or particular. Hence, No conclusion is possible.
  3. Answer is 1. First statement is SAP and second statement is SEP, ie, Universal negative, from which we will get only SEP.
  4. Answer is 4. Combination Universal negative premises will produce no conclusion
  5. Answer is 4. The middle term ‘animal’ has not been distributed at least once in the premises.
  6. Answer is 4. The middle term ‘bricks’ has not been distributed at least once in the premises.
  7. Answer is 1. Combination of SAP (Universal positive) and SEP (universal negative) often produce SEP.
  8. Answer is 4. The middle term ‘tall’ is distributed at least once in the premises.
  9. Answer is 2. Combination of SAP (Universal positive) and SEP (universal negative) often produce SEP.
  10. Answer is 4. The middle term ‘ponds’ has not been distributed at least once in the premises
  11. Answer is 3. Combination of SAP and SEP produces SEP only.
  12. Answer is 1. In Second conclusion, the term ‘fluids’ is distributed which is not distributed in premises.
  13. Answer is 4. The middle term ‘ponds’ has not been distributed at least once in the premises. More over, the combination of SIP and SIP never produces any conclusion.
  14. Answer is 2. In first conclusion, the term ‘fruits’ is distributed which is not distributed in premises.
  15. Answer is 1. In Second conclusion, the term ‘singer’ is distributed which is not distributed in first premises.
  16. Answer is 4. The middle term ‘cupboard’ has not been distributed at least once in the premises.
  17. Answer is 4. More over, the combination of SEP and SEP produces nothing.
  18. Answer is 4. The middle term ‘oranges’ has not been distributed at least once in the premises. More over, the combination of SIP and SIP never produces any conclusion.
  19. Answer is 4. The middle term ‘teashop’ has not been distributed at least once in the premises.
  20. Answer is 1. In Second conclusion, the term ‘slipper’ is distributed which is not distributed in premises.
  21. Answer is 4. More over, the combination of two negative premises produces nothing.
  22. Answer is 2. Combination of SAP and SEP produces SEP only.
  23. Answer is 1. In Second conclusion, the term ‘kings’ is distributed which is not distributed in premises.
  24. Answer is 4. More over, the combination of two negative premises produces nothing.
  25. Answer is 3.
Short Cuts for MySQL Commands

Conventions used here:
  • MySQL key words are shown in CAPS
  • User-specified names are in small letters
  • Optional items are enclosed in square brackets [ ]
  • Items in parentheses must appear in the command, along with the parentheses
  • Items that can be repeated as often as desired are indicated by an ellipsis ...
Quoting in MySQL statments
  • Don't quote database, table, or column names
  • Don't quote column types or modifiers
  • Don't quote numerical values
  • Quote (single or double) non-numeric values
  • Quote file names and passwords
  • User names are NOT quoted in GRANT or REVOKE statements, but they are quoted in other statements.


General Commands
USE database_name
     
Change to this database. You need to change to some database when you first connect to MySQL.

SHOW DATABASES
     
Lists all MySQL databases on the system.

SHOW TABLES [FROM database_name]
     
Lists all tables from the current database or from the database given in the command.

DESCRIBE table_name
SHOW FIELDS FROM table_name
SHOW COLUMNS FROM table_name
     
These commands all give a list of all columns (fields) from the given table, along with column type and other info.

SHOW INDEX FROM table_name
     
Lists all indexes from this tables.

SET PASSWORD=PASSWORD('new_password')
     
Allows the user to set his/her own password.


Table Commands
CREATE TABLE table_name (create_clause1, create_clause2, ...)
     
Creates a table with columns as indicated in the create clauses.

     
create_clause
     
column name followed by column type, followed optionally by modifiers. For example, "gene_id INT AUTO_INCREMENT PRIMARY KEY" (without the quotes) creates a column of type integer with the modifiers described below.

     
create_clause modifiers
     
  • AUTO_INCREMENT : each data record is assigned the next sequential number when it is given a NULL value.
  • PRIMARY KEY : Items in this column have unique names, and the table is indexed automatically based on this column. One column must be the PRIMARY KEY, and only one column may be the PRIMARY KEY. This column should also be NOT NULL.
  • NOT NULL : No NULL values are allowed in this column: a NULL generates an error message as the data is inserted into the table.
  • DEFAULT value : If a NULL value is used in the data for this column, the default value is entered instead.

DROP TABLE table_name
     
Removes the table from the database. Permanently! So be careful with this command!

ALTER TABLE table_name ADD (create_clause1, create_clause2, ...)
     
Adds the listed columns to the table.

ALTER TABLE table_name DROP column_name
     
Drops the listed columns from the table.

ALTER TABLE table_name MODIFY create_clause
     
Changes the type or modifiers to a column. Using MODIFY means that the column keeps the same name even though its type is altered. MySQL attempts to convert the data to match the new type: this can cause problems.

ALTER TABLE table_name CHANGE column_name create_clause
     
Changes the name and type or modifiers of a column. Using CHANGE (instead of MODIFY) implies that the column is getting a new name.

ALTER TABLE table_name ADD INDEX [index_name] (column_name1, column_name2, ...)
CREATE INDEX index_name ON table_name (column_name1, column_name2, ...)
     
Adds an index to this table, based on the listed columns. Note that the order of the columns is important, because additional indexes are created from all subsets of the listed columns reading from left to write. The index name is optional if you use ALTER TABLE, but it is necesary if you use CREATE INDEX. Rarely is the name of an index useful (in my experience).


Data Commands
INSERT [INTO] table_name VALUES (value1, value2, ...)
     
Insert a complete row of data, giving a value (or NULL) for every column in the proper order.

INSERT [INTO] table_name (column_name1, column_name2, ...) VALUES (value1, value2, ...)
INSERT [INTO] table_name SET column_name1=value1, column_name2=value2, ...
     
Insert data into the listed columns only. Alternate forms, with the SET form showing column assignments more explicitly.

INSERT [INTO] table_name (column_name1, column_name2, ...) SELECT list_of_fields_from_another_table FROM other_table_name WHERE where_clause
     
Inserts the data resulting from a SELECT statement into the listed columns. Be sure the number of items taken from the old table match the number of columns they are put into!

DELETE FROM table_name WHERE where_clause
     
Delete rows that meet the conditions of the where_clause. If the WHERE statement is omitted, the table is emptied, although its structure remains intact.

UPDATE table_name SET column_name1=value1, column_name2=value2, ... [WHERE where_clause]
     
Alters the data within a column based on the conditions in the where_clause.

LOAD DATA LOCAL INFILE 'path to external file' INTO TABLE table_name
     
Loads data from the listed file into the table. The default assumption is that fields in the file are separated by tabs, and each data record is separated from the others by a newline. It also assumes that nothing is quoted: quote marks are considered to be part of the data. Also, it assumes that the number of data fields matches the number of table columns. Columns that are AUTO_INCREMENT should have NULL as their value in the file.

LOAD DATA LOCAL INFILE 'path to external file' [FIELDS TERMINATED BY 'termination_character'] [FIELDS ENCLOSED BY 'quoting character'] [LINES TERMINATED BY 'line termination character'] FROM table_name
     
Loads data from the listed file into the table, using the field termination character listed (default is tab \t), and/or the listed quoting character (default is nothing), and/or the listed line termination chacracter (default is a newline \n).

SELECT column_name1, column_name2, ... INTO OUTFILE 'path to external file' [FIELDS TERMINATED BY 'termination_character'] [FIELDS ENCLOSED BY 'quoting character'] [LINES TERMINATED BY 'line termination character'] FROM table_name [WHERE where_clause]
     
Allows you to move data from a table into an external file. The field and line termination clauses are the same as for LOAD above. Several tricky features:
  1. Note the positions of the table_name and where_clause, after the external file is given.
  2. You must use a complete path, not just a file name. Otherwise MySQL attempts to write to the directory where the database is stored, where you don't have permission to write.
  3. The user who is writing the file is 'mysql', not you! This means that user 'mysql' needs permission to write to the directory you specify. The best way to do that is to creat a new directory under your home directory, then change the directory's permission to 777, then write to it. For example: mkdir mysql_outputchmod 777 mysql_output.



Privilege Commands
Most of the commands below require MySQL root access

GRANT USAGE ON *.* TO user_name@localhost [IDENTIFIED BY 'password']
     
Creates a new user on MySQL, with no rights to do anything. The IDENTIFED BY clause creates or changes the MySQL password, which is not necessarily the same as the user's system password. The @localhost after the user name allows usage on the local system, which is usually what we do; leaving this off allows the user to access the database from another system. User name NOT in quotes.

GRANT SELECT ON *.* TO user_name@localhost
     
In general, unless data is supposed to be kept private, all users should be able to view it. A debatable point, and most databases will only grant SELECT privileges on particular databases. There is no way to grant privileges on all databses EXCEPT specifically enumerated ones.

GRANT ALL ON database_name.* TO user_name@localhost
     
Grants permissions on all tables for a specific database (database_name.*) to a user. Permissions are for: ALTER, CREATE, DELETE, DROP, INDEX, INSERT, SELECT, UPDATE.

FLUSH PRIVILEGES
     
Needed to get updated privileges to work immediately. You need RELOAD privileges to get this to work.

SET PASSWORD=PASSWORD('new_password')
     
Allows the user to set his/her own password.

REVOKE ALL ON [database_name.]* FROM user_name@localhost
     
Revokes all permissions for the user, but leaves the user in the MySQL database. This can be done for all databases using "ON *", or for all tables within a specific databse, using "ON database_name.*".

DELETE FROM mysql.user WHERE user='user_name@localhost'
     
Removes the user from the database, which revokes all privileges. Note that the user name is in quotes here.

UPDATE mysql.user SET password=PASSWORD('my_password') WHERE user='user_name'
     
Sets the user's password. The PASSWORD function encrypts it; otherwise it will be in plain text.

SELECT user, host, password, select_priv, insert_priv, shutdown_priv, grant_priv FROM mysql.user
     
A good view of all users and their approximate privileges. If there is a password, it will by an encrytped string; if not, this field is blank. Select is a very general privlege; insert allows table manipulation within a database; shutdown allows major system changes, and should only be usable by root; the ability to grant permissions is separate from the others.

SELECT user, host, db, select_priv, insert_priv, grant_priv FROM mysql.db
     
View permissions for individual databases.