Google Drive

Google Drive,Android 16

ANDROID

Android

UPDATE

Google Updates

VIDEO

Videos

What is CTE in SQL?

A Common Table Expression (CTE) is a temporary, named result set that you define within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or MERGE statement. Think of it as a "temporary view" that exists only for the duration of one query.

They are primarily used to simplify complex joins and subqueries, making your SQL code more readable and maintainable.

Key characteristics of CTEs: 

  • Temporary: CTEs exist only for the duration of the query in which they are defined. They are not stored as objects in the database. 
  • Named: They are given a name using the WITH clause, allowing for clear identification and referencing within the main query or subsequent CTEs. 
  • Reusable: A CTE can be referenced multiple times within the same query, avoiding repetitive code and improving maintainability. 
  • Recursive capabilities: CTEs can be self-referential, enabling the processing of hierarchical data structures (e.g., organizational charts and bills of materials).

When to use a CTE?

Use CTE when:
  • SQL Query becomes long and complicated.
  • You need to reuse a subquery multiple times.
  • You want to perform recursive operations.
  • You want to break a complex query into steps.
  • You want to reference the result set multiple times.

Let's understand how to write CTE with a few examples.

Example 1: Simple CTE to Filter Employees.

This SQL CTE will filter the list of employees getting high salaries.
WITH HighSalaryEmployees AS (
    SELECT EmployeeId, Name, Salary
    FROM Employees
    WHERE Salary > 50000
)
SELECT * FROM HighSalaryEmployees;
This logic is cleaner and reusable.

Example 2: CTE used multiple times.

In this example, we are creating a CTE to fetch sales records of each employee and then filtering them out based on conditions.
WITH SalesCTE AS (
    SELECT EmployeeId, TotalSales
    FROM Sales
)
SELECT * FROM SalesCTE WHERE TotalSales > 100000;

-- reuse same CTE again
SELECT EmployeeId, TotalSales * 0.10 AS Bonus
FROM SalesCTE;
Here, CTE is used in two different select queries, which shows that it is reusable code and can use multiple times.

Example 3: Recursive CTE.

This SQL uses a recursive CTE to build an employee hierarchy (CEO → Managers → Employees) and shows each employee with their hierarchy level.
WITH EmpHierarchy AS (
    -- Anchor Query (Top-Level)
    SELECT EmployeeId, Name, ManagerId, 0 AS Level
    FROM Employees
    WHERE ManagerId IS NULL

    UNION ALL

    -- Recursive Query
    SELECT e.EmployeeId, e.Name, e.ManagerId, h.Level + 1
    FROM Employees e
    INNER JOIN EmpHierarchy h
        ON e.ManagerId = h.EmployeeId
)
SELECT * FROM EmpHierarchy;
After executing the above query, your result set will look like this:

In one of my interviews, the interviewer asked me how we can use CTE to perform INSERT, UPDATE, or DELETE queries. At that time, I was not sure whether we could perform these operations inside CTE or not. So the correct answer is no, you cannot directly insert these queries inside CTE, but you can use CTE while performing these operations.

Note: CTE must contain only a SELECT.

Let's check a few examples:

Example 4: INSERT Query Using CTE.

WITH EmpCTE AS (
    SELECT EmployeeId, Name, Salary
    FROM Employees
    WHERE Salary > 50000
)
INSERT INTO BonusTable(EmployeeId, BonusAmount)
SELECT EmployeeId, Salary * 0.1
FROM EmpCTE;

Example 5: UPDATE Query Using CTE.

WITH EmpCTE AS (
    SELECT EmployeeId, Salary
    FROM Employees
    WHERE Salary < 30000
)
UPDATE EmpCTE
SET Salary = Salary + 2000;

Example 6: DELETE Query Using CTE.

WITH EmpCTE AS (
    SELECT EmployeeId
    FROM Employees
    WHERE Salary < 10000
)
DELETE FROM EmpCTE;

Why can a CTE not contain INSERT, UPDATE, or DELETE?

A CTE (Common Table Expression) is not a table and is not stored anywhere.
It is only a temporary result set that exists only for the duration of the next SELECT, INSERT, UPDATE, or DELETE statement.

Because of this:
❌ CTE can only generate data using a SELECT.
❌ It cannot perform data-modifying operations inside itself.

Logical Answer: A CTE is like a named subquery.
Subqueries cannot contain:
  • INSERT
  • UPDATE
  • DELETE
They only return a dataset.
Since CTE is just a subquery with a name, it also cannot perform DML inside the definition.

Google Play Store Rolls Out AI-Generated Summaries to Simplify App Review Skimming.

Google Play Store in Mobile

The Google Play Store is rolling out a new feature powered by generative AI, designed to save users significant time when researching apps. The platform has begun displaying AI-generated summaries of aggregated user reviews, providing a quick snapshot of public opinion.

This functionality has been in development for some time, with initial signs of its arrival noted over a year ago. The feature is now starting to appear for a broader audience, indicating a general rollout phase.

Cutting Through the Noise of Thousands of Reviews.

The primary role of this new AI tool is to process the large volume of user feedback often associated with popular apps. By absorbing this extensive body of text, the AI can then serve up the information in a concise, easily digestible format.

When available, users will find these summaries under a bolded "Users are saying" heading within the Ratings and reviews section of an app's listing. The summary typically takes the form of a single, informative paragraph.

This paragraph aims to highlight the most common feedback points. Crucially, it attempts to give a balanced view by consolidating both the positive aspects and the prevailing negative points mentioned across the collective user reviews.

Google Play App Review is Generated by AI

Enhancing User Experience and Feature Discovery.

Beyond the paragraph summary, the feature is further enhanced by interactive chips displayed below the text. These chips allow users to "drill down" into the reviews.

Tapping on a chip will filter the results to only show reviews that specifically mention that particular aspect of the app. This makes it easier for potential users to quickly judge features like performance, interface, or specific functionality.

This move by Google follows a trend in the tech industry to use AI for better content aggregation. Amazon has utilized AI-generated product review summaries for some time, and Apple rolled out a similar review summarization feature on the iOS App Store in April.

The new feature is being observed on various devices, though it is not yet universally available across all accounts. This gradual rollout is typical for major Play Store updates.

Google Photos Rolls Out 'Trendy' Video Templates for Easy, Automated Video Creation.

Google Photos Logo

Google Photos is set to drastically simplify the video creation process for its users. The company is introducing a suite of new "trendy" video editing templates, aimed at making it easier than ever to turn a collection of personal memories into a polished, share-worthy video clip.

This significant update is an extension of the existing 'Highlight video' function already found within the application's 'Create' tab. It represents a clear effort by Google to democratize the video editing experience for its massive user base.

What the New Templates Offer.

These new templates are essentially designed as pre-packaged video structures. They allow users to simply slot their photos and video clips into a pre-set, professional-looking visual narrative.

Google has positioned this new tool as a way to offer "easy and automated" video creation for everyone. This removes the barrier of manually aligning clips and music, which can often be time-consuming for casual users.

A key technical aspect of the new feature is the automatic synchronization capabilities. Each template comes pre-loaded with music, ensuring cuts and transitions are precisely beat-matched to the audio rhythm.

Furthermore, the templates include designated placeholders for text overlays. This feature allows users to easily add context, titles, or a complete narrative to their video story.

Google Photos Editing Screenshots

How to Use the Feature.

The process for using the new templates is straightforward, according to the official support documentation. Users will begin by navigating to the 'Create' tab on their Google Photos mobile app.

From there, they select 'Highlight video' where they can now browse through templates for different themes and narratives. Once a template is selected, users simply tap 'Use template.'

Content selection can be done manually by picking the best photos and videos from the gallery. Alternatively, users can leverage an "assisted content selection" option, which uses AI to select the most relevant media for the chosen template.

A Focus on Share-Worthy Content.

While the official support page details the full step-by-step process, a widespread public rollout of the new templates does not yet appear to be live for all users. The feature is expected to arrive on Android devices first.

This move is a clear step by Google to enhance the media editing capabilities within Photos. It makes high-quality video creation accessible, enabling casual users to produce "polished, share-worthy" content with minimal effort.

How To Change Default Search Engine of Chrome Browser.

Your web browser does more than just open websites; it’s your gateway to the internet. Every time you type a query into Chrome’s address bar (also known as the omnibox), it instantly directs you to results powered by your default search engine

Most of us stick with Google because it’s the preset option, but Chrome actually allows you to change this default anytime. Whether you prefer the privacy of DuckDuckGo, the rewards of Bing, or a specialized engine like Startpage, the process is quick and easy. 

In this guide, I’ll walk you through how to change your default search engine on desktop, Android, and iPhone, along with key notes and troubleshooting tips that will help you get the most out of Chrome.

Change Default Search Engine on Desktop.

Let’s start with the desktop version of Chrome, since it offers the most flexibility and customization.

Step 1: Open Google Chrome Settings.

To get started, open Google Chrome on your computer, then click the three-dot menu located at the top-right corner of the browser window. From the dropdown menu, select Settings to open Chrome’s configuration page. 

Alternatively, you can simply type chrome://settings in the address bar and press Enter to access it directly.

Step 2: Go to the search engine section.

In the Settings menu, navigate to the left-hand sidebar and click on Search engine, where you’ll find a Change button, and a list of pre-configured options will appear (e.g., Google, Bing, Yahoo!, DuckDuckGo, Ecosia). Select your desired new default search engine.

Change Default Search Engine in Chrome Browser

Step 3: Managing and Manually Adding a Search Engine.

If your desired search provider is not among the default options, navigate to "Manage search engines and site search" (or "Manage search engines"). Here, you can click Add and manually input the required details: the Search engine name, a Shortcut (keyword), and the URL with %s in place of the query. 

Alternatively, a simpler method is to first visit the desired search engine's website and perform a search; Chrome will often detect and automatically list it in the "Site search" section, from which you can easily click the three dots (⋮) next to the entry and select "Make default."

Change Default Search Engine on Mobile.

You can easily change the default search engine within the Google Chrome app on both Android and iOS devices. This setting controls the engine used when you type a query into the address bar (omnibox).

Here are the professional steps to change the default search engine on mobile:

Step 1: Open Chrome Settings.

To access settings on mobile, open the Chrome app and tap the menu icon (⋮ on Android, typically top right; or ••• on iOS, typically bottom right), then select Settings.

Step 2: Navigate to the Search Engine.

Scroll down to the "Basics" section (on Android) or look through the main menu (on iOS). Tap on the Search engine.

Step 3: Select a New Default Engine.

A list of available search providers (such as Google, Bing, Yahoo!, DuckDuckGo, Ecosia, etc.) will be displayed. Tap the name of the search engine you wish to set as your new default.

The change will be applied immediately. All future searches performed by typing into the Chrome address bar will use the newly selected search engine.

By following these simple steps, users can efficiently customize their Google Chrome browsing experience to align with their privacy preferences, search result format requirements, or regional defaults. Regularly reviewing and managing your default search engine settings ensures your browser behaves optimally according to your specific needs.

Google Gemini AI Starts Rolling Out to Chrome on iOS.

Gemini in Chrome iOS

Google is continuing its aggressive strategy of embedding its Gemini AI capabilities across its entire ecosystem, with the latest integration arriving in Chrome for iOS. This move brings powerful, on-demand AI functionality directly into the mobile browser experience for iPhone users.

While many iOS users default to Safari, the integration caters to a significant subset of users who prefer the Chrome environment on their Apple devices. It eliminates the need to switch to the standalone Gemini app for common queries and page-specific insights.

In-Browser Assistance on iPhone.

The arrival of Gemini in Chrome for iOS was first anticipated after a similar integration was announced for Mac users earlier this year. Its appearance now ensures a unified, in-browser AI experience across platforms.

For those receiving the update, the functionality is reportedly highlighted by a "Get started" banner appearing within the Chrome interface.

The key feature is "Ask Gemini," which allows users to get relevant, contextual answers based on the webpage they are currently viewing. It promises to deliver swift key takeaways and insights without disrupting the browsing flow.

Quick Access and Opt-In Requirement.

Users can access the Gemini feature via the three-dot menu (Page Tools) within Chrome. This opens a dedicated interface where they can input a custom query or select from pre-populated options.

Available prompts include highly useful functions like "summarize page" and "create FAQ about this topic," transforming the way users digest long-form content on their mobile devices.

Crucially, the feature requires an explicit user opt-in to begin functioning. Users must grant permission for the browser to send webpage data to Google for processing by the Gemini model. This ensures transparency and user control over their data.

Phased Rollout Underway.

The rollout appears to be phased, with initial reports suggesting the integration is landing for a subset of users. It is highly likely that, as with many of Google's initial AI launches, the support is currently limited to English-language users in the United States.

As the technology continues to mature, and with Gemini now established on various Android and desktop platforms, its arrival on the iPhone browser signals Google's commitment to making its flagship AI assistant universally accessible, regardless of the operating system.

Viral 'Nano Banana' AI Image Editing Arrives in Google Lens and Search AI Mode.

Google AI Mode

Google is dramatically enhancing the creative capabilities of its core apps, bringing the popular "Nano Banana" image editing and generation feature directly into Google Lens and the Search AI Mode. This integration provides users with a powerful, fun, and accessible way to generate and manipulate images using simple prompts.

The feature, which utilizes the advanced Gemini 2.5 Flash Image model, first gained viral traction within the standalone Gemini app. Its expansion signifies Google’s push to embed generative AI directly into the daily tools people use for visual search and creation.

AI Mode Gets a Dedicated Creation Shortcut.

In the Search app's dedicated AI Mode, the "Nano Banana" functionality is now easier to access than ever. Users will notice a new plus icon ('+') situated in the bottom-left corner of the main prompt box.

Tapping this icon reveals a menu that allows users to access the Gallery, Camera, or a new option: "Create Images," accompanied by a banana emoji. This dedicated shortcut streamlines the creative workflow.

Upon selecting this option, the standard prompt hint changes to "Describe your image." From here, users can either type a prompt to generate an entirely new image or select an existing photograph to apply edits.

Any image generated through this feature will be marked with the standard Gemini spark watermark in the bottom-right corner, clearly identifying its AI origin.

Viral Nano Banana AI Image Editing

Google Lens Launches New 'Create' Tab.

Perhaps the most significant change is the introduction of a new "Create" tab within Google Lens. This redesign also features a minor UI tweak, moving the text labels below the icons to better accommodate multiple filters.

The new tab is heavily geared toward real-time capture and sharing, prompting users to "capture, create, and share" their creations. A prominent banana emoji is even featured on the shutter button.

Notably, the "Create" tab defaults to the front-facing camera, suggesting an immediate focus on AI-enhanced selfies and real-time artistic manipulations.

After capturing an image, it is automatically routed to the AI Mode's prompt box, where users can then add a text prompt to apply generative edits or transformations.

Availability and Broader AI Push.

The "Nano Banana" integration in Google Lens and AI Mode is currently being observed on Android devices in the US for users who have opted into the AI Mode Search Lab. A wider rollout is expected in the coming weeks.

This rollout aligns with Google’s broader global expansion of its AI capabilities. Just this week, the company announced that AI Mode has been expanded to support 35 new languages and over 40 new countries/territories, bringing its total reach to over 200 regions globally.

Chrome Fights Notification Fatigue with Automatic Permission Revocation.

Google Chrome Logo

Google is taking a major step to combat "notification fatigue" by updating its Chrome browser on both desktop and Android platforms. The new feature will automatically revoke notification permissions from websites that users no longer interact with regularly. This aims to restore the signal-to-noise ratio of notifications, making the alerts that do appear more meaningful.

This privacy-and-usability-focused move mirrors a similar permission revocation system that Google introduced for native apps back in Android 11. That system allows the operating system to cut off access to sensitive permissions, such as camera or location, for apps that haven't been used in a while.

Chrome previously gained a similar trick via its Safety Check feature, which could automatically revoke permissions like camera, microphone, and location access from infrequently visited sites. Notifications, however, were notably excluded from this automated cleanup until now.

Google Chrome Screenshot

The new policy will specifically target notification permissions for standard websites, excluding installed web apps. Google confirms the browser will always notify the user when a permission is being revoked, preventing any sudden surprises about missing alerts.

For sites where Chrome might have incorrectly guessed user intent, the user retains full control. They can easily choose to re-enable notifications for a specific site or even disable the entire automatic revocation tool if they prefer the old system. Ultimately, this change offers a much-needed, low-effort way for users to clear out excessive notification chatter and focus on the alerts that truly matter.

Also Read:

DON'T MISS

AI
© all rights reserved
made with by WorkWithG