Sqlassignment1 By Ganesh
I created a table with CHECK and DEFAULT constraints to ensure data integrity. Next, I created a table that incorporated various data types, including INT, VARCHAR, CHAR, NVARCHAR, FLOAT, DOUBLE, NUMERIC, DATE, and DATETIME, and inserted sample records into it. Following that, I created a table with an IDENTITY column and performed DELETE and TRUNCATE operations to observe the behavior of the identity values.
Additionally, I created a table with a computed column that calculated a value based on other columns. I also established a relationship between two tables by creating one with a primary key and another with a foreign key. To further test my understanding, I attempted to insert records with invalid or NULL values into the foreign key table to examine the constraints in action.
Moreover, I practiced using cascade commands to update or delete related records. I also performed various ALTER TABLE operations, such as changing column data types and lengths, renaming columns, adding new columns, and dropping existing columns. Finally, I explored the SELECT INTO statement and its uses in creating new tables from existing data.