1.What is the diff between primary key and foriegn key?
PRIMARY KEY: A tabLe can aontain only one PRIMARY KEY. It Doesn't allow null values, it is used as Foreign Key In Another Table(like Reference Key). UNIQUE KEY: A Table may Contain one or more UNIQUE constraints. Its aloow only one null value . Use this key We maintain unique vales in the table. FOREIGN KEY: A key used in one table to represent the value of a primary key in a related table. While primary keys must contain unique values, foreign keys may have duplicates. For instance, if we use student ID as the primary key in a Students table (each student has a unique ID), we could use student ID as a foreign key in a Courses table: as each student may do more than one course, the student ID field in the Courses table (often shortened to Courses.student ID) will hold duplicate values.
SQL DML and DDL
SQL can be divided into two parts: The Data Manipulation Language (DML) and the Data Definition Language (DDL).The query and update commands form the DML part of SQL:
- SELECT - extracts data from a database
- UPDATE - updates data in a database
- DELETE - deletes data from a database
- INSERT INTO - inserts new data into a database
- CREATE DATABASE - creates a new database
- ALTER DATABASE - modifies a database
- CREATE TABLE - creates a new table
- ALTER TABLE - modifies a table
- DROP TABLE - deletes a table
- CREATE INDEX - creates an index (search key)
- DROP INDEX - deletes an index
The DISTINCT keyword can be used to return only distinct (different) values.
SELECT DISTINCT column_name(s) FROM table_name
The AND & OR operators are used to filter records based on more than one condition.
Note : following concepts are important concepts in mysql
and their referencelinks, of courese i have read this alredy
1.Fetch ref link: http://www.tutorialarena.com/mysql/php-mysql-fetch-array.php 2.Aggregate Functions and Group By ref link: http://www.tizag.com/mysqlTutorial/mysqlgroupby.php 3.Joins ref link: http://www.tutorialspoint.com/mysql/mysql-using-joins.htm 4.As alias : ref link: http://www.w3schools.com/sql/sql_alias.asp 5.Like ref link: http://www.mysqltutorial.org/sql-like-mysql.aspx 6.Date and time: Ref links: http://www.tutorialspoint.com/mysql/mysql-date-time-functions.htm http://www.plus2net.com/sql_tutorial/date.php 7.Mysql functions 8. Adding one or more tables to a query 9.Table prefix's for columns 10.write a query in another query Mysql Ref links for Knowledge http://databases.aspfaq.com/database/how-do-i-use-a-select-list-alias-in-the-where-or-group-by-clause.html 2.http://beginner-sql-tutorial.com/sql-query-tuning.htm 3.http://www.tizag.com/mysqlTutorial/index.php 4.http://www.tutorialarena.com/mysql/mysql-group-by.php 5.http://www.tutorialspoint.com/mysql/mysql-like-clause.htm 6.http://www.mysqltutorial.org/basic-mysql-tutorial.aspx
8.What is the difference between loadObjectList and loadResult?
1.loadObjectList returns the result in object format means while we print the output using this
<?php echo $lists->title ; ?>
2.loadResult returns the result in array format while we print the output using this
<?php echo $list[title]; ?>
we need to print the key value , here title is key value of array
9.Full text serach using match function used fro searching the word /character from more than one column of table?
plz go through this
http://devzone.zend.com/article/1304