SQL: The Essential Database Language


Hits: 1255  

Structured Query Language (SQL) is a specialised programming language designed for use with databases. SQL is a standard language when working with relational databases, allowing rapid sorting of large databases. If you are serious about a career in IT, then SQL training is essential, even if you don’t plan on becoming a database specialist. There are different levels of tuition, and it is recommended to begin with the introductory course.

Introduction to SQL

The SQL introductory program covers the basics, and shows you the capabilities and key features of SQL. This one-day course is very much hands-on, beginning with an introduction to SQL, followed by an overview of relational databases, and how SQL works within that context. You will work with an example database, and learn how to run SQL queries in order to familiarise yourself with the interface.If you are interested, you can invest in a SQL training course here, with a range of training programs on all aspects of SQL.

Writing basic SQL statements

This involves selecting columns and tables from a database using SQL, then learning how to execute queries. Once this has been covered, you will learn how to limit the data returned by introducing the “WHERE” section of SQL queries, as well as how to sort the outputs.

Grouping data

This involves using the aggregate function to introduce sub totals, followed by an introduction to the “HAVING” statement, and the “GROUP BY” function. The final stage of the introductory SQL course looks at working with functions and dates. Before learning how to use SQL, it is essential to have a sound working knowledge of Microsoft’s Excel program. Here is some useful information regarding Excel and its capabilities.

Advanced SQL training

Beginning with a review of the introductory program, this course will further develop the learner’s ability to manage a relational database, with an introduction to more complex commands and queries. At this stage, you are introduced to data manipulation language (DML) and database definition language (DDL), which will enable you to build database objects and execute complex statements.

You would learn about SQL scripts, which are a set of SQL commands that can be saved as a file, allowing you to repeat queries without having to retype. This includes the use of parameters in your query, in addition to a look at query output presentation. Other essential sections of this level include,

– SQL syntax
– Managing tables
– Managing views
– Getting data from multiple tables
– SQL functions

The final part of this program deals with advanced ways to control select queries using SQL. You will also be shown how to order and produce sub totals from a query. The final section includes applying conditions to your query.

The right training produces competency

If you are planning to become SQL proficient, it is important to choose the right training course, with instructors that understand the problems you will face when using SQL. There are reputable online training institutions that have the knowledge and experience to help you understand and effectively work with SQL.

Importing data from non-wordpress mysql database


Hits: 3272  

You have to create an import php file to get the Questions/Answers from a non-wordpress database and bring them into posts in wordpress.

Question Table

<?php

/// non-wordpress database connection string here

require('./wp-load.php');

$results = mysql_query("SELECT * FROM questions");

while ($row = mysql_fetch_assoc($results)) 
{

    $post_information = array(
	'post_title' => wp_strip_all_tags( $row['question'] ),
	'post_content' => $row['answer'],
	'post_category' =>  array(6,7), // Cat Ids
	'post_date' => date('Y-m-d H:i:s', strtotime( $row['timestamp'] )),
	'post_type' => "post",
	'post_excerpt' => "",
	'post_author' => "admin",
	'post_status' => "publish"
	);
	
	$post_id = wp_insert_post( $post_information );		
	
	$filename = "http://www.domain.com/images/post-image.png";   ////  Post Thumbnail Image
	$wp_filetype = wp_check_filetype(basename($filename), null );
	
	$attachment = array(
	  'post_mime_type' => $wp_filetype['type'],
	  'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
	  'post_content' => '',
	  'post_status' => 'inherit'
	);
	
	$attach_id = wp_insert_attachment( $attachment, $filename, $new_post );
	
	//update_post_meta($post_id,'_thumbnail_id',$attach_id);	
	
	add_post_meta($post_id, '_thumbnail_id', $attach_id, true);

}

?>

SQL OR NOSQL?


Hits: 3915  

If you are searching for SQL or noSQL solutions, it is very difficult to decide among top SQL / noSQL Databases.

MySQL is the best for multi-document transactions, complex security, complex join, extreme compression.

NoSQL is good for linear scalability, high performance, schema flexibility.

But both depend on data need to manage 😉

Scalability

MySQL support master and slave approach for scaling (vertical scalability).
NoSQL supports horizontal scalability.

Vertical scalability is the ability to increase the capacity of existing hardware or software by adding resources – for example, adding processing power to a server to make it faster. On the other hand, horizontal scalability is the ability to connect multiple entities so that they work as a single logical unit.

Flexibility

SQL is the best for query flexibility, SQL supports both simple and complex queries.
MongoDB supports SQL query and indexes.

Down Time

NoSQL perform well for database size and server performance.

Transactions

SQL is king of transactions.
MongoDB and Redis support limited transactions.

Hosting

Every database solution need deployment, backups, monitoring, and performance tuning.

NoSQL are modern web-scale databases having qualities of non-relational, distributed, open-source and horizontally scalable database.