Hello Biraj
It seems, it is not possible through the SQL command. However, you can use 'gcloud' command to export the data the table data from Cloud SQL instance to the Google cloud storage bucket. Here is the
documentation link for the command.
Example commands:
[1]
gcloud sql instances export <DATABASE_INSTANCE> \
gs://<CLOUD_STORAGE_BUCKET>/export.sql.gz \
--database <DATABASE_NAME>
[2]
gcloud sql instances export <DATABASE_INSTANCE>
gs://<CLOUD_STORAGE_BUCKET>/filename.csv --database <DATABASE_NAME> -t <table-name>
Also can check this
thread as the reference.
Note: Cloud SQL instance service-account must have appropriate access to the bucket to that service account in order for the export/import to work. You can get the service-account of the SQL instance using the command:
gcloud sql instances describe instance-name or from the Cloud SQL instance overview page.