Operators in MySql
//////////////OPERATORS////////////////#ARITHMATICS OPERATOR
->select column_name*12,column_name*19 FROM table_nmae WHERE search_condition;
->select column_name*12,column_name*19 FROM table_nmae WHERE search_condition;
->select column_name+12,column_name-100 FROM table_nmae WHERE search_condition;
#LOGICAL OPERATOR(AND OR NOT)
->SELECT column_name ,column_name FROM table_nmae WHERE column_name >=10 AND column_name <=20;
->SELECT column_name ,column_name FROM table_nmae WHERE column_name =10 AND column_name =20;
->SELECT column_name ,column_name FROM table_nmae WHERE NOT(column_name =10 AND column_name =20);
->SELECT column_name ,column_name FROM table_nmae WHERE column_name >=10 AND column_name <=20;
->SELECT column_name ,column_name FROM table_nmae WHERE column_name =10 AND column_name =20;
->SELECT column_name ,column_name FROM table_nmae WHERE NOT(column_name =10 AND column_name =20);
#PATTERN MATCHING#LIKE OPERATOR(FOR STRING)
->select collumn_name,collumn_name,collumn_name from table_name where collumn_name LIKE 'd%';
->select collumn_name,collumn_name,collumn_name from table_name where collumn_name LIKE 'd%';
#LIKE OPERATOR(FOR CHARACTER) in which first character should be 'd'
->select collumn_name,collumn_name,collumn_name from table_name where collumn_name LIKE '_d';
->select collumn_name,collumn_name,collumn_name from table_name where collumn_name LIKE '_d';
#BETWEEN OPERATOR->SELECT column_name ,column_name FROM table_nmae WHERE column_name BETWEEN 10 AND 20;
#IN NOT IN OPERATORCompare list of values->SELECT column_name,collumn_name,collumn_name from table_name WHERE column_name IN('value','value','value','value');
->SELECT column_name,collumn_name,collumn_name from table_name WHERE column_name NOT IN('value','value','value','value');
///////////DATA CONSTRAINTS/////////////////->THhere are two type of data contraintes that can be applied to data being inserted into an OEACLE table.One is Input/Output constraints and other is Business Rule Constraints.->Input/Output Contraints: Determine speed at which data can be inserted or extracted from the oracle table.These constraints further devide in two distinctly different constraints.1-:PRIMARY KEY CONSTRAINTS->Here data contraints attached to a table collumn.
i.e Data entered in a table collumn is UNIQUE across the entire collumn.->None of the CELL of belongig to the table collumn are left empty.
i.e Data entered in a table collumn is UNIQUE across the entire collumn.->None of the CELL of belongig to the table collumn are left empty.
2-:Foreign KEY CONSTRAINTS Establish reletionship between records across different table.->
Comments
Post a Comment