All Questions
push() method adds one or more elements to the end of an array and returns the new length of the array.
reverse() method reverses the order of the elements of an array −− the first becomes the last, and the last becomes the first.
sort() method sorts the elements of an array.
substr() method returns the characters in a string beginning at the specified location through the specified number of characters.
toLowerCase() method returns the calling string value converted to lower case
toUpperCase() method returns the calling string value converted to upper case.
toString() method returns the string representation of the number's value.
The typeof is a unary operator that is placed before its single operand, which can be of any type. Its value is a string indicating the data type of the operand. The typeof operator evaluates to "number", "string", or "boolean" if its operand is a number, string, or boolean value and returns true or false based on the evaluation.
JavaScript can also manipulate cookies using the cookie property of the Document object. JavaScript can read, create, modify, and delete the cookie or cookies that apply to the current web page.
The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this − Syntax − document.cookie = "key1 = value1; key2 = value2; expires = date";
The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this − Syntax − document.cookie = "key1 = value1; key2 = value2; expires = date"; Here expires attribute is option. If you provide this attribute with a valid date or time then cookie will expire at the given date or time and after that cookies' value will not be accessible.
Sometimes you will want to delete a cookie so that subsequent attempts to read the cookie return nothing. To do this, you just need to set the expiration date to a time in the past.
his is very simple to do a page redirect using JavaScript at client side. To redirect your site visitors to a new page, you just need to add a line in your head section as follows − <head> <script type="text/javascript"> <!-- window.location="http://www.newlocation.com"; //--> </script> </head>
JavaScript helps you to implement this functionality using print function of window object. The JavaScript print function window.print() will print the current web page when executed.
The Date object is a datatype built into the JavaScript language. Date objects are created with the new Date( ). Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.
he Number object represents numerical date, either integers or floating-point numbers. In general, you do not need to worry about Number objects because the browser automatically converts number literals to instances of the number class. Syntax − Creating a number object − var val = new Number(number); If the argument cannot be converted into a number, it returns NaN (Not-a-Number).
The latest versions of JavaScript added exception handling capabilities. JavaScript implements the try...catch...finally construct as well as the throw operator to handle exceptions. You can catch programmer-generated and runtime exceptions, but you cannot catch JavaScript syntax errors.
<body dir="trl">Text should go in opposite direction</body>
To HTML create email links using <a href> Example: <a href="mailto:youremail@domain.com">Send Email</a>
Responsive Web Design makes your web page look good and suitable to work on every device and every screen size, no matter how large or small, mobile or desktop
HTML5 is the fifth major revision of the standard that defines Hypertext Markup Language (HTML). One of the design goals for HTML5 is to support for multimedia on mobile devices. Other new features in HTML5 include specific functions for embedding graphics, audio, video, and interactive documents
SQL stands for Structured Query Language. SQL is is a special-purpose programming language designed for data held in a relational database management system.It's originally based upon relational algebra and tuple relational calculus, It's consists of a data definition language(DDL) and a data manipulation language(DML).
RDBMS (relational database management system) applications store data in a tabular form.DBMS store data as files .However there are is tables in DBMS also, but there is no relation between the tables as in RDBMS.In DBMS, data is generally stored in either a hierarchical form or a navigational form.In RDBMS tables have an identifier called primary key and Data values will be stored in the form of tables. The relationships between these data values will be stored in the form of a table as well. Every value stored in the relational database is accessible.RDBMS solution is required by large sets of data whereas small sets of data can be managed by DBMS.
Groupby : It is a way to sub-total your results,or perform some other 'aggregate' functions on them.e.g : select sum(salary)from salary Groupby employee name. Orderby : It is a simply a way to sort your results. it display result in assending or dessending order.e.g : select * from customer where column name="value" orderby column name.
Joins are used for select the relevant data between one or more table.
FLOAT and DOUBLE both represents approximate numerical data values. MySql uses four bytes for single precision values and eight bytes for double precision values .A Float is for single-precision value wheres DOUBLE is for double precision values and DOUBLE allows greater accurcy than FLOAT.Float saves floating point numbers upto eight places and DOUBLE saves floating point numbers upto 18 places.
A BLOB is Bianry large object tha can hold variable amount of data. There are four types of BLOB1. TINYBLOB2. BLOB3. MEDIUMBLOB4. LONGBLOBThese have differnces in maximum length of the values they can hold.BLOB values stores as binary strings(byte strings).
There are three types of join in sql. that are as following:-1) Inner join1.1) equi join1.2) natural join 2)Outer join 2.1)left join 2.2)right join2.3) full join 3) Cross join
There are three types of join in sql. that are as following:-1) Inner join1.1) equi join1.2) natural join 2)Outer join 2.1)left join 2.2)right join2.3) full join 3) Cross join
"SELECT max(salary_obtained) FROM organization_tbl WHERE salary_obtained <( SELECT max(salary_obtained) FROM organization_tbl)".
"SELECT salary_obtained FROM organization_tbl ORDER BY salary_obtained DESC LIMIT 0,2"
SELECT student_name from students_tbl WHERE marks_obtained = (SELECT max(marks_obtained) FROM students_tbl).
1: UNIQUE key can be a NULL value but PRIMARY key can not take NULL values.2:A table can have multiple UNIQUE key but can only one PRIMARY key.
1: DELETE is a DML(data manipulation lnguage) command whereas truncate is a DDL(data definition language) command.2 : Truncate is much faster than Delete.3 : We can not roll back in truncate but in delete we can rollback.4 : We can not use where clause in truncate but in delete we can use conditions using where clause.
A storage engine is a software module that a database management system uses to create ,read update the data from a database.
1: UNIQUE key can be a NULL value but PRIMARY key can not take NULL values.2:A table can have multiple UNIQUE key but can only one PRIMARY key.
Below are some storage engines names that a mysql support.1 : MyISAM.2 :InnoDB3 :Memory4 :CSV5 :Merge etc.
1 : InnoDB provides us row level locking while MyISAM provides us table level locking.2 : InnoDB offers foreign key constraints wheres in MyISAM does not have foreign key constraints.3 : InnoDB does not have full text search wheres MyISAM provides us full text search.
CHAR used to store fixed length memory storage whereas VARCHAR is used for variable length memory storage .In VARCHAR if we used less space than defined space ,then the remaining space is not wasted , but In CHAR if we use less space than defined space then remaining space is wasted.CHAR stores only character values whereas VARCHAR stores alphanumeric values
The latest version of MySQL is MySQL 5.6.19 released on 31st March 2014.
1: While using the mysql_pconnect the function would try to find a connection that is already open with same host,username and password ie.(persistant connection) .If connection found an identifier will be returned instead of opening new connection. And with mysql_connect a new connection is always established .2:While using mysql_pconnect the connection will not closed after the execution of script for future use and in mysql_connect the connection will automatically close when execution of script ends.3 :mysql_pconnect uses less resources than mysql_connect.
1 : Instead of using SELECT * we should specify the columns name like SELECT column1,column2 which have use in our script. 2 : We should use indexing of tables for which we are writing queries. 3 : Try to use the LIMIT if we need only a specific number of rows.
In MySql we have to use DISTINCT statement to get distinct (unique) values . e.g :SELECT DISTINCT column_name FROM table_name ;
Six triggers are possible to use in MySQL database . 1. Before Insert2. After Insert3. Before Update4.After Update5.Before Delete6.After Delete
We can get the current date in MySql by SELECT CURRENT_DATE();
In MySQL CONCAT function is used to concatenate two strings to form a single string Synatx : SELECT CONCAT(column1,column2) FROM tblname.Ex : SELECT CONCAT(first_name,last_name) FROM employee
We are using the table users with three columns userid, uname, statusSELECT uname, status FROM users ORDER BY FIELD(status, 'inactive','active','pending');
We can first get the 2nd highest salary from the table. As salary can be same , so we will find the DISTINCT salary data by using DISTINCT clause or GROUP BY clause. SELECT salary from employees GROUP BY salary DESC LIMIT 1,1 after we can write complete query to get the employees on this salary. SELECT name from employees WHERE salary=(SELECT salary from employees GROUP BY salary DESC LIMIT 1,1)
First we need to select only those records which are repeated giving a constraint :count should be greater than one to make the signle record deletion work. Suppose repeating of record is considered by column name. SELECT * FROM(SELECT id FROM user GROUP BY name HAVING COUNT(*) > 1) AS A Then will apply the deletion on those records. DELETE FROM user WHERE id IN(SELECT * FROM(SELECT id FROM user GROUP BY name HAVING COUNT(*) > 1) AS A)