How to do Sql Merge statement on pandas data frame in python

I am new to python dataframes so please help me do a merge on pandas dataframe.

df1

custid   custname    email              phone
 x         tina     z.gmail.com        345-345-3456
 y         mina     z1.gmail.com       445-345-3456
 z         zina     z2.gmail.com       555-345-3456
 q         pina                        233-456-3456

df2

custid   custname    email              phone
 x         tina     z.gmail.com        345-345-3456
 y         xina     z1.gmail.com       445-345-3456
 k         tina     tina@gmail.com    703-234-3456
 q         pina     pina@gmail.com    233-456-3456

I want the desired output.

Insert update and delete .Update should happen if the value in not null in df1.If it is null in df1 and have value in df2 then don't update.

df3

custid   custname    email              phone                    Action
 x         tina     z.gmail.com        345-345-3456               None
 y         mina     z1.gmail.com       445-345-3456               Update
 z         zina     z2.gmail.com       555-345-3456               Insert
 k         tina      tina@gmail.com    703-234-3456               Delete
 q         pina     pina@gmail.com     233-456-3456                 None

The Beginner’s Guide to Low-Cost Business Ideas

For some people, the more time you spend working for someone else, the more you want to branch out on your own and create your own business. 

Entrepreneurship appeals to many people when it comes to being your own boss, but the logistics and reality of it can be very different from the initial expectation.

It is undeniable that there are some great benefits to starting a business, but those benefits come with their fair share of challenges as well. 

One of those challenges is the thing you need to get off the ground: deciding what business idea to run with. 

You may have a bunch of great ideas, but it can be difficult to determine which ideas have the greatest potential of success–without spending too much to get started. 

To start, you will want to stick to low-cost business ideas so that you can ensure you know the ins and outs of running a business before diving into something that requires a lot more capital. 

We are here to help. Read on for our beginner’s guide to low-cost business ideas.

What Are Low-Cost Business Ideas?

Low-cost business ideas are just that: business ideas that don’t require a lot of money to start. 

Businesses need minimal capital to launch and are often service-based businesses, as they have lower overhead costs than businesses that are product-based. 

Though many people may desire to be an entrepreneur, some stop at turning their dreams into reality because of the costs and effort involved with starting a business. 

However, if you find the right low-cost business idea, you don’t have to let startup money get in the way of your dreams. 

The Basics of Low-Cost Business Ideas

You’ll want to start by answering some questions before jumping into the deep end of launching a new company.

Below, we share the most important ones to consider, so read through them and find your answers before moving forward.

Are You Ready?

You can’t wait for the perfect moment to start a business because that “perfect” moment never exists. There will always be work, life, and other obligations. 

However, when it comes to low-cost business ideas, you need to ensure you’re in the right headspace. 

Are you confident in yourself and your work? Are you excited about the idea of running your own business (even the not-so-glamorous parts of it)? 

To take your ideas and turn one or more of them into a successful business, you need to be mentally prepared. This is important because every entrepreneur runs into challenges along the way, and if you aren’t in the right mindset to make the business profitable despite hurdles along the way, then minor things may completely derail you. 

However, if you’re in the right headspace, then it may feel as if nothing can get in the way of your business idea’s success.

Being in the right mindset means feeling confident in your idea, putting in the time to prepare and research, and being adaptable. You have to be completely convinced this is the right move for you, even when it feels like things are going wrong. 

Self-doubt is normal, but to move forward with starting a business, you have to drown out that inner critic and be confident in what you’re doing.

What Kind of Business Do You Want to Start?

This can be the most fun part of the process but also one of the most challenging. This is the heart and soul of your business. 

Take plenty of time to determine what kind of business you want to start. 

Figure out what you’re passionate about. Think about whether you have a hobby that you’re interested in turning into a business.

You also want to ask yourself if you want to own a business that you’re heavily involved in day-to-day operations, or rather something that you simply own that makes a more passive income. 

There is no shortage of low-cost business ideas, and here are some of the top ones you may want to consider. 

Dropshipping. This business involves fulfilling orders from your website by a third-party supplier. It has a very low overhead, is hands-off, and has a ton of growth potential. With dropshipping, you never actually handle any product yourself. Instead, you simply make the sales and pass the orders to your suppliers. Dropshipping is one of the quickest and most cost-effective businesses you can start, though the market can be oversaturated and it can be difficult to grow.

Services/Consulting. You can start a business using your skills in content marketing and blogging, social media marketing, graphic design, website development, photography, bookkeeping, and more. If you are skilled in any service-based area, you can start a business from home working for clients as a freelancer or consultant.

Online Courses. As learning via the internet is becoming more and more popular, people are turning to online courses to educate themselves about subjects, from how to use Photoshop to sales and marketing strategies to how to start a company. You don’t have to worry about tangible products or shipping costs, and you have complete control of how the courses are structured and sold. 

Cooking/Baking. During quarantine, many people got more into cooking at home, and some discovered that they are great at making bread or decorating cakes. It is possible to turn this skill into a low-cost business, as all you have to pay for are the ingredients used in your bread or cakes and build a website to sell them. Or even sell them to local stores and cafes.

Online clothing store. If you have a passion for fashion, you may want to think about starting an online fashion store. To keep costs down, you can sell items from other online vendors (via dropshipping, as mentioned above). 

Selling a book. You don’t have to be an aspiring novelist to write a book. You could create a nonfiction book about business, a cookbook, a children’s book, a comic book, a photo book, etc. There are many options when it comes to writing a book. The real investment with this type of business is time. You can opt for self-publishing and printing your book on-demand so that you don’t get overwhelmed with trying to sell a bunch of inventory.  

Tutoring. Do you have strong skills in math, English, or any other subject? Consider starting a tutoring business. Costs to get this type of business started are simply marketing. No additional materials/costs are needed.

What Costs Are Involved?

Since you are interested in low-cost business ideas, you need to figure out the costs involved in getting the ball rolling for every idea that comes your way. 

You should aim to find businesses whose only major costs involve marketing the business and that don’t require you to buy specialized equipment or products. The less you have to put into materials, the more profit you stand to gain.

However, there are some monetary investments needed. In most cases, you will need a website (including hosting and a domain name) and a computer to get started. We highly recommend Bluehost or its affordable hosting plans and guaranteed uptime. You can get shared hosting starting at $2.95 per month. 

If you can create your own service-based website using a free website builder, such as our top pick of Wix, you’ll save a lot of money because you won’t have to hire a website designer. If you need an ecommerce website builder, Shopify is an affordable option, which we’ll go into more below.

When it comes to logos and branding, there are free and low-cost tools for that, too, such as using Canva to create your own or hiring a very affordable designer on Fiverr.

3 Tools to Find Your Low-Cost Business Idea

Modern-day tools are a great way to take some of the stress off of your back and to help make processes involved in your business much easier so that you can focus on other important things. 

Here are some of our favorite tools to use to improve your business ideas and find the right one for you.

Keywords Everywhere

When you are getting started, make a list of the things you are passionate about and/or are interested in creating a business for. It could be things such as running, food, fashion, writing and more. 

Once you’ve compiled that list of potential business ideas, you will want to look up the search volume of each word using Keywords Everywhere.  

With this tool, you gain access to the following information: 

  • Search volume. An average of the total number of searches that people have performed for a given keyword. It is measured per month over the last year.
  • Cost per click. This is the amount that advertisers pay for a single click for a specific word in Google Ads.
  • Competition. This helps you to gauge the number of advertisers running ads on Google AdWords for a given keyword.
  • Trend data. Provides historical monthly trend data for Google and YouTube from 2004 and 2008. 

The pricing for Keywords Everywhere is not a monthly subscription but is instead based on the number of keywords you plan to search. 

One keyword = one credit, and credits are available for the following prices: 

  •  $10 for 100,000 credits
  • $50 for 500,000 credits
  • $100 for 1,000,000 credits
  • $200 for 2,000,000 credits
  • $500 for 5,000,000 credits
  • $1000 for 10,000,000 credits

Shopify

If your low-cost business ideas involve selling physical products, you will need an online store and can use an ecommerce-specific website builder like Shopify

Over a million trusted brands use this platform to sell, ship, and process payments.   

Shopify provides all the tools you need to build your online store in a matter of minutes, including: 

  • Drag-and-drop store builder
  • 70+ professional themes
  • Customizable templates and features
  • A domain name
  • Full blogging platform
  • Free SSL certificate 

Shopify allows you to try the platform for free for 14 days, with no credit card required. If you like what you find, you can upgrade to one of Shopify’s paid packages after the trial period. 

Basic Shopify. $29 per month. Best for new ecommerce businesses with occasional in-person sales. 

Shopify. $79 per month. Best for growing businesses that are either online or in-store. 

Advanced Shopify. $299 per month. Best for scaling businesses that need advanced reporting.

You can use the Shopify App Store to add features and additional functionality to your site, and all of the paid plans come with hosting, so you will not need to pay for that separately. Shopify supports a ton of payment processing options, dropshipping stores, and is scalable, so it will grow with you.

Google Ads

Once you have your business idea figured out, you’ll want to start thinking about how to advertise. Google Ads is one of the best ways to do this. 

Google Ads works to tailor your ads based on the results that you’re looking for. So, in Google Ads, you choose an advertising goal, and the program works with you to help create the ad that fits your needs. 

You then choose where you want your ads to be shown, what you want them to say, your budget, and you’re ready to rock and roll. 

The pricing for Google Ads depends on your budget, which means it is as expensive or as cheap as you want it to be. You will never pay more than what you set your monthly cap to be, and you can stop using the service at any time if you find it isn’t working well for your business.

4 Tricks for Low-Cost Business Ideas

Though there is some luck involved in coming up with a successful low-cost business idea, a lot of comes down to planning and execution. 

Here are some of our top tips to help you with the parts that you don’t want to leave to luck.

Get Input From Others

When you are throwing around business ideas in your head, be sure to run them by other people you trust. This may be friends, family, and colleagues, or can be people that will serve as your target market. 

However, the people you get input from should also include those with successful businesses. Look for people who have experience in running a business, and make sure to ask about what works and what doesn’t.

Solve a Problem

To help you decide what low-cost business to get into, start by identifying problems that people have. A fashion boutique allows people express themselves in a unique way and give them confidence. A tutoring business helps teach people more about subjects they are struggling with. 

So if you get stuck with ideas, look for problems and think about how you can create a low-cost solution for them.

Keep It Simple

Simplicity is a hard thing to remember as your take some of your business ideas and start to see how they would work in reality, but it is imperative to keep things simple. 

Don’t overcomplicate your business by trying to add too many frills or options. Start with something small and grow when the time is right. Otherwise, you run the risk of ending up with a business that is too elaborate and very expensive.

Don’t Quit Your Day Job Yet

While you’re working on ideas for your low-cost business, keep your day job. It will be a tough time, as you will be spending nights and weekends building your business while you work your day job. 

However, it ensures that you are still earning money during the first stages of your business, which are often the hardest and the ones that have the lowest return financially. 

Once your business has a strong cash flow, you can start to think about quitting your day job. 

What to Do Next

Once you’ve settled on an idea you love for your low-cost business, start talking about it. Spreading the word is key to its success. Do this via social media, networking events, marketing, and speaking if you have the opportunity. 

One of the first steps you want to take after getting your business started is registering your business name. This helps to establish the credibility of your company. If you aren’t sure how to do this, we have created a guide on registering a business name here

You also need an effective social media strategy. If this sounds like something you have minimal or no knowledge about, we’ve got you covered in our article on how to effectively market your small business on social media

Get Net Income from Income and Expenditure Tables by Date

I want to be able to write an SQL statement that pulls the sum of revenue and expenditure for each day and gets net income for each day with the distinct dates available in the Income and Expenditure tables. I have tried the following statement, but I'm not getting the desired result. I'm using MS Access.

SELECT
    Income.IncomeDate,
    SUM(Income.AmountPaid) AS IncomeAmount,
    Expenditure.ExpenseDate,
    SUM(Expenditure.TotalAmount) AS ExpenseAmount,
    IncomeAmount - ExpenseAmount AS NetIncome
FROM Income FULL OUTER JOIN Expenditure ON Income.IncomeDate=Expenditure.ExpenseDate
GROUP BY Income.IncomeDate
ORDER BY Income.IncomeDate

How to Create Advanced Search Form in WordPress for Custom Post Types

Do you want to create an advanced search form in WordPress for custom post types?

If you use custom post types, then you may want to create a form that allows visitors to search only that content. This can help people find what they are looking for and keep them on your site for longer.

In this article, we will show you how to create an advanced search form for custom post types in WordPress, step-by-step.

How to create advanced search form in WordPress for custom oost types

Why Create an Advanced Search Form for Custom Post Types?

Custom post types allow you to go beyond posts and pages and make different content types for your website. For example, we use custom post types here at WPBeginner to organize our Deals and Glossary sections.

However, WordPress doesn’t include custom post types in its search results by default. As a result, visitors may miss out on important content, and you will miss out on pageviews.

Thankfully, you can include custom post types in your search results using a WordPress search plugin. You can even go one step further and create an advanced form that searches custom post types only.

For instance, at WPBeginner, we have created custom post type search forms on our Deals and Glossary pages.

An example of a custom search form on the WPBeginner website

Often, this kind of advanced search form will help visitors find what they are looking for faster, which will improve the visitor experience and reduce the bounce rate.

First, you can see our guide on how to make custom post types in WordPress. Then, you can jump into our tutorial on how to create an advanced WordPress search form for custom post types.

Create a New WordPress Search Algorithm With a WordPress Plugin

The easiest way to create an advanced search form for custom post types is by using the SearchWP plugin. It’s the best search plugin and allows you to search content that WordPress ignores by default.

For example, you can make blog comments searchable and add PDF indexing and searching to your website.

How to Set up SearchWP

The first thing you need to do is install and activate the SearchWP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you must go to SearchWP » Settings and click on the ‘General’ tab.

Activating the SearchWP search plugin

You now need to enter your license in the ‘License Key’ box. You can find this information in your account on the SearchWP site.

Once you are done, make sure to click the ‘Verify Key’ button.

Creating a Custom Search Algorithm

Your next task is creating a custom search algorithm. It allows you to specify the content that SearchWP includes in its search results, like pages, posts, media, and any custom post types.

To get started, you need to go to SearchWP » Algorithm in your WordPress admin dashboard.

Creating a search algorithm using SearchWP

Here, you will see a section for every content type that SearchWP includes in its search results.

To add your custom post type, just click the ‘Sources & Settings’ button.

How to add custom post types to a WordPress search engine

In the popup that appears, check the box next to each custom post type that you want to include in the search results.

After that, click on ‘Done’.

Creating a WordPress search form for custom post types

SearchWP will add a new section for each custom post type. Each section shows all the attributes that SearchWP will include in its searches, such as the title, slug, and excerpt.

If you want to add or remove attributes, then simply click on ‘Add/Remove Attributes’.

Creating a search form for custom post types

In the popup, check the box next to each attribute you want to include in the search results.

To remove an attribute, you can uncheck its box instead.

Adding attributes to the SearchWP search algorithm

In this popup, you can also make custom fields searchable in WordPress.

When you are happy with the changes you have made, go ahead and click on ‘Done’.

You will notice that each attribute also has an Application Attribute Relevance slider. This controls how SearchWP ranks the content when building its search results page in WordPress.

If an attribute has high relevancy, then it will have a bigger impact on the search results. By contrast, content that matches an attribute that has less relevancy will appear lower in the search results.

For example, if you move the ‘Title’ slider to the right and the ‘Content’ slider to the left, then a post’s title will carry more weight than the content.

Creating a custom search form for your WordPress blog or website

Every WordPress website is unique, so you may want to try different relevancy settings to see what gives you the most accurate and helpful search results.

For example, if you have created a ‘customer reviews’ custom post type for your online store, then this is important content, so you may want to give it a high relevance.

When you are happy with how the search feature is set up, just scroll to the top of the screen and click the ‘Save’ button.

Saving the custom post type search algorithm

SearchWP will now rebuild the index automatically. Depending on the speed of your Internet connection and your WordPress hosting provider, this may take a few minutes.

As soon as you see ‘Index Status 100%’, you will know that SearchWP has added your custom post types to its search index.

Adding custom post types to the WordPress search index

Your WordPress blog, website, or online marketplace will now include custom post types in its search results.

Create an Advanced Search Form for Custom Post Types

With that done, you are ready to make an advanced form that searches your custom post types only.

To get started, head over to SearchWP » Search Forms and click the ‘Add New’ button.

Creating a new custom search form

This creates a new form, ready for you to customize.

To give this form a unique name, click on the small pencil icon next to ‘Search Form 1’.

Renaming the custom search form using SearchWP

You can now type in a name for the custom search form.

This is just for your reference, so you can use anything that helps you identify the form in your WordPress dashboard. This is particularly important if you plan to create multiple search forms in WordPress.

Creating an advanced search form using SearchWP

After that, you can choose the layout you want to use using the ‘Layout Theme’ thumbnails.

Simply click on the different themes to see a preview of how this style will look on your WordPress website.

Choosing a theme for the custom search form

To create a search form for custom post types, you will typically want to use either ‘Basic’ or ‘Quick Search’.

These styles don’t allow visitors to search by category, which helps to keep them focused on custom post types.

Creating a quick search form for your WordPress website or blog

After making your decision, scroll to the ‘Custom Styling’ section.

The settings you see may vary depending on your theme layout. For example, if you selected ‘Quick Search’, then the ‘Quick Search’ setting will be enabled by default.

Adding custom styling to a search bar in WordPress

You can disable and enable the different options using their toggles.

The live preview will update automatically as you make changes, so you can try different settings to see what works the best.

By default, the form will search media, pages, and posts and ignore custom post types. To include custom post types, you need to find the ‘Type of search’ field and give it a click.

Searching posts, pages, media, and more using SearchWP

You can now type in the name of each custom post type.

When the right post type appears, give it a click to add it to the search.

Adding custom types to a WordPress search bar or form

Do you want to search custom post types only and ignore all other content?

Then just click the small ‘X’ next to ‘Media’, ‘Pages’, and ‘Posts’.

Removing post types from a custom search algorithm

With that done, the form will search your custom post types only.

When you are happy with how the form is set up, scroll to the ‘Form Style’ section. Here, you can choose between different form styles, add a border, change the font size, and more.

Changing the WordPress form style

Under ‘Button Style’, you can customize the ‘Search’ button that appears in the form.

When you are happy with how the form is set up, scroll to the top of the screen and click on ‘Save’ to store your settings.

Saving the custom search settings on your website or blog

How to Add the Custom Post Types to WordPress

Now, you are ready to add the search form to WordPress using either a shortcode or block.

The easiest method is to use a block, so head over to the page or post where you want to add the custom post type form.

You can then click on the ‘+’ icon and type in ‘Search Form’.

Adding a search block to your WordPress blog or website

When the right block appears, give it a click.

Next, open the ‘Select a Form’ dropdown menu and choose the search form you made during this tutorial.

Showing a custom search from in WordPress

When you are ready to make the search form live, simply click on either ‘Update’ or ‘Publish’. Now, you can visit your website to see the search form in action.

Another option is to add the search form using a shortcode.

To get the shortcode, you need to head over to SearchWP » Search Forms. Here, find the search form that you want to show and copy the value in the ‘Shortcode’ column.

Getting the shortcode for a custom search form

You can now add the shortcode to any page, post, or widget-ready area. For step-by-step instructions on how to do this, please see our guide on how to add a shortcode in WordPress.

We hope this article helped you learn how to create an advanced search form in WordPress for custom post types. You may also want to see our custom post types tutorials and our expert picks for the best WordPress plugins to grow your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Create Advanced Search Form in WordPress for Custom Post Types first appeared on WPBeginner.