0% found this document useful (0 votes)
5 views1 page

Dbms Assignment ABC

The document outlines a series of SQL queries and statements for database management tasks. It includes instructions for creating, modifying, and deleting tables and records, as well as managing permissions and transactions. Specific tasks include creating a table for artists, inserting records into a patient table, and granting/revoking permissions for users.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Dbms Assignment ABC

The document outlines a series of SQL queries and statements for database management tasks. It includes instructions for creating, modifying, and deleting tables and records, as well as managing permissions and transactions. Specific tasks include creating a table for artists, inserting records into a patient table, and granting/revoking permissions for users.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DBMS ASSIGNMENT

1. Write a query to create a table named Music.Artists with columns:

o ArtistId (integer, primary key, auto-increment, not null)

o ArtistName (varchar(255), not null)

2. Write the statement to delete all rows from a table called Artists without deleting the table
structure.

3. Write the query to delete the entire table Artists.

4. Write the query to add a new column called city (char(20)) to the table employee.

5. Write the query to modify the column name in the table brands to VARCHAR(255).

6. Write the query to rename the column emergency_contact to contact in the table student
data, with data type varchar(10).

7. Write the query to rename the table students to student_123.

8. Write the query to insert a single record into the Patient table with columns (Surname,
FirstName, DOB, Gender, Weight, Height, Vaccinated).

9. Write the query to insert two records into the Patient table in a single statement.

10. Write an UPDATE query to change the UnitId to 2 where FruitName is 'Apple' and UnitId is 1
in the Fruit table.

11. Write an UPDATE query to change the GroupName from 'Ward' to 'Room' in the Department
table.

12. Write a query to delete a record from the GEHU_EMPLOYEES table where NAME is 'Kunal'.

13. Write a query to delete all records from the employees table.

14. Write a GRANT statement to give SELECT and UPDATE permissions on MY_TABLE to users
SOME_USER and ANOTHER_USER.

15. Write a REVOKE statement to withdraw SELECT and UPDATE permissions on MY_TABLE from
users USER1 and USER2.

16. Write a query to select columns column1 and column2 from table_name.

17. Write a query to select all columns from table_name.

18. Write the statement to begin a transaction.

19. Write the statement to commit a transaction.

20. Write the statement to rollback a transaction.

21. Write the statement to create a savepoint named SAVEPOINT_NAME.

You might also like