Assume you are running a football club and you wish to keep track of all your important
Question:
Assume you are running a football club and you wish to keep track of all your important players' details in a SQL database.
i) Write the SQL query that will allow the manager to create a table named "Players" and have the fields as ID, FirstName, LastName, Age, PhoneContact and EmailAddress.
ii) Write the SQL query that will make the field "ID" a PRIMARY KEY and also an IDENTITY which is (1, 1).
iii)Write the SQL query that will allow users to use ORDER BY and see all the age in DESC order.
iv) Write the SQL query that will allow users to UPDATE the details of ID 3 where his age should be 22 rather than 32.
v) Write the SQL query that will allow users to add a new field using the ALTER command, the name of the field is "MiddleName" and it should be positioned after FirstName.
vi) Write the SQL query that will enable the users to DELETE a record where the Player ID.
vii) Write the SQL query that will allow the users to DELETE the entire records in the table.
viii) Write the SQL query that will allow the users to DROP the table called "Players" to make it seem that it didn't even exist.
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi