SQL Fundamentals - Practice 11
SQL Fundamentals - Practice 11
1. For a specified table, create a script that reports the column names, data types, and data
types’ lengths, as well as whether nulls are allowed. Prompt the user to enter the table
name. Give appropriate aliases to the columns DATA_PRECISION and
DATA_SCALE. Save this script in a file named lab_11_01.sql.
For example, if the user enters DEPARTMENTS, the following output results:
2. Create a script that reports the column name, constraint name, constraint type, search
condition, and status for a specified table. You must join the USER_CONSTRAINTS
and USER_CONS_COLUMNS tables to obtain all of this information. Prompt the user
to enter the table name. Save the script in a file named lab_11_02.sql.
For example, if the user enters DEPARTMENTS, the following output results:
6. Find the names of your sequences. Write a query in a script to display the following
information about your sequences: sequence name, maximum value, increment size,
and last number. Name the script lab_11_06.sql. Run the statement in your script.