Thursday, 15 January 2015

Database Keys

Introduction


Keys are, as their name suggests, a key part of a relational database and a vital part of the structure of a table. They ensure each record within a table can be uniquely identified by one or a combination of fields within the table. They help enforce integrity and help identify the relationship between tables. There are three main types of keys, candidate keys, primary keys and foreign keys. There is also an alternative key or secondary key that can be used, as the name suggests, as a secondary or alternative key to the primary key

Super Key

A Super key is any combination of fields within a table that uniquely identifies each record within that table.

Candidate Key

A candidate is a subset of a super key. A candidate key is a single field or the least combination of fields that uniquely identifies each record in the table. The least combination of fields distinguishes a candidate key from a super key. Every table must have at least one candidate key but at the same time can have several.
Candidate Kay
As an example we might have a student_id that uniquely identifies the students in a student table. This would be a candidate key. But in the same table we might have the student’s first name and last name that also, when combined, uniquely identify the student in a student table. These would both be candidate keys.
In order to be eligible for a candidate key it must pass certain criteria.
  • It must contain unique values
  • It must not contain null values
  • It contains the minimum number of fields to ensure uniqueness
  • It must uniquely identify each record in the table
Once your candidate keys have been identified you can now select one to be your primary key

Primary Key

A primary key is a candidate key that is most appropriate to be the main reference key for the table. As its name suggests, it is the primary key of reference for the table and is used throughout the database to help establish relationships with other tables. As with any candidate key the primary key must contain unique values, must never be null and uniquely identify each record in the table.
As an example, a student id might be a primary key in a student table, a department code in a table of all departments in an organisation. This module has the code DH3D 35 that is no doubt used in a database somewhere to identify RDBMS as a unit in a table of modules. In the table below we have selected the candidate key student_id to be our most appropriate primary key
Primary Key
Primary keys are mandatory for every table each record must have a value for its primary key. When choosing a primary key from the pool of candidate keys always choose a single simple key over a composite key.

Foreign Key

A foreign key is generally a primary key from one table that appears as a field in another where the first table has a relationship to the second. In other words, if we had a table A with a primary key X that linked to a table B where X was a field in B, then X would be a foreign key in B.
An example might be a student table that contains the course_id the student is attending. Another table lists the courses on offer with course_id being the primary key. The 2 tables are linked through course_id and as such course_id would be a foreign key in the student table.
Foreign Key

Secondary Key or Alternative Key

A table may have one or more choices for the primary key. Collectively these are known as candidate keys as discuss earlier. One is selected as the primary key. Those not selected are known as secondary keys or alternative keys.
For example in the table showing candidate keys above we identified two candidate keys, studentId and firstName + lastName. The studentId would be the most appropriate for a primary key leaving the other candidate key as secondary or alternative key. It should be noted for the other key to be candidate keys, we are assuming you will never have a person with the same first and last name combination. As this is unlikely we might consider fistName+lastName to be a suspect candidate key as it would be restrictive of the data you might enter.

Compound Key

A compound key consists of more than one field to uniquely identify a record. A compound key is distinguished from a composite key because each field, which makes up the primary key, is also a simple key in its own right. An example might be a table that represents the modules a student is attending. This table has a studentId and a moduleCode as its primary key. Each of the fields that make up the primary key are simple keys because each represents a unique reference when identifying a student in one instance and a module in the other.

Composite

A composite key consists of more than one field to uniquely identify a record. This differs from a compound key in that one or more of the attributes, which make up the key, are not simple keys in their own right. Taking the example from compound key, imagine we identified a student by their firstName + lastName. In our table representing students on modules our primary key would now be firstName + lastName + moduleCode. Because firstName + lastName represent a unique reference to a student, they are not each simple keys, they have to be combined in order to uniquely identify the student. Therefore the key for this table is a composite key.

TYPES OF COMPUTER LANGUAGE SOFTWARES 

Assembler

An assembler translates assembly language into machine code. Assembly language consists of mnemonics for machine opcodes so assemblers perform a 1:1 translation from mnemonic to a direct instruction. For example:
LDA #4 converts to 0001001000100100
Conversely, one instruction in a high level language will translate to one or more instructions at machine level.
Advantages of using an Assembler:
plus pointVery fast in translating assembly language to machine code as 1 to 1 relationship
plus pointAssembly code is often very efficient (and therefore fast) because it is a low level language
plus pointAssembly code is fairly easy to understand due to the use of English-like mnemonics

Disadvantages of using Assembler:
minus point Assembly language is written for a certain instruction set and/or processor
minus point Assembly tends to be optimised for the hardware it's designed for, meaning it is often incompatible with different hardware
minus point Lots of assembly code is needed to do relatively simple tasks, and complex programs require lots of programming time

Compiler

A Compiler is a computer program that translates code written in a high level language to a lower level language, object/machine code. The most common reason for translating source code is to create an executable program (converting from a high level language into machine language).
Advantages of using a compiler
plus pointSource code is not included, therefore compiled code is more secure than interpreted code
plus pointTends to produce faster code than interpreting source code
plus pointProduces an executable file, and therefore the program can be run without need of the source code

Disadvantages of using a compiler
minus point Object code needs to be produced before a final executable file, this can be a slow process
minus point The source code must be 100% correct for the executable file to be produced

Interpreter

An interpreter program executes other programs directly, running through program code and executing it line-by-line. As it analyses every line, an interpreter is slower than running compiled code but it can take less time to interpret program code than to compile and then run it — this is very useful when prototyping and testing code. Interpreters are written for multiple platforms, this means code written once can be run immediately on different systems without having to recompile for each. Examples of this include flash based web programs that will run on your PC, MAC, games console and Mobile phone.
Advantages of using an Interpreter
plus pointEasier to debug(check errors) than a compiler
plus pointEasier to create multi-platform code, as each different platform would have an interpreter to run the same code
plus pointUseful for prototyping software and testing basic program logic

Disadvantages of using an Interpreter
minus point Source code is required for the program to be executed, and this source code can be read making it insecure
minus point Interpreters are generally slower than compiled programs due to the per-line translation method

REGISTERS 


 Register are used to quickly accept, store, and transfer data and instructions that are being used immediately by the CPU, there are various types of Registers those are used for various purpose. Among of the some Mostly used Registers named as AC or Accumulator, Data Register or DR, the AR or Address Register, program counter (PC), Memory Data Register (MDR) ,Index register,Memory Buffer Register.
These Registers are used for performing the various Operations. While we are working on the System then these Registers are used by the CPU for Performing the Operations. When We Gives Some Input to the System then the Input will be Stored into the Registers and When the System will gives us the Results after Processing then the Result will also be from the Registers. So that they are used by the CPU for Processing the Data which is given by the User. Registers Perform:-
 
1)    Fetch: The Fetch Operation is used for taking the instructions those are given by the user and the Instructions those are stored into the Main Memory will be fetch by using Registers.
 
2)    Decode: The Decode Operation is used for interpreting the Instructions means the Instructions are decoded means the CPU will find out which Operation is to be performed on the Instructions.
 
3)    Execute: The Execute Operation is performed by the CPU. And Results those are produced by the CPU are then Stored into the Memory and after that they are displayed on the user Screen.
 

Types of Registers are as Followings

 

MAR stand for Memory Address Register

 
This register holds the memory addresses of data and instructions. This register is used to access data and instructions from memory during the execution phase of an instruction. Suppose CPU wants to store some data in the memory or to read the data from the memory. It places the address of the-required memory location in the MAR.
 

Program Counter

 
The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 microprocessors, and sometimes called the instruction address register, or just part of the instruction sequencer in some computers, is a processor register
It is a 16 bit special function register in the 8085 microprocessor. It keeps track of the the next memory address of the instruction that is to be executed once the execution of the current instruction is completed. In other words, it holds the address of the memory location of the next instruction when the current instruction is executed by the microprocessor.
 

Accumulator Register

 
This Register is used for storing the Results those are produced by the System. When the CPU will generate Some Results after the Processing then all the Results will be Stored into the AC Register.
 

Memory Data Register (MDR)

 
MDR is the register of a computer's control unit that contains the data to be stored in the computer storage (e.g. RAM), or the data after a fetch from the computer storage. It acts like a buffer and holds anything that is copied from the memory ready for the processor to use it. MDR hold the information before it goes to the decoder.
 
MDR which contains the data to be written into or readout of the addressed location. For example, to retrieve the contents of cell 123, we would load the value 123 (in binary, of course) into the MAR and perform a fetch operation. When the operation is done, a copy of the contents of cell 123 would be in the MDR. To store the value 98 into cell 4, we load a 4 into the MAR and a 98 into the MDR and perform a store. When the operation is completed the contents of cell 4 will have been set to 98, by discarding whatever was there previously.
 
The MDR is a two-way register. When data is fetched from memory and placed into the MDR, it is written to in one direction. When there is a write instruction, the data to be written is placed into the MDR from another CPU register, which then puts the data into memory.
 
The Memory Data Register is half of a minimal interface between a micro program and computer storage, the other half is a memory address register.
 

Index Register

 
A hardware element which holds a number that can be added to (or, in some cases, subtracted from) the address portion of a computer instruction to form an effective address. Also known as base register. An index register in a computer's CPU is a processor register used for modifying operand addresses during the run of a program.
 

Memory Buffer Register

 
MBR stand for Memory Buffer Register. This register holds the contents of data or instruction read from, or written in memory. It means that this register is used to store data/instruction coming from the memory or going to the memory.
 

Data Register

 
A register used in microcomputers to temporarily store data being transmitted to or from a peripheral device.

COMPUTER SOFTWARES AND THEIR TYPES


Computer software, or simply software is any set of machine-readable instructions that directs a computer's processor to perform specific operations. Computer software contrasts with computer hardware, which is the physical component of computers. Computer hardware and software require each other and neither can be realistically used without the other. Using a musical analogy, hardware is like a musical instrument and software is like the notes played on that instrument.
software written in a machine language is known as "machine code". However, in practice, software is usually written in high-level programming languages that are easier and more efficient for humans to use (closer to natural language) than machine language.[2] High-level languages are translated, using compilation or interpretation or a combination of the two, into machine language. Software may also be written in a low-level assembly language, essentially, a vaguely mnemonic representation of a machine language using a natural language alphabet. Assembly language is translated into machine code using an assembler.

Purpose, or domain of use

Based on the goal, computer software can be divided into:
  • Application software, which uses the computer system to perform special functions or provide entertainment functions beyond the basic operation of the computer itself. There are many different types of application software, because the range of tasks that can be performed with a modern computer is so large - see list of software.
  • System software, which is designed to directly operate the computer hardware, to provide basic functionality needed by users and other software, and to provide a platform for running application software.[3] System software includes:
    • Operating systems, which are essential collections of software that manage resources and provides common services for other software that runs "on top" of them. Supervisory programs, boot loaders, shells and window systems are core parts of operating systems. In practice, an operating system comes bundled with additional software (including application software) so that a user can potentially do some work with a computer that only has an operating system.
    • Device drivers, which operate or control a particular type of device that is attached to a computer. Each device needs at least one corresponding device driver; because a computer typically has at minimum at least one input device and at least one output device, a computer typically needs more than one device driver.
    • Utilities, which are computer programs designed to assist users in maintenance and care of their computers.
  • Malicious software or malware, which are computer programs developed to harm and disrupt computers. As such, malware is undesirable. Malware is closely associated with computer-related crimes, though some malicious programs may have been designed as practical jokes.

Wednesday, 14 January 2015

Computer-aided design



Example: 2D CAD drawing

Example: 3D CAD model

CAD rendering of Sialk ziggurat based on archeological evidence
Computer-aided design (CAD) is the use of computer systems to assist in the creation, modification, analysis, or optimization of a design.[1] CAD software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing.[2] CAD output is often in the form of electronic files for print, machining, or other manufacturing operations.
Computer-aided design is used in many fields. Its use in designing electronic systems is known as electronic design automation, or EDA. In mechanical design it is known as mechanical design automation (MDA) or computer-aided drafting (CAD), which includes the process of creating a technical drawing with the use of computer software.[3]
CAD software for mechanical design uses either vector-based graphics to depict the objects of traditional drafting, or may also produce raster graphics showing the overall appearance of designed objects. However, it involves more than just shapes. As in the manual drafting of technical and engineering drawings, the output of CAD must convey information, such as materials, processes, dimensions, and tolerances, according to application-specific conventions.
CAD may be used to design curves and figures in two-dimensional (2D) space; or curves, surfaces, and solids in three-dimensional (3D) space.[4]
CAD is an important industrial art extensively used in many applications, including automotive, shipbuilding, and aerospace industries, industrial and architectural design, prosthetics, and many more. CAD is also widely used to produce computer animation for special effects in movies, advertising and technical manuals, often called DCC digital content creation. The modern ubiquity and power of computers means that even perfume bottles and shampoo dispensers are designed using techniques unheard of by engineers of the 1960s. Because of its enormous economic importance, CAD has been a major driving force for research in computational geometry, computer graphics (both hardware and software), and discrete differential geometry.[5]
The design of geometric models for object shapes, in particular, is occasionally called computer-aided geometric design (CAGD).[6]




COMMUNICATIION MEDIA


·         It is a pathway that is used form transferring data from sender to receiver.
·         These paths are called communication channels

GUIDED MEDIA

·         It refers to communication channels that allow the transmission of data through a physical media
·         These are also called bounded media

·         Examples are twisted pair , coaxial and Fiber Optic

TWISTED PAIR

·         These are used in local communication and short distance digital transmission
·         It is made of copper and pair of wires are twisted together to reduce the interference by adjacent wires
·         These are used to connect terminals to the main computer place at a very short distance
·         Data transmission speed is up to 9600 bps if the distance is not more than 100 meters
·         It is an expensive medium for transmission
·         It is easy to install
·         Its bandwidth is less than coaxial and fiber optic cable

CO AXIAL;

ADVANTAGES;
·         It can be used for long distance telephone lines for data and voice transmission at a very high frequency
·         The bandwidth of coaxial cable is 80 times greater than twisted pair media
·         It is also used in LAN 
·         It has a low transmission error rate i.e. it creates less distortion or less interface of electromagnetic waves

STRUCTURE;
·         It consists of copper wire surrounded by insulating material.
·         It contains 4 to 22 coaxial units called tubes.
·         Each coaxial unit consists of 1.0 inch copper inner conductor kept centered within 0.375 inch cylindrical copper outer conductor by polythene insulating disks spaced about 1 inch apart.

FIBRE OPTIC:

STRUCTURE:
·         Fiber optic cable consists of tubes of glass through which data is transmitted as pulse of light.
·         A normal fiber optic is fibre of glass called the core . The diameter of core is 62.5 micron
·         The core is surrounded by concentric layers of glass called the cladding . The diameter of cladding is 125 micvron.
·         The cladding is surrounded by a plastic layer called jacket

CHARACTERISTIC OF FIBRE OPTIC :
·         Refraction is the characteristic of fibre optic i.e either pass or rreflect the light.
·         When lght passes through a medium , it bensd as it passes from one medium to another

ADVANTAGES :
·         ITS TRANSMISSSION IS VERY FAST
·         It is not affected by electromagnetism interference
·         Its error rate is low
UNGUIDED MEDIA ;
The type of Communication media in which communication devices sends and receives data signals through air or space is called Unguided media. The data is communicated in the form of wave. Unguided media provides means to transmit data signals but does not guide them along a specific path. The data signals are not bounded to a cabling media. Therefore, unguided media is also called Unbounded media.

This transmission medium is used when it is impossible to install the cables.The data can be transmitted all over the world through this medium. The examples of unguided media are:

  1. Microwave
  2. Satellite Communication
  3. Mobile Communication
1- Microwave     In microwave transmission, data is transmitted through air or space, instead of through cables or wires. Microwaves are high frequency radio waves. Microwave uses line-of-sight transmission through space. The line-of-sight means that data signals (or waves) can only travel in straight lines and cannot bend.

The data is transmitted and received through a microwave station. A microwave station is also called relay station or booster. A microwave station contains an antenna, transmitter, receiver, and other equipments that are required for microwave transmission. Microwave antennas are placed on the high towers or buildings. These are placed within 20 to 30 miles of each other. there may be many microwave stations between the sender and receiver. data is transmitted from one microwave station to another. Each microwave station receives signals from previous microwave station and transmits to next station. In this way, data is transmitted over larger distances.

2- Satellite Communication
    Satellite communication system consists of a satellite and several earth stations. The communication satellite is a space station. It is approximately 22,300 miles above the earth. Each earth station consists of large dish antenna. It can send and receive data signals.

A satellite receives microwave signals (or messages) from earth station. It amplifies the signals and sends them to another earth station. In this way, data is transferred from one location to another. Data transmission speed of satellite is very fast.

Advantage: The main advantage of satellite communication system is that a large amount of data can be communicated from one country to another.

Disadvantage: The disadvantage of satellite communication is that bad weather can affect the quality of satellite transmission.

3- Mobile Communication
    Mobile communication is a radio-based network. It sends and receives data to and from the mobile computers. The data is communicated through radio signals from one location to another. The Computers can be connected to the network through wireless connections or through wires.

Data transmission

Data transmission or digital communications is the physical transfer of data (a digital bit stream or a digitized analog signal[1]) over a point-to-point or point-to-multipoint communication channel. Examples : 
Examples of such channels are copper wires, optical fibres, wireless communication channels, storage media and computer buses

Types Of Data Transmission : 

Serial and parallel transmission

In telecommunications, serial transmission is the sequential transmission of signal elements of a group representing a character or other entity of data. Digital serial transmissions are bits sent over a single wire, frequency or optical path sequentially. Because it requires less signal processing and less chances for error than parallel transmission, the transfer rate of each individual path may be faster. This can be used over longer distances as a check digit or parity bit can be sent along it easily.
In telecommunications, parallel transmission is the simultaneous transmission of the signal elements of a character or other entity of data. In digital communications, parallel transmission is the simultaneous transmission of related signal elements over two or more separate paths. Multiple electrical wires are used which can transmit multiple bits simultaneously, which allows for higher data transfer rates than can be achieved with serial transmission. This method is used internally within the computer, for example the internal buses, and sometimes externally for such things as printers,
Asynchronous transmission uses start and stop bits to signify the beginning bit[citation needed] ASCII character would actually be transmitted using 10 bits. For example, "0100 0001" would become "1 0100 0001 0". The extra one (or zero, depending on parity bit) at the start and end of the transmission tells the receiver first that a character is coming and secondly that the character has ended. This method of transmission is used when data are sent intermittently as opposed to in a solid stream. In the previous example the start and stop bits are in bold. The start and stop bits must be of opposite polarity.[citation needed] This allows the receiver to recognize when the second packet of information is being sent.
Synchronous transmission uses no start and stop bits, but instead synchronizes transmission speeds at both the receiving and sending end of the transmission using clock signal(s) built into each component.[vague] A continual stream of data is then sent between the two nodes. Due to there being no start and stop bits the data transfer rate is quicker although more errors will occur, as the clocks will eventually get out of sync, and the receiving device would have the wrong time that had been agreed in the protocol for sending/receiving data, so some bytes could become corrupted (by losing bits).[citation needed] Ways to get around this problem include re-synchronization of the clocks and use of check digits to ensure the byte is correctly interpreted and received