Different types of Storage Engine and Table types in MySQL are below:
1. The MyISAM Storage Engine
2. The InnoDB Storage Engine
3. The MERGE Storage Engine
4. The MEMORY (HEAP) Storage Engine
5. The BDB (BerkeleyDB) Storage Engine
6. The EXAMPLE Storage Engine
7. The ARCHIVE Storage Engine
8. The CSV Storage Engine
9. The BLACKHOLE Storage Engine
10. The ISAM Storage Engine
Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts
Monday, October 6, 2008
Wednesday, September 10, 2008
MySQL Joins with Examples
Sample Records for explain the Joins :

Inner Join or Equi-join
An inner join requires each record in the two joined tables to have a matching record. An inner join essentially combines the records from two tables (A and B) based on a given join-predicate. The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B) - then return all records which satisfy the join predicate.

Example of an explicit inner join:
SELECT *
FROM employee
INNER JOIN department
ON employee.DepartmentID = department.DepartmentID
Example of an implicit inner join:
2. SELECT *
FROM employee, department
WHERE employee.DepartmentID = department.DepartmentID
Types of inner joins
i) Natural join
A natural join offers a further specialization of equi-joins. The join predicate arises implicitly by comparing all columns in both tables that have the same column-name in the joined tables. The resulting joined table contains only one column for each pair of equally-named columns.

Ex:
SELECT *
FROM employee NATURAL JOIN department
ii) Cross join
A cross join, cartesian join or product provides the foundation upon which all types of inner joins operate. A cross join returns the cartesian product of the sets of records from the two joined tables. Thus, it equates to an inner join where the join-condition always evaluates to True or join-condition is absent in statement.
If A and B are two sets, then the cross join is written as A × B.

Example of an explicit cross join:
SELECT *
FROM employee CROSS JOIN department
Example of an implicit cross join:
SELECT *
FROM employee, department;
Outer Join
An outer join does not require each record in the two joined tables to have a matching record. The joined table retains each record—even if no other matching record exists. Outer joins subdivide further into left outer joins, right outer joins, and full outer joins, depending on which table(s) one retains the rows from (left, right, or both).
i) Left outer join
The result of a left outer join (or simply left join) for tables A and B always contains all records of the "left" table (A), even if the join-condition does not find any matching record in the "right" table (B). This means that if the ON clause matches 0 (zero) records in B, the join will still return a row in the result—but with NULL in each column from B. This means that a left outer join returns all the values from the left table, plus matched values from the right table (or NULL in case of no matching join predicate).

Syntax for LEFT JOIN
SELECT field1, field2, field3
FROM first_table
LEFT JOIN second_table
ON first_table.keyfield = second_table.foreign_keyfield
Ex: SELECT * FROM table1
LEFT JOIN table2 ON table1.id=table2.id
LEFT JOIN table3 ON table2.id=table3.id;
Ex:
SELECT *
FROM employee LEFT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
ii) Right outer join
A right outer join (or right join) closely resembles a left outer join, except with the tables reversed. Every record from the "right" table (B) will appear in the joined table at least once. If no matching row from the "left" table (A) exists, NULL will appear in columns from A for those records that have no match in A.
A right outer join returns all the values from the right table and matched values from the left table (NULL in case of no matching join predicate).

Syntax for RIGHT JOIN
SELECT field1, field2, field3
FROM first_table
RIGHT JOIN second_table
ON first_table.keyfield = second_table.foreign_keyfield
Ex: SELECT * FROM table1
RIGHT JOIN table2 ON table1.id=table2.id
RIGHT JOIN table3 ON table2.id=table3.id;
Ex:
SELECT *
FROM employee RIGHT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
iii) Full outer join
A full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side.

Ex:
SELECT *
FROM employee
FULL OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
Self Join
A self-join is a query in which a table is joined (compared) to itself. Self-joins are used to compare values in a column with other values in the same column in the same table. One practical use for self-joins: obtaining running counts and running totals in an SQL query.
To write the query, select from the same table listed twice with different aliases, set up the comparison, and eliminate cases where a particular value would be equal to itself.
Ex:
Which customers are located in the same state (column name is Region)? Type this statement in the SQL window:
SELECT DISTINCT c1.ContactName, c1.Address, c1.City, c1.Region
FROM Customers AS c1, Customers AS c2
WHERE c1.Region = c2.Region
AND c1.ContactName <> c2.ContactName
ORDER BY c1.Region, c1.ContactName;
Reference Sites
1. Wikipedia.org
2. cristhianny.com
3. W3Shoool.com

Inner Join or Equi-join
An inner join requires each record in the two joined tables to have a matching record. An inner join essentially combines the records from two tables (A and B) based on a given join-predicate. The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B) - then return all records which satisfy the join predicate.

Example of an explicit inner join:
SELECT *
FROM employee
INNER JOIN department
ON employee.DepartmentID = department.DepartmentID
Example of an implicit inner join:
2. SELECT *
FROM employee, department
WHERE employee.DepartmentID = department.DepartmentID
Types of inner joins
i) Natural join
A natural join offers a further specialization of equi-joins. The join predicate arises implicitly by comparing all columns in both tables that have the same column-name in the joined tables. The resulting joined table contains only one column for each pair of equally-named columns.

Ex:
SELECT *
FROM employee NATURAL JOIN department
ii) Cross join
A cross join, cartesian join or product provides the foundation upon which all types of inner joins operate. A cross join returns the cartesian product of the sets of records from the two joined tables. Thus, it equates to an inner join where the join-condition always evaluates to True or join-condition is absent in statement.
If A and B are two sets, then the cross join is written as A × B.

Example of an explicit cross join:
SELECT *
FROM employee CROSS JOIN department
Example of an implicit cross join:
SELECT *
FROM employee, department;
Outer Join
An outer join does not require each record in the two joined tables to have a matching record. The joined table retains each record—even if no other matching record exists. Outer joins subdivide further into left outer joins, right outer joins, and full outer joins, depending on which table(s) one retains the rows from (left, right, or both).
i) Left outer join
The result of a left outer join (or simply left join) for tables A and B always contains all records of the "left" table (A), even if the join-condition does not find any matching record in the "right" table (B). This means that if the ON clause matches 0 (zero) records in B, the join will still return a row in the result—but with NULL in each column from B. This means that a left outer join returns all the values from the left table, plus matched values from the right table (or NULL in case of no matching join predicate).

Syntax for LEFT JOIN
SELECT field1, field2, field3
FROM first_table
LEFT JOIN second_table
ON first_table.keyfield = second_table.foreign_keyfield
Ex: SELECT * FROM table1
LEFT JOIN table2 ON table1.id=table2.id
LEFT JOIN table3 ON table2.id=table3.id;
Ex:
SELECT *
FROM employee LEFT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
ii) Right outer join
A right outer join (or right join) closely resembles a left outer join, except with the tables reversed. Every record from the "right" table (B) will appear in the joined table at least once. If no matching row from the "left" table (A) exists, NULL will appear in columns from A for those records that have no match in A.
A right outer join returns all the values from the right table and matched values from the left table (NULL in case of no matching join predicate).

Syntax for RIGHT JOIN
SELECT field1, field2, field3
FROM first_table
RIGHT JOIN second_table
ON first_table.keyfield = second_table.foreign_keyfield
Ex: SELECT * FROM table1
RIGHT JOIN table2 ON table1.id=table2.id
RIGHT JOIN table3 ON table2.id=table3.id;
Ex:
SELECT *
FROM employee RIGHT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
iii) Full outer join
A full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side.

Ex:
SELECT *
FROM employee
FULL OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
Self Join
A self-join is a query in which a table is joined (compared) to itself. Self-joins are used to compare values in a column with other values in the same column in the same table. One practical use for self-joins: obtaining running counts and running totals in an SQL query.
To write the query, select from the same table listed twice with different aliases, set up the comparison, and eliminate cases where a particular value would be equal to itself.
Ex:
Which customers are located in the same state (column name is Region)? Type this statement in the SQL window:
SELECT DISTINCT c1.ContactName, c1.Address, c1.City, c1.Region
FROM Customers AS c1, Customers AS c2
WHERE c1.Region = c2.Region
AND c1.ContactName <> c2.ContactName
ORDER BY c1.Region, c1.ContactName;
Reference Sites
1. Wikipedia.org
2. cristhianny.com
3. W3Shoool.com
Syntax for MySQL joins
JOIN Syntax
MySQL supports the following JOIN syntaxes for the table_references part of SELECT statements.
table_reference, table_reference
table_reference [INNER | CROSS] JOIN table_reference [join_condition]
table_reference STRAIGHT_JOIN table_reference
table_reference LEFT [OUTER] JOIN table_reference join_condition
table_reference NATURAL [LEFT [OUTER]] JOIN table_reference
{ ON table_reference LEFT OUTER JOIN table_reference
ON conditional_expr }
table_reference RIGHT [OUTER] JOIN table_reference join_condition
table_reference NATURAL [RIGHT [OUTER]] JOIN table_reference
table_reference is defined as:
tbl_name [[AS] alias]
[{USE|IGNORE|FORCE} INDEX (key_list)]
join_condition is defined as:
ON conditional_expr | USING (column_list)
MySQL supports the following JOIN syntaxes for the table_references part of SELECT statements.
table_reference, table_reference
table_reference [INNER | CROSS] JOIN table_reference [join_condition]
table_reference STRAIGHT_JOIN table_reference
table_reference LEFT [OUTER] JOIN table_reference join_condition
table_reference NATURAL [LEFT [OUTER]] JOIN table_reference
{ ON table_reference LEFT OUTER JOIN table_reference
ON conditional_expr }
table_reference RIGHT [OUTER] JOIN table_reference join_condition
table_reference NATURAL [RIGHT [OUTER]] JOIN table_reference
table_reference is defined as:
tbl_name [[AS] alias]
[{USE|IGNORE|FORCE} INDEX (key_list)]
join_condition is defined as:
ON conditional_expr | USING (column_list)
Labels:
mysql,
Mysql Joins with example,
Syntax for joins
Introduction to MySQL Joins
What is Join?
An SQL JOIN clause combines records from two tables in a relational database, resulting in a new, temporary table, sometimes called a "joined table". A JOIN may also be thought of as a SQL operation that relates tables by means of values common between them. SQL specifies four types of JOIN: INNER, OUTER, LEFT, and RIGHT.
Types of Joins?
1. LEFT OUTER JOIN (or simply LEFT JOIN)
2. RIGHT OUTER JOIN (or simply RIGHT JOIN)
3. INNER JOIN or (EQUI JOIN)
4. CROSS JOIN
5. FULL OUTER JOIN
6. NATURAL JOIN
7. SELF JOIN
Reference Sites :
1. Wikipedia.org
An SQL JOIN clause combines records from two tables in a relational database, resulting in a new, temporary table, sometimes called a "joined table". A JOIN may also be thought of as a SQL operation that relates tables by means of values common between them. SQL specifies four types of JOIN: INNER, OUTER, LEFT, and RIGHT.
Types of Joins?
1. LEFT OUTER JOIN (or simply LEFT JOIN)
2. RIGHT OUTER JOIN (or simply RIGHT JOIN)
3. INNER JOIN or (EQUI JOIN)
4. CROSS JOIN
5. FULL OUTER JOIN
6. NATURAL JOIN
7. SELF JOIN
Reference Sites :
1. Wikipedia.org
Thursday, September 4, 2008
History of MySQL
History of MySQL
We started out with the intention of using the mSQL database system to connect to our tables using our own fast low-level (ISAM) routines. However, after some testing, we came to the conclusion that mSQL was not fast enough or flexible enough for our needs. This resulted in a new SQL interface to our database but with almost the same API interface as mSQL. This API was designed to allow third-party code that was written for use with mSQL to be ported easily for use with MySQL.
MySQL is named after co-founder Monty Widenius's daughter, My.
The name of the MySQL Dolphin (our logo) is “Sakila,” which was chosen by the founders of MySQL AB from a huge list of names suggested by users in our “Name the Dolphin” contest. The winning name was submitted by Ambrose Twebaze, an Open Source software developer from Swaziland, Africa. According to Ambrose, the feminine name Sakila has its roots in SiSwati, the local language of Swaziland. Sakila is also the name of a town in Arusha, Tanzania, near Ambrose's country of origin, Uganda.
We started out with the intention of using the mSQL database system to connect to our tables using our own fast low-level (ISAM) routines. However, after some testing, we came to the conclusion that mSQL was not fast enough or flexible enough for our needs. This resulted in a new SQL interface to our database but with almost the same API interface as mSQL. This API was designed to allow third-party code that was written for use with mSQL to be ported easily for use with MySQL.
MySQL is named after co-founder Monty Widenius's daughter, My.
The name of the MySQL Dolphin (our logo) is “Sakila,” which was chosen by the founders of MySQL AB from a huge list of names suggested by users in our “Name the Dolphin” contest. The winning name was submitted by Ambrose Twebaze, an Open Source software developer from Swaziland, Africa. According to Ambrose, the feminine name Sakila has its roots in SiSwati, the local language of Swaziland. Sakila is also the name of a town in Arusha, Tanzania, near Ambrose's country of origin, Uganda.
List of DBMS, RDBMS Databases
What is an DBMS Relation? Codd's Rule
List of DBMS Database
A DBMS is a complex set of software programs that controls the organization, storage, management,
and retrieval of data in a database. DBMS are categorized according to their data structures or types.
It is a set of prewritten programs that are used to store, update and retrieve a Database.
o dBase
o FrontBase
o filePro
List of RDBMS Database
* 4th Dimension
* Adabas D
* Alpha_Five
* CA-Datacom
* CSQL
* Daffodil database
* Dataphor
* DB2
* Derby aka Java DB
* EnterpriseDB
* eXtremeDB
* FileMaker Pro
* Firebird
* Foxpro 2
* Gladius DB
* Greenplum
* H2
* Helix database
* HSQLDB
* Informix
* Ingres
* InterBase
* Kognitio
* Linter
* MaxDB
* Mckoi SQL Database
* Microsoft Access
* Microsoft Jet Database Engine (part of Microsoft Access)
* Microsoft SQL Server
* Microsoft SQL Server Express
* Microsoft Visual FoxPro
* Mimer SQL
* MonetDB
* mSQL
* MySQL
* Netezza
* NonStop SQL
* Openbase
* OpenLink Virtuoso (Open Source Edition)
* OpenLink Virtuoso Universal Server
* Oracle
* Oracle Rdb for OpenVMS
* Paradox
* Pervasive
* PostgreSQL
* Progress 4GL
* Sav Zigzag
* ScimoreDB
* SmallSQL
* solidDB
* SQLBase
* SQLite
* Sybase Adaptive Server Enterprise
* Sybase Adaptive Server IQ
* Sybase SQL Anywhere (formerly known as Sybase Adaptive Server Anywhere and Watcom SQL)
* tdbengine
* Teradata
* TimesTen
* txtSQL
* Valentina (Database)
* Vertica
* VMDS
Note : All the Databases in RDBMS is also a DBMS.
List of DBMS Database
A DBMS is a complex set of software programs that controls the organization, storage, management,
and retrieval of data in a database. DBMS are categorized according to their data structures or types.
It is a set of prewritten programs that are used to store, update and retrieve a Database.
o dBase
o FrontBase
o filePro
List of RDBMS Database
* 4th Dimension
* Adabas D
* Alpha_Five
* CA-Datacom
* CSQL
* Daffodil database
* Dataphor
* DB2
* Derby aka Java DB
* EnterpriseDB
* eXtremeDB
* FileMaker Pro
* Firebird
* Foxpro 2
* Gladius DB
* Greenplum
* H2
* Helix database
* HSQLDB
* Informix
* Ingres
* InterBase
* Kognitio
* Linter
* MaxDB
* Mckoi SQL Database
* Microsoft Access
* Microsoft Jet Database Engine (part of Microsoft Access)
* Microsoft SQL Server
* Microsoft SQL Server Express
* Microsoft Visual FoxPro
* Mimer SQL
* MonetDB
* mSQL
* MySQL
* Netezza
* NonStop SQL
* Openbase
* OpenLink Virtuoso (Open Source Edition)
* OpenLink Virtuoso Universal Server
* Oracle
* Oracle Rdb for OpenVMS
* Paradox
* Pervasive
* PostgreSQL
* Progress 4GL
* Sav Zigzag
* ScimoreDB
* SmallSQL
* solidDB
* SQLBase
* SQLite
* Sybase Adaptive Server Enterprise
* Sybase Adaptive Server IQ
* Sybase SQL Anywhere (formerly known as Sybase Adaptive Server Anywhere and Watcom SQL)
* tdbengine
* Teradata
* TimesTen
* txtSQL
* Valentina (Database)
* Vertica
* VMDS
Note : All the Databases in RDBMS is also a DBMS.
Labels:
doubts,
List of DBMS and RDBMS Databases,
mysql
General info in PHP, MySQL
Do you know this?
- E.F. Codd released his Codd's rule in 1970 at the time of working in IBM's San Jose Research Laboratory
- Structured Query Language (SQL), developed by Donald D. Chamberlin and Raymond F. Boyce, for expressing queries at IBM's San Jose Research Laboratory in early 1970's
- Raymond F. Boyce also worked with Codd to develop the Boyce-Codd Normal Form for efficiently designing relational database tables so information was not needlessly duplicated in different tables.
- SQL was initially called as SEQUEL, was designed to manipulate and retrieve data stored in IBM's San Jose Research Laboratory original relational database product, System R.
- SQL language was standardized by the American National Standards Institute (ANSI) in 1986 and ISO in 1987
- MySQL as maintained by Sun Microsystems and it as first public release in November 1996
- MySQL supported in Windows, Mac OS X, Linux, BSD, UNIX operating systems
- MySQL maximum size of DB is Unlimited, Max table size is 2 GB (Win32 FAT32) to 16 TB (Solaris), Max row size 64 KB,
Max columns per row is 3398, Max Blob/Clob size 4 GB (longtext, longblob), Max CHAR size is 64 KB (text), Max NUMBER size 64 bits.
- MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now a subsidiary of Sun Microsystems
- The world's most popular open source database is MySQL Database
- E.F. Codd released his Codd's rule in 1970 at the time of working in IBM's San Jose Research Laboratory
- Structured Query Language (SQL), developed by Donald D. Chamberlin and Raymond F. Boyce, for expressing queries at IBM's San Jose Research Laboratory in early 1970's
- Raymond F. Boyce also worked with Codd to develop the Boyce-Codd Normal Form for efficiently designing relational database tables so information was not needlessly duplicated in different tables.
- SQL was initially called as SEQUEL, was designed to manipulate and retrieve data stored in IBM's San Jose Research Laboratory original relational database product, System R.
- SQL language was standardized by the American National Standards Institute (ANSI) in 1986 and ISO in 1987
- MySQL as maintained by Sun Microsystems and it as first public release in November 1996
- MySQL supported in Windows, Mac OS X, Linux, BSD, UNIX operating systems
- MySQL maximum size of DB is Unlimited, Max table size is 2 GB (Win32 FAT32) to 16 TB (Solaris), Max row size 64 KB,
Max columns per row is 3398, Max Blob/Clob size 4 GB (longtext, longblob), Max CHAR size is 64 KB (text), Max NUMBER size 64 bits.
- MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now a subsidiary of Sun Microsystems
- The world's most popular open source database is MySQL Database
History of Edgar Frank "Ted" Codd (RDBMS)
Edgar Frank "Ted" Codd (August 23, 1923 – April 18, 2003) was born on the Isle of Portland, in England. After attending
Poole Grammar School, he studied mathematics and
chemistry at Exeter College, Oxford, before serving as a pilot in the Royal Air Force during the Second World War.
In 1948, he moved to New York to work for IBM as a mathematical programmer.
In 1953, angered by Senator Joseph McCarthy,
Codd moved to Ottawa, Canada. A decade later he returned to the U.S. and received his doctorate in computer science from
the University of Michigan in Ann Arbor.
Two years later he moved to San Jose, California to work at IBM's San Jose
Research Laboratory, Codd first published Codd's Rule in 1970 when he worked at IBM's San Jose Research Laboratory, where he continued
to work until the 1980s.
During the 1990s, his health deteriorated and he ceased work.
Codd received the Turing Award in 1981 and in 1994 he was inducted as a Fellow of the Association for Computing Machinery.
Codd died of heart failure at his home in Williams Island, Florida at the age of 79 on Friday, April 18, 2003.
Poole Grammar School, he studied mathematics and
chemistry at Exeter College, Oxford, before serving as a pilot in the Royal Air Force during the Second World War.
In 1948, he moved to New York to work for IBM as a mathematical programmer.
In 1953, angered by Senator Joseph McCarthy,
Codd moved to Ottawa, Canada. A decade later he returned to the U.S. and received his doctorate in computer science from
the University of Michigan in Ann Arbor.
Two years later he moved to San Jose, California to work at IBM's San Jose
Research Laboratory, Codd first published Codd's Rule in 1970 when he worked at IBM's San Jose Research Laboratory, where he continued
to work until the 1980s.
During the 1990s, his health deteriorated and he ceased work.
Codd received the Turing Award in 1981 and in 1994 he was inducted as a Fellow of the Association for Computing Machinery.
Codd died of heart failure at his home in Williams Island, Florida at the age of 79 on Friday, April 18, 2003.
Codd's 12 rules for RDBMS
E.F.Codd's 12 rules
Codd's 12 rules are a set of thirteen rules (numbered zero to twelve) proposed by Edgar F. Codd,
a pioneer of the relational model for databases, designed to define what is required from a database management system
in order for it to be considered relational, i.e., an RDBMS.
E.F. Codd released his Codd's rule in 1970 at the time of working in IBM's San Jose Research Laboratory
The rules
Rule 0: The system must qualify as relational, as a database, and as a management system.
For a system to qualify as a relational database management system (RDBMS), that system must use its relational facilities (exclusively) to manage the database.
Rule 1: The information rule:
All information in the database is to be represented in one and only one way, namely by values in column positions within rows of tables.
Rule 2: The guaranteed access rule:
All data must be accessible with no ambiguity. This rule is essentially a restatement of the fundamental requirement for primary keys. It says that every individual scalar value in the database must be logically addressable by specifying the name of the containing table, the name of the containing column and the primary key value of the containing row.
Rule 3: Systematic treatment of null values:
The DBMS must allow each field to remain null (or empty). Specifically, it must support a representation of "missing information and inapplicable information" that is systematic, distinct from all regular values (for example, "distinct from zero or any other number", in the case of numeric values), and independent of data type. It is also implied that such representations must be manipulated by the DBMS in a systematic way.
Rule 4: Active online catalog based on the relational model:
The system must support an online, inline, relational catalog that is accessible to authorized users by means of their regular query language. That is, users must be able to access the database's structure (catalog) using the same query language that they use to access the database's data.
Rule 5: The comprehensive data sublanguage rule:
The system must support at least one relational language that
1. Has a linear syntax
2. Can be used both interactively and within application programs,
3. Supports data definition operations (including view definitions), data manipulation operations (update as well as retrieval), security and integrity constraints, and transaction management operations (begin, commit, and rollback).
Rule 6: The view updating rule:
All views that are theoretically updatable must be updatable by the system.
Rule 7: High-level insert, update, and delete:
The system must support set-at-a-time insert, update, and delete operators. This means that data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. This rule states that insert, update, and delete operations should be supported for any retrievable set rather than just for a single row in a single table.
Rule 8: Physical data independence:
Changes to the physical level (how the data is stored, whether in arrays or linked lists etc.) must not require a change to an application based on the structure.
Rule 9: Logical data independence:
Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure. Logical data independence is more difficult to achieve than physical data independence.
Rule 10: Integrity independence:
Integrity constraints must be specified separately from application programs and stored in the catalog. It must be possible to change such constraints as and when appropriate without unnecessarily affecting existing applications.
Rule 11: Distribution independence:
The distribution of portions of the database to various locations should be invisible to users of the database. Existing applications should continue to operate successfully :
1. when a distributed version of the DBMS is first introduced; and
2. when existing distributed data are redistributed around the system.
Rule 12: The nonsubversion rule:
If the system provides a low-level (record-at-a-time) interface, then that interface cannot be used to subvert the system, for example, bypassing a relational security or integrity constraint.
Codd's 12 rules are a set of thirteen rules (numbered zero to twelve) proposed by Edgar F. Codd,
a pioneer of the relational model for databases, designed to define what is required from a database management system
in order for it to be considered relational, i.e., an RDBMS.
E.F. Codd released his Codd's rule in 1970 at the time of working in IBM's San Jose Research Laboratory
The rules
Rule 0: The system must qualify as relational, as a database, and as a management system.
For a system to qualify as a relational database management system (RDBMS), that system must use its relational facilities (exclusively) to manage the database.
Rule 1: The information rule:
All information in the database is to be represented in one and only one way, namely by values in column positions within rows of tables.
Rule 2: The guaranteed access rule:
All data must be accessible with no ambiguity. This rule is essentially a restatement of the fundamental requirement for primary keys. It says that every individual scalar value in the database must be logically addressable by specifying the name of the containing table, the name of the containing column and the primary key value of the containing row.
Rule 3: Systematic treatment of null values:
The DBMS must allow each field to remain null (or empty). Specifically, it must support a representation of "missing information and inapplicable information" that is systematic, distinct from all regular values (for example, "distinct from zero or any other number", in the case of numeric values), and independent of data type. It is also implied that such representations must be manipulated by the DBMS in a systematic way.
Rule 4: Active online catalog based on the relational model:
The system must support an online, inline, relational catalog that is accessible to authorized users by means of their regular query language. That is, users must be able to access the database's structure (catalog) using the same query language that they use to access the database's data.
Rule 5: The comprehensive data sublanguage rule:
The system must support at least one relational language that
1. Has a linear syntax
2. Can be used both interactively and within application programs,
3. Supports data definition operations (including view definitions), data manipulation operations (update as well as retrieval), security and integrity constraints, and transaction management operations (begin, commit, and rollback).
Rule 6: The view updating rule:
All views that are theoretically updatable must be updatable by the system.
Rule 7: High-level insert, update, and delete:
The system must support set-at-a-time insert, update, and delete operators. This means that data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. This rule states that insert, update, and delete operations should be supported for any retrievable set rather than just for a single row in a single table.
Rule 8: Physical data independence:
Changes to the physical level (how the data is stored, whether in arrays or linked lists etc.) must not require a change to an application based on the structure.
Rule 9: Logical data independence:
Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure. Logical data independence is more difficult to achieve than physical data independence.
Rule 10: Integrity independence:
Integrity constraints must be specified separately from application programs and stored in the catalog. It must be possible to change such constraints as and when appropriate without unnecessarily affecting existing applications.
Rule 11: Distribution independence:
The distribution of portions of the database to various locations should be invisible to users of the database. Existing applications should continue to operate successfully :
1. when a distributed version of the DBMS is first introduced; and
2. when existing distributed data are redistributed around the system.
Rule 12: The nonsubversion rule:
If the system provides a low-level (record-at-a-time) interface, then that interface cannot be used to subvert the system, for example, bypassing a relational security or integrity constraint.
Labels:
12 Codd's Rule for RDBMS,
doubts,
mysql
List of Normalization Techniques
Normalization
Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process:
eliminating redundant data (for example, storing the same data in more than one table) and ensuring data dependencies make sense
(only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and
ensure that data is logically stored.
Database normalization, sometimes referred to as canonical synthesis, is a technique for designing relational database
tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of
logical or structural problems, namely data anomalies.
For the most part, the first 3 normal forms are common sense.
1. No repeating elements or groups of elements
2. No partial dependencies on a concatenated key
3. No dependencies on non-key attributes
First Normal Form (1NF) - No repeating elements or groups of elements
i. No two rows are identical
ii. Each table entries having single value
iiiv. Eliminate duplicative columns from the same table
iv. Create separate tables for each group of related data and
v. Identify each row with a unique column or set of columns (the primary key).
Second Normal Form (2NF) - No partial dependencies on a concatenated key
* Meet all the requirements of the first normal form.
* Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
* Create relationships between these new tables and their predecessors through the use of foreign keys.
i. The table must be in 1NF.
ii. A table is 2NF if it is in 1NF and all fields are dependent on the whole of the primary key,
or a relation is in 2NF if it is in 1NF and every non-key attribute is fully dependent on each candidate key of the relation.
iii. None of the non-prime attributes of the table are functionally dependent on a part (proper subset) of a candidate key;
in other words, all functional dependencies of non-prime attributes on candidate keys are full functional dependencies.
For example, consider an "Employees' Skills" table whose attributes are Employee ID, Employee Name, and Skill;
and suppose that the combination of Employee ID and Skill uniquely identifies records within the table.
Given that Employee Name depends on only one of those attributes – namely, Employee ID – the table is not in 2NF.
Third Normal Form (3NF) - No dependencies on non-key attributes
A 3NF definition that is equivalent to Codd's, but expressed differently, was given by Carlo Zaniolo in 1982.
i. The table must be in 2NF.
ii. Remove columns that are not dependent upon the primary key.
iii. Transitive dependencies must be eliminated. All attributes must rely only on the primary key.
So, if a database has a table with columns Student ID, Student, Company, and Company Phone Number, it is not in 3NF. This is because the Phone number relies on the Company. So, for it to be in 3NF, there must be a second table with Company and Company Phone Number columns; the Phone Number column in the first table would be removed.if you have three columns in a single column. A COLUMN IS STUDENT ID , B COLUMN IS STUDENT NAME AND C COLUMN IS STUDENT ADDRESS
A -> B
A -> C
C -> B
Boyce-Codd normal form (BCNF)
A table is in Boyce-Codd normal form (BCNF) if and only if, for every one of its non-trivial functional dependencies,
X -> Y,
X is a superkey—that is,
X is either a candidate key or a superset thereof.
Fourth Normal Form (4NF)
-------------------------
* Meet all the requirements of the third normal form.
* A relation is in 4NF if it has no multi-valued dependencies.
A table is in fourth normal form (4NF) if and only if, for every one of its non-trivial multivalued dependencies
X ->> Y,
X is a superkey—that is,
X is either a candidate key or a superset thereof.
* For example: if you can have two phone numbers values and two email address values,
then you should not have them in the same table.
Normalizing an Example Table
These steps demonstrate the process of normalizing a fictitious student table.
1. First Normal Form: Repeating groups across columns
The designer might attempt to get around this restriction by defining multiple Telephone Number columns:
Customer ID First Name Surname TelNo1 TelNo2 TelNo3
2. First Normal Form: Repeating groups within columns
Storing Multiple Telephone Numbers on a single columns
TelNo
555-403-1659, 555-776-4100
3. First Normal Form: Unnormalized table:
Student# Advisor Adv-Room Class1 Class2 Class3
1022 Jones 412 101-07 143-01 159-02
4123 Smith 216 201-01 211-02 214-01
4. First Normal Form: No Repeating Groups
Tables should have only two dimensions. Since one student has several classes, these classes should be listed in a separate table. Fields Class1, Class2, and Class3 in the above records are indications of design trouble.
Spreadsheets often use the third dimension, but tables should not. Another way to look at this problem is with a one-to-many relationship, do not put the one side and the many side in the same table. Instead, create another table in first normal form by eliminating the repeating group (Class#), as shown below:
Student# Advisor Adv-Room Class#
1022 Jones 412 101-07
1022 Jones 412 143-01
1022 Jones 412 159-02
4123 Smith 216 201-01
4123 Smith 216 211-02
4123 Smith 216 214-01
5. Second Normal Form: Eliminate Redundant Data
Note the multiple Class# values for each Student# value in the above table. Class# is not functionally dependent on Student# (primary key), so this relationship is not in second normal form.
The following two tables demonstrate second normal form:
Students:
Student# Advisor Adv-Room
1022 Jones 412
4123 Smith 216
Registration:
Student# Class#
1022 101-07
1022 143-01
1022 159-02
4123 201-01
4123 211-02
4123 214-01
4. Third Normal Form: Eliminate Data Not Dependent On Key
In the last example, Adv-Room (the advisor's office number) is functionally dependent on the Advisor attribute. The solution is to move that attribute from the Students table to the Faculty table, as shown below:
Students:
Student# Advisor
1022 Jones
4123 Smith
Faculty:
Name Room Dept
Jones 412 42
Smith 216 42
Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process:
eliminating redundant data (for example, storing the same data in more than one table) and ensuring data dependencies make sense
(only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and
ensure that data is logically stored.
Database normalization, sometimes referred to as canonical synthesis, is a technique for designing relational database
tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of
logical or structural problems, namely data anomalies.
For the most part, the first 3 normal forms are common sense.
1. No repeating elements or groups of elements
2. No partial dependencies on a concatenated key
3. No dependencies on non-key attributes
First Normal Form (1NF) - No repeating elements or groups of elements
i. No two rows are identical
ii. Each table entries having single value
iiiv. Eliminate duplicative columns from the same table
iv. Create separate tables for each group of related data and
v. Identify each row with a unique column or set of columns (the primary key).
Second Normal Form (2NF) - No partial dependencies on a concatenated key
* Meet all the requirements of the first normal form.
* Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
* Create relationships between these new tables and their predecessors through the use of foreign keys.
i. The table must be in 1NF.
ii. A table is 2NF if it is in 1NF and all fields are dependent on the whole of the primary key,
or a relation is in 2NF if it is in 1NF and every non-key attribute is fully dependent on each candidate key of the relation.
iii. None of the non-prime attributes of the table are functionally dependent on a part (proper subset) of a candidate key;
in other words, all functional dependencies of non-prime attributes on candidate keys are full functional dependencies.
For example, consider an "Employees' Skills" table whose attributes are Employee ID, Employee Name, and Skill;
and suppose that the combination of Employee ID and Skill uniquely identifies records within the table.
Given that Employee Name depends on only one of those attributes – namely, Employee ID – the table is not in 2NF.
Third Normal Form (3NF) - No dependencies on non-key attributes
A 3NF definition that is equivalent to Codd's, but expressed differently, was given by Carlo Zaniolo in 1982.
i. The table must be in 2NF.
ii. Remove columns that are not dependent upon the primary key.
iii. Transitive dependencies must be eliminated. All attributes must rely only on the primary key.
So, if a database has a table with columns Student ID, Student, Company, and Company Phone Number, it is not in 3NF. This is because the Phone number relies on the Company. So, for it to be in 3NF, there must be a second table with Company and Company Phone Number columns; the Phone Number column in the first table would be removed.if you have three columns in a single column. A COLUMN IS STUDENT ID , B COLUMN IS STUDENT NAME AND C COLUMN IS STUDENT ADDRESS
A -> B
A -> C
C -> B
Boyce-Codd normal form (BCNF)
A table is in Boyce-Codd normal form (BCNF) if and only if, for every one of its non-trivial functional dependencies,
X -> Y,
X is a superkey—that is,
X is either a candidate key or a superset thereof.
Fourth Normal Form (4NF)
-------------------------
* Meet all the requirements of the third normal form.
* A relation is in 4NF if it has no multi-valued dependencies.
A table is in fourth normal form (4NF) if and only if, for every one of its non-trivial multivalued dependencies
X ->> Y,
X is a superkey—that is,
X is either a candidate key or a superset thereof.
* For example: if you can have two phone numbers values and two email address values,
then you should not have them in the same table.
Normalizing an Example Table
These steps demonstrate the process of normalizing a fictitious student table.
1. First Normal Form: Repeating groups across columns
The designer might attempt to get around this restriction by defining multiple Telephone Number columns:
Customer ID First Name Surname TelNo1 TelNo2 TelNo3
2. First Normal Form: Repeating groups within columns
Storing Multiple Telephone Numbers on a single columns
TelNo
555-403-1659, 555-776-4100
3. First Normal Form: Unnormalized table:
Student# Advisor Adv-Room Class1 Class2 Class3
1022 Jones 412 101-07 143-01 159-02
4123 Smith 216 201-01 211-02 214-01
4. First Normal Form: No Repeating Groups
Tables should have only two dimensions. Since one student has several classes, these classes should be listed in a separate table. Fields Class1, Class2, and Class3 in the above records are indications of design trouble.
Spreadsheets often use the third dimension, but tables should not. Another way to look at this problem is with a one-to-many relationship, do not put the one side and the many side in the same table. Instead, create another table in first normal form by eliminating the repeating group (Class#), as shown below:
Student# Advisor Adv-Room Class#
1022 Jones 412 101-07
1022 Jones 412 143-01
1022 Jones 412 159-02
4123 Smith 216 201-01
4123 Smith 216 211-02
4123 Smith 216 214-01
5. Second Normal Form: Eliminate Redundant Data
Note the multiple Class# values for each Student# value in the above table. Class# is not functionally dependent on Student# (primary key), so this relationship is not in second normal form.
The following two tables demonstrate second normal form:
Students:
Student# Advisor Adv-Room
1022 Jones 412
4123 Smith 216
Registration:
Student# Class#
1022 101-07
1022 143-01
1022 159-02
4123 201-01
4123 211-02
4123 214-01
4. Third Normal Form: Eliminate Data Not Dependent On Key
In the last example, Adv-Room (the advisor's office number) is functionally dependent on the Advisor attribute. The solution is to move that attribute from the Students table to the Faculty table, as shown below:
Students:
Student# Advisor
1022 Jones
4123 Smith
Faculty:
Name Room Dept
Jones 412 42
Smith 216 42
Labels:
doubts,
List of Normalization Techniques,
mysql
Friday, August 29, 2008
Saturday, August 9, 2008
Interview Questions in PHP and MySQL -2
1. What are the differences between Get and post methods in form submitting, give the case where we can use get and we can use post methods?
2. Who is the father of PHP and explain the changes in PHP versions?
3. How can we submit a form without a submit button?
4. In how many ways we can retrieve the date in the result set of mysql using PHP?
5. What is the difference between mysql_fetch_object and mysql_fetch_array?
6. What is the difference between $message and $$message?
7. How can we extract string ‘techinterviews.com ‘ from a string ‘http://www.techinterviews.com’ using regular expression of PHP?
8. How can we create a database using PHP and mysql?
9. What are the differences between require and include, include_once?
10. Can we use include (”techinterviews.php”) two times in a PHP page “makeit.PHP”?
11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
12. Functions in IMAP, POP3 AND LDAP?
13. How can I execute a PHP script using command line?
14. Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode ?
15. Shopping cart online validation i.e. how can we configure Paypal, etc.?
16. What is meant by nl2br()?
17. Draw the architecture of Zend engine?
18. What are the current versions of apache, PHP, and mysql?
19. What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?
20. How can we encrypt and decrypt a data present in a mysql table using mysql?
21. How can we encrypt the username and password using PHP?
22. What are the features and advantages of object-oriented programming?
23. What are the differences between procedure-oriented languages and object-oriented languages?
24. What is the use of friend function?
25. What are the differences between public, private, protected, static, transient, final and volatile?
26. What are the different types of errors in PHP?
27. What is the functionality of the function strstr and stristr?
28. What are the differences between PHP 3 and PHP 4 and PHP 5?
29. How can we convert asp pages to PHP pages?
30. What is the functionality of the function htmlentities?
31. How can we get second of the current time using date function?
32. How can we convert the time zones using PHP?
33. What is meant by urlencode and urldocode?
34. What is the difference between the functions unlink and unset?
35. How can we register the variables into a session?
36. How can we get the properties (size, type, width, height) of an image using PHP image functions?
37. How can we get the browser properties using PHP?
38. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
39. How can we increase the execution time of a PHP script?
40. How can we take a backup of a mysql table and how can we restore it. ?
41. How can we optimize or increase the speed of a mysql select query?
42. How many ways can we get the value of current session id?
43. How can we destroy the session, how can we unset the variable of a session?
44. How can we destroy the cookie?
45. How many ways we can pass the variable through the navigation between the pages?
46. What is the difference between ereg_replace() and eregi_replace()?
47. What are the different functions in sorting an array?
48. How can we know the count/number of elements of an array?
49. What is the PHP predefined variable that tells the What types of images that PHP supports?
50. How can I know that a variable is a number or not using a JavaScript?
51. List out some tools through which we can draw E-R diagrams for mysql.
52. How can I retrieve values from one database server and store them in other database server using PHP?
53. List out the predefined classes in PHP?
54. How can I make a script that can be bilanguage (supports English, German)?
55. What are the difference between abstract class and interface?
56. How can we send mail using JavaScript?
2. Who is the father of PHP and explain the changes in PHP versions?
3. How can we submit a form without a submit button?
4. In how many ways we can retrieve the date in the result set of mysql using PHP?
5. What is the difference between mysql_fetch_object and mysql_fetch_array?
6. What is the difference between $message and $$message?
7. How can we extract string ‘techinterviews.com ‘ from a string ‘http://www.techinterviews.com’ using regular expression of PHP?
8. How can we create a database using PHP and mysql?
9. What are the differences between require and include, include_once?
10. Can we use include (”techinterviews.php”) two times in a PHP page “makeit.PHP”?
11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
12. Functions in IMAP, POP3 AND LDAP?
13. How can I execute a PHP script using command line?
14. Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode ?
15. Shopping cart online validation i.e. how can we configure Paypal, etc.?
16. What is meant by nl2br()?
17. Draw the architecture of Zend engine?
18. What are the current versions of apache, PHP, and mysql?
19. What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?
20. How can we encrypt and decrypt a data present in a mysql table using mysql?
21. How can we encrypt the username and password using PHP?
22. What are the features and advantages of object-oriented programming?
23. What are the differences between procedure-oriented languages and object-oriented languages?
24. What is the use of friend function?
25. What are the differences between public, private, protected, static, transient, final and volatile?
26. What are the different types of errors in PHP?
27. What is the functionality of the function strstr and stristr?
28. What are the differences between PHP 3 and PHP 4 and PHP 5?
29. How can we convert asp pages to PHP pages?
30. What is the functionality of the function htmlentities?
31. How can we get second of the current time using date function?
32. How can we convert the time zones using PHP?
33. What is meant by urlencode and urldocode?
34. What is the difference between the functions unlink and unset?
35. How can we register the variables into a session?
36. How can we get the properties (size, type, width, height) of an image using PHP image functions?
37. How can we get the browser properties using PHP?
38. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
39. How can we increase the execution time of a PHP script?
40. How can we take a backup of a mysql table and how can we restore it. ?
41. How can we optimize or increase the speed of a mysql select query?
42. How many ways can we get the value of current session id?
43. How can we destroy the session, how can we unset the variable of a session?
44. How can we destroy the cookie?
45. How many ways we can pass the variable through the navigation between the pages?
46. What is the difference between ereg_replace() and eregi_replace()?
47. What are the different functions in sorting an array?
48. How can we know the count/number of elements of an array?
49. What is the PHP predefined variable that tells the What types of images that PHP supports?
50. How can I know that a variable is a number or not using a JavaScript?
51. List out some tools through which we can draw E-R diagrams for mysql.
52. How can I retrieve values from one database server and store them in other database server using PHP?
53. List out the predefined classes in PHP?
54. How can I make a script that can be bilanguage (supports English, German)?
55. What are the difference between abstract class and interface?
56. How can we send mail using JavaScript?
Interview Questions in PHP and MySQL - 1
# How can we repair a MySQL table?
Ans: REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]
This command will repair the table specified
if the quick is given the mysql will do a repair of only the index tree if the extended is given it will create index row by row
# What are the advantages of stored procedures, triggers, indexes?
# What is the maximum length of a table name, database name, and fieldname in MySQL?
Ans: database- 64
table -64
columns-64
alias-255
# How many values can the SET function of MySQL take?
# What are the other commands to know the structure of table using MySQL commands except explain command?
# How many tables will create when we create table, what are they?
# What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
# What is maximum size of a database in MySQL?
# Give the syntax of Grant and Revoke commands?
# Explain Normalization concept?
# How can we find the number of rows in a table using MySQL?
# How can we find the number of rows in a result set using PHP?
# How many ways we can we find the current date using MySQL?
# What are the advantages and disadvantages of Cascading Style Sheets?
# What type of inheritance that PHP supports?
# How can increase the performance of MySQL select query?
# The structure of table view buyers is as follows:
+----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+----------------+
| user_pri_id | int(15) | | PRI | NULL | auto_increment |
| userid | varchar(10) | YES | | NULL | |
+----------------+-------------+------+-----+---------+----------------+
the value of user_pri_id the last row 2345 then What will happen in the following conditions?
Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,
Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id
# What are the advantages/disadvantages of MySQL and PHP?
# What is the difference between GROUP BY and ORDER BY in Sql?
# What is the difference between char and varchar data types?
# What is the functionality of md5 function in PHP?
# How can I load data from a text file into a table?
# How can we know the number of days between two given dates using MySQL?
# How can we know the number of days between two given dates using PHP?
# How can we change the name of a column of a table?
# How can we change the name and data type of a column of a table?
# What are the differences between drop a table and truncate a table?
# When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages/disadvantages of these methods?
# When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
# What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?
# An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)?
# What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
# Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag. Example: The regular expression should match the tag <A HREF=”http://www.yoursite.com/”> and give the URL (”http://www.yoursite.com /”) as a return result. Tags should also be matched if they contain other attributes than the HREF attribute.
# A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?
# A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.
# For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234?. The query should be able to run under a MySQL 4.0 database.
# How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?
# Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries.
# What is MIME?
Ans: MIME is Multipurpose Internet Mail Extensions is an internet standard for the format of e-mail. Howewer browsers also uses MIME standart to transmit files. MIME has a header wich is added to a begining of the data. When browser sees such header it shows the data as it would be a file (for example image)
# What is PEAR in PHP?
Ans: PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide:
A structured library of open-sourced code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHP
The PHP Foundation Classes (PFC),
The PHP Extension Community Library (PECL),
A web site, mailing lists and download mirrors to support the PHP/PEAR community
PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.
http://pear.php.net/manual/en/introduction.php
# How can I use the COM components in PHP?
# How can I load the DLLs dynamically?
# How many ways we can give the output to a browser?
# How can we know that a session is started or not?
# What is the default session time in PHP and how can I change it?
# What changes I have to done in PHP.ini file for file uploading?
# What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
# How can I set a cron and how can i execute it in Unix, Linux, and windows?
# Steps for the payment gateway processing?
# How many ways I can register the variables into session?
# Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
# How many ways I can redirect a PHP page?
# List out different arguments in PHP header function?
# What type of headers have to add in the mail function in which file a attached?
# What is the difference between
# What are the differences between include() and include_once() functions?
# Describe the importance of database abstraction layers in PHP and database connection?
# Explain MySQL optimization?
# What is the difference between using copy() and move() function in PHP file uploading?
# What is the difference between Reply-to and Return-path in the headers of a mail function?
# Explain about Type Juggling in PHP?
# How can I get the only name of the current executing file?
# How can I embed a Java program in PHP file and what changes have to be done in PHP.ini file?
# How can I find what type of images that the PHP version supports?
# The table tbl_sites contains the following data:
Ans: REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]
This command will repair the table specified
if the quick is given the mysql will do a repair of only the index tree if the extended is given it will create index row by row
# What are the advantages of stored procedures, triggers, indexes?
# What is the maximum length of a table name, database name, and fieldname in MySQL?
Ans: database- 64
table -64
columns-64
alias-255
# How many values can the SET function of MySQL take?
# What are the other commands to know the structure of table using MySQL commands except explain command?
# How many tables will create when we create table, what are they?
# What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
# What is maximum size of a database in MySQL?
# Give the syntax of Grant and Revoke commands?
# Explain Normalization concept?
# How can we find the number of rows in a table using MySQL?
# How can we find the number of rows in a result set using PHP?
# How many ways we can we find the current date using MySQL?
# What are the advantages and disadvantages of Cascading Style Sheets?
# What type of inheritance that PHP supports?
# How can increase the performance of MySQL select query?
# The structure of table view buyers is as follows:
+----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+----------------+
| user_pri_id | int(15) | | PRI | NULL | auto_increment |
| userid | varchar(10) | YES | | NULL | |
+----------------+-------------+------+-----+---------+----------------+
the value of user_pri_id the last row 2345 then What will happen in the following conditions?
Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,
Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id
# What are the advantages/disadvantages of MySQL and PHP?
# What is the difference between GROUP BY and ORDER BY in Sql?
# What is the difference between char and varchar data types?
# What is the functionality of md5 function in PHP?
# How can I load data from a text file into a table?
# How can we know the number of days between two given dates using MySQL?
# How can we know the number of days between two given dates using PHP?
# How can we change the name of a column of a table?
# How can we change the name and data type of a column of a table?
# What are the differences between drop a table and truncate a table?
# When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages/disadvantages of these methods?
# When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
# What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?
# An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)?
# What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
# Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag. Example: The regular expression should match the tag <A HREF=”http://www.yoursite.com/”> and give the URL (”http://www.yoursite.com /”) as a return result. Tags should also be matched if they contain other attributes than the HREF attribute.
# A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?
# A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.
# For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234?. The query should be able to run under a MySQL 4.0 database.
# How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?
# Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries.
# What is MIME?
Ans: MIME is Multipurpose Internet Mail Extensions is an internet standard for the format of e-mail. Howewer browsers also uses MIME standart to transmit files. MIME has a header wich is added to a begining of the data. When browser sees such header it shows the data as it would be a file (for example image)
# What is PEAR in PHP?
Ans: PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide:
A structured library of open-sourced code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHP
The PHP Foundation Classes (PFC),
The PHP Extension Community Library (PECL),
A web site, mailing lists and download mirrors to support the PHP/PEAR community
PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.
http://pear.php.net/manual/en/introduction.php
# How can I use the COM components in PHP?
# How can I load the DLLs dynamically?
# How many ways we can give the output to a browser?
# How can we know that a session is started or not?
# What is the default session time in PHP and how can I change it?
# What changes I have to done in PHP.ini file for file uploading?
# What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
# How can I set a cron and how can i execute it in Unix, Linux, and windows?
# Steps for the payment gateway processing?
# How many ways I can register the variables into session?
# Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
# How many ways I can redirect a PHP page?
# List out different arguments in PHP header function?
# What type of headers have to add in the mail function in which file a attached?
# What is the difference between
# What are the differences between include() and include_once() functions?
# Describe the importance of database abstraction layers in PHP and database connection?
# Explain MySQL optimization?
# What is the difference between using copy() and move() function in PHP file uploading?
# What is the difference between Reply-to and Return-path in the headers of a mail function?
# Explain about Type Juggling in PHP?
# How can I get the only name of the current executing file?
# How can I embed a Java program in PHP file and what changes have to be done in PHP.ini file?
# How can I find what type of images that the PHP version supports?
# The table tbl_sites contains the following data:
Subscribe to:
Posts (Atom)
Popular Posts
-
1. How old PHP language is? - PHP began in 1994, so 14 years old. 2. What are different names of PHP? - PHP originally stood for Persona...
-
PHP - Validate E-mail The easiest and safest way to check whether an email address is well-formed is to use PHP's filter_var() functi...
-
HTML: a. HTML is a markup language that is used to build static (non interactive and nonanimated) webpages. b. HTML is Case-Insensitive. So...
-
Waysure Technologies Production: PHP, Design, Flash, .NET, J2EE Address: No 16, Kumaran Nagar Near RTO Office, Mudaliarpet, Pondic...
-
Note : This is not a perfect sort order, we have just displaying the list of PHP companies. 1. Photon Infotech No. 2/102, Arvind IT Park (N...
-
A payment gateway is an e-commerce application service provider service that authorizes payments for e-businesses, online retailers, bricks...
-
Sharing PHP, MySQL, Javascript, CSS Knowledge, We can share our PHP knowledge on the basis of PHP versioning, Javascript, AJAX, Stylesheet, ...
-
Hai all, Simple show hide sample using Show/Hide? Simple Show/Hide code
-
- count() -- Count elements in a variable - syntax for count() [int count ( mixed var [, int mode])] - If the optional mode parameter is set...
-
Use the below code and you can get the exact value in php as us saw in browser. Code: $encode_data = iconv('UTF-8', 'windows-125...