Found 4378 Articles for MySQL

How to select subsets of data In SQL Query Style in Pandas?

Kiran P
Updated on 10-Nov-2020 06:52:12

281 Views

IntroductionIn this post, I will show you how to perform Data Analysis with SQL style filtering with Pandas. Most of the corporate company’s data are stored in databases that require SQL to retrieve and manipulate it. For instance, there are companies like Oracle, IBM, Microsoft having their own databases with their own SQL implementations.Data scientists have to deal with SQL at some stage of their career as the data is not always stored in CSV files. I personally prefer to use Oracle, as the majority of my company’s data is stored in Oracle.Scenario – 1 Suppose we are given a ... Read More

Creating a MySQL Docker Container

Raunak Jain
Updated on 27-Oct-2020 08:07:38

388 Views

One of the most important features of Docker Containerization is that it creates a bounded environment for running the Application with all the necessary dependencies and packages installed. Most applications require a backend database to store data points. Oracle provides Docker Images for running MySQL inside Containers and thus it becomes an excellent choice for testing your database applications. It provides lightweight MySQL Image instances with cleanup features once your testing is completed.Docker allows you to download the Image containing the MySQL binaries and dependencies and creates a virtual filesystem. Note that if you start a Docker Container with the ... Read More

Convert timestamp coming from SQL database to String PHP?

AmitDiwan
Updated on 12-Oct-2020 13:26:15

377 Views

To convert timestamp to string, use setTimestamp(). Let’s say the following is our input i.e. timestamp −$SQLTimestamp = 1600320600000;We want the following output i.e. Date string −2020-09-17 05:30:00At first, get seconds from Timestamp −$seconds = round($SQLTimestamp/1000, 0);Example Live Demo Output2020-09-17 05:30:00

Sum of the first and last digit of a number in PL/SQL

sudhir sharma
Updated on 06-Aug-2020 08:15:02

802 Views

In this problem, we are given a number n. Our task is to create a program to find the sum of the first and last digit of a number in PL/SQL.First, let’s brush-up about PL/SQL, PL/SQL is a combination of SQL along with the procedural features of programming languages.Let’s take an example to understand the problem, Input − n = 31415Output − 8Explanation − first digit = 3 , last digit = 5. Sum = 8To, solve this problem, we will extract the first and last digit to number n. And the print their sum.The first and last digits are ... Read More

Difference between Simple and Complex View in SQL

Nitin Sharma
Updated on 09-Jun-2020 09:02:15

2K+ Views

Before discussing on Simple and complex, first we should know what is View. A View is the logical virtual table created from one or more tables which can be primarily used to fetch the columns from one or more different tables at a time. On the basis of tables involved in the view we can distinguish between Simple and Complex View in SQL.Following are the important differences between Simple and Complex View.Sr. No.KeySimple ViewComplex View1DefinitionSimple View in SQL is the view created by involving only single table. In other words we can say that there is only one base table ... Read More

Difference between Views and Materialized Views in SQL

Kiran Kumar Panigrahi
Updated on 02-Sep-2023 12:58:54

54K+ Views

The main constituent of any database is its tables, in order to make data accessibility custom there is concept of Views in other words we can say that with the help of Views of a table we can restrict any user to access only that data which is supposed to be accessed by him. Now on the basis of characteristic and features of the views we can distinguish between Views and Materialized Views. In this article, we will discuss the important differences between Views and Materialized Views in SQL. But before, let’s have look into the basics of views and ... Read More

Count no. of characters and words in a string in PL/SQL

Sunidhi Bansal
Updated on 15-May-2020 10:21:54

2K+ Views

We are given a string of any length and the task is to calculate the count of characters and words in a string using PL/SQL.PL/SQL is a combination of SQL along with the procedural features of programming languages.It was developed by Oracle Corporation in the early 90's to enhance the capabilities of SQL. PL/SQL is one of three key programming languages embedded in the Oracle Database, along with SQL itself and Java.In PL/SQL block, we have DECLARE block which is used to declare the variables used in programming and we have BEGIN block where we write the logic for the ... Read More

Convert distance from km to meters and centimeters in PL/SQL

Sunidhi Bansal
Updated on 15-May-2020 08:27:43

407 Views

The task is to convert the distance from kilometers to meters and centimeters in PL/SQL.PL/SQL is the extension of SQL which combines the Data manipulation of SQL with the working of procedural language.According to the problem we should have distance in kilometers whose value we have to convert in meters and centimeters.As per the conversion rule −1km = 1000 meters1km = 100000 centimetersAccording to this conversion rule we want the distance to be converted by a logic in PL/SQL.ExampleInput: kilometer = 10 Output: meter = 10000    Centimeter = 1000000 Input: kilometer = 9 Output: meter = 9000    Centimeter ... Read More

Implement a query similar to MySQL Union with MongoDB?

AmitDiwan
Updated on 11-May-2020 10:01:25

476 Views

For a similar query to UNION two collections, use JOIN in MongoDB along with aggregate(). Let us create a collection with documents −> db.demo486.insertOne({_id:1, "Amount":30, "No":4}); { "acknowledged" : true, "insertedId" : 1 } > db.demo486.insertOne({_id:2, "Amount":40, "No":2}); { "acknowledged" : true, "insertedId" : 2 } > db.demo486.insertOne({_id:3, "Amount":60, "No":6}); { "acknowledged" : true, "insertedId" : 3 }Display all documents from a collection with the help of find() method −> db.demo486.find();This will produce the following output −{ "_id" : 1, "Amount" : 30, "No" : 4 } { "_id" : 2, "Amount" : 40, "No" : 2 } { "_id" ... Read More

Difference between Static SQL and Dynamic SQL

Mahesh Parahar
Updated on 16-May-2020 14:18:51

23K+ Views

Static SQLStatic SQL refers to those SQL statements which are fixed and can be hard coded into the application. As static sqls are fixed queries, these statements can be analysed and optimized and do not require any specific handling for security purpose.Dynamic SQLDynamic SQL refers to those SQL statements which are generated dynamically based on user's input and run in the application. Dynamic Sqls helps to develop general and flexible applications. Dynamic SQL may need more permissions and security handling and a malicious user can create dangerous code as well.Following are some of the important differences between Static Routing and ... Read More

Advertisements