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.