Featured Post

SQL Interview Success: Unlocking the Top 5 Frequently Asked Queries

Image
 Here are the five top commonly asked SQL queries in the interviews. These you can expect in Data Analyst, or, Data Engineer interviews. Top SQL Queries for Interviews 01. Joins The commonly asked question pertains to providing two tables, determining the number of rows that will return on various join types, and the resultant. Table1 -------- id ---- 1 1 2 3 Table2 -------- id ---- 1 3 1 NULL Output ------- Inner join --------------- 5 rows will return The result will be: =============== 1  1 1   1 1   1 1    1 3    3 02. Substring and Concat Here, we need to write an SQL query to make the upper case of the first letter and the small case of the remaining letter. Table1 ------ ename ===== raJu venKat kRIshna Solution: ========== SELECT CONCAT(UPPER(SUBSTRING(name, 1, 1)), LOWER(SUBSTRING(name, 2))) AS capitalized_name FROM Table1; 03. Case statement SQL Query ========= SELECT Code1, Code2,      CASE         WHEN Code1 = 'A' AND Code2 = 'AA' THEN "A" | "A

Why MySQL You Need to Master for Data Analytics Jobs

Relational databases all use SQL as the domain-specific language for ad hoc queries
MySQL
Before you can start analysing data, you are going to actually have to have some data on hand. That means a database – preferably a relational one.

If you had your sights set on a non-relational, NoSQL database solution, you might want to step back and catch your breath. NoSQL databases are unique because of their independence from the Structured Query Language (SQL) found in relational databases.

Relational databases all use SQL as the domain-specific language for ad hoc queries, whereas non-relational databases have no such standard query language, so they can use whatever they want –including SQL. Non-relational databases also have their own APIs designed for maximum scalability and flexibility.

When You Need to Learn NoSQL Databases?

NoSQL databases are typically designed to excel in two specific areas: speed and scalability. But for the purposes of learning about data concepts and analysis, such super-powerful tools are pretty much overkill. In other words, you need to walk before you can run.
However, if you are just starting out, don’t worry – there’s plenty to learn. By far the most common open source database is MySQL, which is now owned by Oracle. MySQL is ubiquitous on the Internet: The standard web server run by over 65 percent of all websites uses what’s known as a

  • LAMP stack – the “M” of which stands for MySQL. MySQL epitomizes simplicity, too. Skilled data jockeys can use the command line to construct databases and queries with blinding speed. If command lines are a bit steep, then I recommend you install a copy of MySQL Workbench, which is available from the MySQL site free of charge. Workbench enables you to manage MySQL databases visually, making it much easier to explore your data. On the basis of how you feel about Oracle, you might not be too thrilled to give even the venerable MySQL a try. Fortunately, you have some robust alternatives:
  • MariaDB - is the community fork of MySQL founded and developed by Monty Widenius, the founder of MySQL. MariaDB is designed to be highly compatible with MySQL, so you can just replace MySQL with MariaDB instantly, if you want
  • Drizzle - Whereas MariaDB has tried to remain true to MySQL, Drizzle, another community fork, has decided to improve on MySQL radically. Learning Drizzle is a bit different from MySQL, but not so much that you couldn’t migrate back and forth.

How to Install MySQL WorkBench?

To install your own instance of a database, it is recommended you use your distribution’s packages first, to ensure they are tested and all dependencies are checked. Updated packages are available at the sites linked above if your distro doesn’t have a set of these database packages in its repositories.
Naturally, you’re going to want to populate your database with some data – or at least some data with which to experiment.

The MySQL developers are more than aware of this, and have posted up some handy sample databases to start using. Of course, my personal favorite database is the Lahman Baseball Database. Even if you’re not a baseball fan, there’s plenty of rich data in this database to keep you analyzing for months.

To load the database with the use of MySQL Workbench, click the New Server Instance link and connect to localhost. Once that operation is complete, click the Manage Import/Export link to use the Import/Export MySQL Data Wizard to locate the *.sql file you have downloaded (and extracted if necessary) and connect it to the Workbench. Once you have the database loaded, you can use the Workbench application to manage the tables and queries as you need.

Comments

Popular posts from this blog

How to Fix datetime Import Error in Python Quickly

Explained Ideal Structure of Python Class

How to Check Kafka Available Brokers