Assignment: Create, maintain and query an Oracle table
You need to create a table and do the maintainance and querying using that table.
You need to show me the results of creating the table, maintaining and querying it. I need to see the SQL
command you used and the results that it produced. You should copy and paste both of these to a document
and use a fixed font like Courier New.
Note: When I say single row function, I mean functions that return specific rows/records. When I say group
functions, I mean functions that return information from one or more records as one result. For example an
average would use a group of records and determine and return the average.
- Create an Oracle table with an minimum a varchar2 field, a char field, a number field with decimal places,
a number field without decimal places and a date field. You should include a name
field where the name is entered in the format last name slash first name middle name or initial if any. For
example:
- Doe/John M
- Jones/Mary
- Adams-Costa/Susan Ann
- Langley/M Richard
- Show me a description of the table.
- Populate the table with data and show me the data in the table.
- Change a record and show me the before and after
- Delete a record and show me the before and after
- Alter the structure of the table by adding a field and populating it. Show me the results.
- Alter the structure of the table by adding characters to the varchar2 field. Show me the results.
- Do a search and find out how to alter the structure of the table by deleting a column. Demonstrate
and show me the results. Site the address where you found the explanation.
- Do a search and find out how to alter the structure of the table by renaming a column. Demonstrate
and show me the results. Site the address where you found the explanation.
- Do a query that tests for condition A and condition B and show me the results.
- Do a query that tests for condition A or condition B or condition C and show me the results.
- Do a query that tests for condition A and condition B are both true or condition C and condition D are
both true.
- Do a query that tests for condition A and condition B being true or condition C is true.
- Do a query that tests for condition A being true or condition B and condition C both being true.
- Do a query that tests for condition A being true and either condition B or condition C being true.
- Do a query that does a sort on two fields. Tell me which field is the primary sort and which is the
secondary sort.
- Do a query that uses a single row function to do character manipulation.
- Do a query that uses a single row date function.
- Do a query that uses a single row numeric function.
- Do a query using single row functions that flip the name so that it reads first middle (if any) last
instead of last/first middle. For example:
- Doe/John M should be flipped to be John M Doe
- Jones/Mary should be flipped to Mary Jones
- Adams-Costa/Susan Ann should be flipped to be Susan Ann Adams-Costa
- Langley/M Richard should be flipped to be M Richard Langley