Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

Reading text from a file and saving in the database in Ruby

As we know that in almost all web applications we need to amend such a functionality where you need to get the content from a file stored externally in your pc. lets say this content to be a simple text content. In these cases what we can do i...

How to save and fetch data from Sqlite database

First include the sqlite file in your project. Then copy that file from bundle to documents directory as below and create Database method. -(void)createDatabase{ NSString *pathForDocumentDirectory =[self databasePath]; //define new path...

How to fetch data from two table in cake php

Suppose we have a table name player having field id, name of player, images, etc having some data .Now we have another table name playergallery having field like id, player_id, images, etc here player_id is foreign key and it is referencing to ta...

How to fetch data from SQLite in iOS?

Hi Readers, This blog includes the concept of how to fetch data from database after saving the data. You can go through with previous blog if you are not aware about  how to save data How to save data in SQLite. Now we will discuss the ...

How to save data in SQLite database in iOS?

Hi Readers, In this blog, we will discuss how to save data entered by a user in SQLite database. Before proceeding towards the saving of data into the database you should know how to create a database and tables inside SQLite database. ...

Normalization in database

  Hi Reader's,   In this blog we are going to discuss about the Normalization process with in the database.Database Normalization can be defined as a technique which is used to organize the data within the database. Databas...

SQL Basic Commands

SQL stands for Structured Query Language. SQL is a language which allow us to access data or modify data from the database. Before proceeding towards the SQL we should also know about database. DataBase can be defined as the collection of multipl...

How to export data in PDF file from database

Data fetch from database according to the user's entry in the database table in the pdf format, benefit of using this format for saving our data in compact and secure form, this will help to user to store the data in the file. Here is simple ...

MySQL: selecting rows where a column is null

In MySQL, we can select rows where a column is null by using IS NULL operator. We have a table "employee" as below:     employee id first_name salary country ............................................

How to make WHERE col LIKE '%' select NULL values too?

When we apply LIKE keyword to any query then it doesn't return NULL values, and sometimes it required to return NULL values as well. We can do this by using IS NULL or IFNULL operator. Example: We have a table "employee" as be...

How to Create excel files in php

Applications that are written in php most of the times need to export data for some purposes. In this tutorial, we will learn "How to export that data in Excel CSV fomat?" CSV is known as the EXCEL spreadsheet that have the data in a gr...

Association in cake php

Association means relationship, It is a way that two table are connected to each other or linking model together, in cakephp the links between models are handled through association. User can understand it from the following table.   &...

Fetching data from databse in cakePHP.

Fetching a data in the form of table from the database can is explained here in this blog, User have to define a function in the controller with the same file name in which user are displaying table using HTML code, for example here it is 'fe...

How to Save data using cakephp

CakePHP will save model data as a snap to your database, User's Data will be ready to be saved in database it should be passed to the model’s save() method using this, in the giving format below. This is Controller action that uses a Ca...

How to Create Database in cake php

CakePHP database configuration details are in a file that is located at app/Config/database.php. This database file user can edit the file in the notepad or sublime and can edit the feilds by which it will be connected to the database.Filling al...

How to insert values into database in php.

Inserting data to a database would be possible by using SQL statements, specifically the INSERT command. Data can be entered  into the database using insert query into the function, here is simple line of code that will create a database usi...

Insert data into database from form in PHP

Below is a form which contain id field, name field, phone number filed, gender radio button and we are sending these data  by using post method. <form name="user_registration" method="post" > Name: <input type="text" name...

Code to fetch form data to database

Here is a simple program code to enter the form data to the database using php. HTML Code: <!DOCTYPE html> <html> <head> <title>Form To Db</title> <style type="text/css"> .container{width: 80%;...

Use of AVG() Function in MySql

The MySql provides us with various for wide use for handling the database. The AVG() function is also one of the important function used in MySql. The AVG() is used to calculate the average value of the columns. Syntax: SELECT AVG(column-n...

Steps to connect to the Oracle Database using JDBC in Java

Steps to connect to the database in java using JDBC for Oracle database 1) Driver class is registered The driver class is registered first with the help of the forName() method. e.g. Class.forName("oracle.jdbc.driver.OracleDriver"); ...

Rolling Back A Transaction in MySql

Transactions are very important part of MySql and for handling the transactions the Transaction Control Language (TCL) is used. Transactions are basically used to handle all the changes made in the database. Rolling back a transaction means stor...

How to show table list in a database in MySQL?

Sometimes we need to find table list present in a database so that we can identify which table we have to create and which one not. To work in a particular database we need to use the below statement first: use database_name; Example: ...

How to show CREATE TABLE syntax in MySQL?

Sometimes we need to check the CREATE TABLE syntax for already created table in the database. When we need to check what kind of columns and what datatype a column has in a table then we require the CREATE TABLE syntax for that table. Syntax ...

How to create a TABLE in MySQL?

To create a table in MySQL, we use the CREATE TABLE statement. A table is a combination of row and columns. CREATE TABLE Syntax CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), .... ); In the a...

How to create a DATABASE in MySQL?

To create a database in MySQL, we use the CREATE DATABASE statement. CREATE DATABASE Syntax CREATE DATABASE database_name; CREATE DATABASE Example The below statement will create a database named "demo": CREATE DATABASE demo; ...

How to use of AND & OR operators in MySQL?

Sometimes we need to filter records based on some conditions, for that we use the AND & OR operators in MySQL. AND operator - We use AND operator if we require both conditions in a query means the AND operator displays a record only if bot...

What is the use of LIMIT Clause in MySQL?

In MySQL, the LIMIT Clause is used to return the specified number of records means by using LIMIT we can specify how many records we want to return from a table.. The LIMIT Clause is useful when, we want to select some records from a table whi...

How to get the last record from a table in MySQL?

Sometimes we need to find the last inserted record into table. We can do this by using ORDER by and LIMIT. Syntax: SELECT * FROM table_name ORDER by id DESC LIMIT 1; Example: Suppose we have a table named "tickit" and we want to fi...

What is the use of Aliases in MySQL?

In MySQL, aliases are used to give temporarily name to a table or a column. When we write a query we use Aliases to make column name more readable. Alias Syntax for Columns SELECT column_name AS alias_name FROM table_name; Alias Synta...

What is the use of LIKE Operator in MySQL?

In MySQL, the LIKE operator is used to search for a specified pattern for a column in a WHERE clause . LIKE Syntax SELECT column_name FROM table_name WHERE column_name LIKE pattern; We have a table "employee" as below: employe...

What is the use of UPDATE statement in MySQL?

In MySQL, the UPDATE statement is used to update existing records in a table. UPDATE Syntax UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value; In the above syntax, WHERE clause specifies which row o...

What is the use of IN Operator in MySQL?

In MySQL, the IN operator is used to allow us specify multiple values in a WHERE clause. IN Operator Syntax SELECT column_name FROM table_name WHERE column_name IN (value1,value2,...); We have a table "employee" as below: empl...

What is the use of BETWEEN Operator in MySQL?

In MySQL, the BETWEEN operator is used to select values (values can be numbers, text, or dates) from a column within a specified range. BETWEEN Syntax SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2; ...

What is the use of ORDER by Keyword in MySQL.

In MySQL, the ORDER by keyword is used to get records from a table in sorted order. The ORDER BY keyword can use one or more columns to sort the result-set. We can sort the records in both ascending and descending order.By default, ORDER by ke...

What is the use of WHERE Clause in MySQL?

In MySQL, the WHERE clause is used to filter records from a table. The WHERE clause is used to get the records that match the specified criteria in that. WHERE Clause Syntax SELECT column_name,column_name FROM table_name WHERE column_name...

Use of SELECT statement in MySQL.

In MySQL, The SELECT statement is used to select data from a table. SELECT Syntax SELECT column_name,column_name FROM table_name; and to select all records SELECT * FROM table_name; We have a table "employee" as below: ...

What is the use of GROUP by statement in MySQL?

The GROUP by statement is used with the aggregate functions to group the result by one or more columns. GROUP by Syntax SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP by column_...

what is the use of FORMAT() function in SQL?

In SQL, FORMAT() function is used to format a column value means how a field will to be displayed. FORMAT() Syntax SELECT FORMAT(column_name,format) FROM table_name; In the above syntax parameters are as below: Parameter Descri...

what is the use of NOW() function in SQL?

In SQL, NOW() function is used to return the current system date and time. NOW() Syntax SELECT NOW() FROM table_name; We have a table "employee" as below: employee id first_name last_name salary ........

what is the use of LEN() function in MySQL?

In MySQL, LEN() function is used to return the length of the value in a column (text field) in a table. LEN() Syntax SELECT LEN(column_name) FROM table_name; We have a table "employee" as below: employee id first_name ...

How to use SUM() function in MySQL?

In MySQL, SUM() function is used to return the total sum of a numeric column in a table. SUM() Syntax SELECT SUM(column_name) FROM table_name; We have a table "employee" as below: employee id first_name last_nam...

Difference between TRUNCATE and DROP in MySQL.

TRUNCATE TRUNCATE comes under DDL(Data Definition Language). TRUNCATE removes only rows from the table but the structure of the table remains same. Data can not be roll backed if we use "TRUNCATE" command to delete data. Can not use WHERE...

What is DEFAULT Constraint in MySQL?

In MySQL, the DEFAULT constraint is used to insert value into a column in a table. If there is no value is specified for a column then the default value will be added to column for all new records. DEFAULT Constraint on CREATE TABLE The fol...

What is CHECK Constraint in MySQL?

In MySQL, the CHECK constraint is used to put limit on value range on value inside a column. CHECK Constraint on CREATE TABLE The following statement creates a CHECK constraint on the "id" column when the "employee" table is created. The CH...

What is FOREIGN KEY Constraint in MySQL?

Note that the "P_Id" column in the "Orders" table points to the "P_Id" column in the "Persons" table. In MySQL, the FOREIGN KEY on one table is used to point a PRIMARY KEY in another table. We have two tables with the following values. ...

What is PRIMARY KEY Constraint in MySQL?

In MySQL, the PRIMARY KEY constraint is used to uniquely identify each record in a table. Primary key contains UNIQUE values only and the column defined as Primary key column can not be NULL. A table can have only one PRIMARY KEY. PRIMARY K...

What is UNIQUE Constraint in MySQL?

In MySQL, the UNIQUE constraint is used to uniquely identify each record in a table. UNIQUE Constraint on CREATE TABLE The following statement creates a UNIQUE constraint on the "id" column when the "employee" table is created: Example ...

What is NOT NULL Constraint in MySQL?

In MySQL, the NOT NULL constraint is used to restrict a column to NOT accept NULL values. The NOT NULL constraint allows a column to always contains a value which means you cant not insert/update a record in a table without passing value for t...

Difference between DELETE and TRUNCATE in MySQL.

In MySQL, DELETE and TRUNCATE both are used for deleting data from table. DELETE DELETE comes under DML(Data Manipulation Language). DELETE can be used to delete a particular row by using WHERE clause. It is slower than TRUNCATE as...

How to use MIN() function in MySQL?

In MySQL, MIN() function is used to return the smallest value of the specified column in a table. MIN() Syntax SELECT MIN(column_name) FROM table_name; We have a table "employee" as below: employee id first_name ...
prev 1
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: