1) Write an SQL command that retrieves all the data from the CustDetails table.________________________________________________________________________________________________________________________________________________________2) Write an SQL command that retrieves only the first and last names from the CustDetailstable.______________________________________________________________________________________________________________________________________________________3) Write an SQL command that retrieves all the data from the CustDetails table sorting it bythe customer’s last name.________________________________________________________________________________________________________________________________________________________4) Write an SQL command that retrieves all data on only customers living in Eastway from theCustDetails table.________________________________________________________________________________________________________________________________________________________5) Write an SQL command that retrieves all data on only the first four customers from theCustDetails table.________________________________________________________________________________________________________________________________________________________6) Write an SQL command that retrieves all data on only customers with a last name beginningwith ‘S’ through ‘Z’ from the CustDetails table.________________________________________________________________________________________________________________________________________________________7) Write an SQL command that retrieves all data on only customers with the text ‘east’anywhere in the suburb from the CustDetails table.________________________________________________________________________________________________________________________________________________________8) Write an SQL command that retrieves only unique last names from the CustDetails table._______________________________________ _________________________________________________________________________________________________________________9) Write an SQL command that retrieves all the customer details from the CustDetails table iftheir address details have been entered.________________________________________________________________________________________________________________________________________________________10) Write an SQL command that retrieves the total value of orders that have been deliveredfrom the OrderDetails table.________________________________________________________________________________________________________________________________________________________11) Write an SQL command that retrieves the count of orders in December and their total valuefrom the OrderDetails table.________________________________________________________________________________________________________________________________________________________12) Write an SQL command that retrieves all data for all orders sorted by customer numberfrom the OrderDetails table.________________________________________________________________________________________________________________________________________________________13) Write an SQL command that retrieves the Customers last name, first name, suburb and therespective order values which have orders that have been delivered.________________________________________________________________________________________________________________________________________________________14) Write an SQL command that retrieves last name and first name of all customers and theorder numbers of orders they have placed.________________________________________________________________________________________________________________________________________________________15) Write an SQL command that uses a subquery to retrieve all customer data for customersthat live in a suburb other than where anyone with a last name of “Stevens” lives.________________________________________________________________________________________________________________________________________________________16) Write an SQL command that creates a database that has the following structure:Table 2: Name: StaffDetailsColumns:Column Name Data Type Key/Index nullableStaffRef int Key NoLName nchar(25) NoFName nchar(25) NoPhone nchar(25) YesStartDate date No________________________________________________________________________________________________________________________________________________________17) Write an SQL command that inserts a record into the StaffDetails database for staff memberJohn Jacobs, reference 52 who started on 2/11/2009.________________________________________________________________________________________________________________________________________________________18) Write an SQL command that updates the OrderDetails table to show order reference 4 asbeing delivered on 16/12/2009.________________________________________________________________________________________________________________________________________________________19) Write an SQL command that adds a column called “Email” to the StaffDetails table as wealso need email details (allow for 50 characters).________________________________________________________________________________________________________________________________________________________20) Write an SQL command that deletes order reference 9 as the customer has cancelled theorder.________________________________________________________________________________________________________________________________________________________21) Write an SQL command that creates a view called “Contacts” holding staff last name, firstname and phone number as we need a contact list.________________________________________________________________________________________________________________________________________________________22) Write an SQL command that deletes the view “Contacts
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here