Question in Snowflake Pro Cetitifcation assesssment - snowflake-cloud-data-platform

Can someone know the right answer for this question encountered during one of my mock exam --
Which SQL statements will not work in the Web UI?
1)CREATE INDEX and DROP INDEX
2)CREATE USER, ALTER USER, DROP USER
3)CREATE TABLESPACE, ALTER TABLESPACE and DROP TABLESPACE
CREATE LOGFILE GROUP, ALTER LOGFILE GROUP and DROP LOGFILE GROUP
CREATE SERVER, ALTER SERVER and DROP SERVER
CREATE WAREHOUSE, ALTER WAREHOUSE, DROP WAREHOUSE
I marked 4 and 5 but got wrong .

In the WebUI, it won't work:
CREATE INDEX and DROP INDEX
There is no direct index in Snowflake, you can manage clustering and
enable Search Optimization.
CREATE TABLESPACE, ALTER TABLESPACE and DROP TABLESPACE
There is no such thing in Snowflake, we don't need to create space for
tables.
CREATE LOGFILE GROUP, ALTER LOGFILE GROUP and DROP LOGFILE GROUP
Snowflake to SaaS, we do not manage data or log files.
CREATE SERVER, ALTER SERVER and DROP SERVER
There is no such feature in Snowfalke.
The following possibilities can be performed:
CREATE USER, ALTER USER, DROP USER
CREATE WAREHOUSE, ALTER WAREHOUSE, DROP WAREHOUSE
You can find your quiz questions here:
SnowPro Certification - On Demand Knowledge Check Questions
If you click on the question itself, you will see the correct answers.

Related

Alter Schema timing out on one particular Schema

I am trying to move a table from one schema to another. I have tried this from table design and through TSQL with an ALTER SCHEMA statement (ALTER SCHEMA SchemaName TRANSFER dbo.ObjectName).
I can do this for any schema in my database except one now as it times out in the designer and runs forever in TSQL. It has 7-8 tables in it that I was originally able to put in the schema but now the schema appears locked. How do I debug this? I see nothing in the standard error logs.

How to copy/recreate indexes, constraints, triggers etc in SQL server?

Background:I needed to copy 2 tables from a backup to a production SQL Server database. Being new to SQL, I thought that I could just drop and insert into and it would work. So naive.
Is there any simple way to copy everything about the good tables (I restored them into a separate backup) into the tables I created in the production DB? I know how to view constraints using "right click on table - tasks - create script - create script using CREATE", but I don't know what to do with this information.
As far as I understood correctly, go to database and:
1. Script Table As -> Create to... Now you got your table with all indexes and other stuff which in the table.
2. Create these table in your new database
3. Copy your data from backup tables to the new.
You can do this with (tablock) for example. Before copying info drop constraints and indexes in new table and then copy your data.
Or without dropping any objects update your index and stats with ALTER
https://learn.microsoft.com/ru-ru/sql/t-sql/statements/alter-index-transact-sql?view=sql-server-2017

How do I prevent a specific user to access a specific table in my SQL database?

I am using SQL Server 2014 and I have a database called MyDatabase which contains several tables. I have a user called User1 who has read permissions on the database.
Assuming I want to prevent User1 from accessing a table called tbl1 (that is, to query or view this table), how can I do it?
Searching on StackOverflow, I have come across this question: SQL Server : can you limit access to only one table
Going by the accepted answer in that question, my SQL query would stand like this:
exec sp_msforeachtable "DENY SELECT ON tbl1 TO [User1];"
GO
Is this the right way to do it? Or is there a more efficient way of tackling this problem?
There is no need to use sp_msforeachtable. Only one table is involved so you can accomplish your task by issuing
DENY SELECT ON tableName TO [userName]
.. or
REVOKE SELECT ON OBJECT::[shemaName].[tableName] TO [userName]

SQL Server 2008 R2 : Truncate Permissions

Can SQL commands like truncate be restricted at the user level (for specific databases / servers)?
A member of my team truncated a production table thinking he was in his development database and I would like to prevent this from happening again (without completely locking down his permissions).
You might try adding a tinyint field (default 0) to the table you wish to protect, and adding a foreign key constraint pointing to a dedicated, single record table. That should protect your table.
That said, you should probably get rid of this guy.
As far as I remember revoking ALTER permission on the table should do the trick (in all versions 2005 through 2012).
A person needs DDL permission on a table to do a TRUNCATE, since it's an unlogged operation. Even if a person has datawriter (or insert/update/delete), but lacks ALTER or DDL_ADMIN, they won't be able to truncate the table.

t-SQL grant permission for table drop and create

How can I Grant some users permission to drop and create a single table only in the SQL 2005 database accessed by our VB.net 2005 Win app?
Some articles suggest Granting Control rights to the table but I cannot make this work. If you think this is teh way to go, can you show me the correct syntax?
You cannot assign DROP or CREATE permissions on a single table, as those are schema and database level permissions:
DROP TABLE requires ALTER permission on the schema to which the table belongs, CONTROL permission on the table, or membership in the db_ddladmin fixed database role.
CREATE TABLE requires CREATE TABLE permission in the database and ALTER permission on the schema in which the table is being created.
If the user has control permissions on the table they may be able to drop it, but you would not be able to create it again. There are two approaches that you could take depending on your requirements:
If you simply need to change the structure of the table, you should use the TRUNCATE TABLE statement to delete all the records (without logging) and then use the ALTER TABLE statement to add/remove columns.
If you really want the user to be able to drop and then create the table again you will need to create the table in a different schema and assign the user the correct permissions for that schema. See this article about using schemas in MS SQL to get you started. Once you have the table in a separate schema you can grant the db_ddladmin role for the new schema to the user and they should be able to create and delete only tables in that schema.
Use this:
DENY ALTER ON SCHEMA::dbo
But this doesn't prevent the user from granting back this right to himself.

Resources